summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Soloviev <EXT-Alexey.Soloviev@nokia.com>2011-03-16 07:39:46 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2011-03-22 16:42:29 (GMT)
commitf922154f65163bbab164ee377200b6412a367dd2 (patch)
tree2ca287ab365644d1eef14b6f2367dc87d8bb15aa
parentbeea5a70c34bdcf2b02c37e6f56d2efcbd90fedb (diff)
downloadbusybox-f922154f65163bbab164ee377200b6412a367dd2.tar.gz
busybox-f922154f65163bbab164ee377200b6412a367dd2.tar.bz2
dd: free allocated memory if CLEANUP enabled
Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/dd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 347a194..9973a14 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -397,5 +397,11 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
out_status:
dd_output_status(0);
+ if (ENABLE_FEATURE_CLEAN_UP) {
+ free(obuf);
+ if (flags & FLAG_TWOBUFS)
+ free(ibuf);
+ }
+
return exitcode;
}