[git commit master 1/1] tr: free allocated memory in tr if CLEANUP enabled

Denys Vlasenko vda.linux at googlemail.com
Sun Mar 6 17:21:07 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=41478ade4f28cbacd954c9663d851c374d33f6b9
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev at nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/tr.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/coreutils/tr.c b/coreutils/tr.c
index 21d77ef..5b2b9a9 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -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;
 }
-- 
1.7.3.4



More information about the busybox-cvs mailing list