tr: free allocated memory in tr if CLEANUP enabled
authorAlexey Soloviev <EXT-Alexey.Soloviev@nokia.com>
Sun, 6 Mar 2011 17:21:07 +0000 (18:21 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 6 Mar 2011 17:21:07 +0000 (18:21 +0100)
Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/tr.c

index 21d77ef95604d5f2040edf301e9a6df28d5a1c55..5b2b9a9a4789ea909018aa14fa933fc92d4fc4d2 100644 (file)
@@ -324,5 +324,11 @@ int tr_main(int argc UNUSED_PARAM, char **argv)
                str2[out_index++] = last = coded;
        }
 
+       if (ENABLE_FEATURE_CLEAN_UP) {
+               free(vector);
+               free(str2);
+               free(str1);
+       }
+
        return EXIT_SUCCESS;
 }