From f922154f65163bbab164ee377200b6412a367dd2 Mon Sep 17 00:00:00 2001 From: Alexey Soloviev Date: Wed, 16 Mar 2011 10:39:46 +0300 Subject: [PATCH] dd: free allocated memory if CLEANUP enabled Signed-off-by: Alexey Soloviev Signed-off-by: Denys Vlasenko --- coreutils/dd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coreutils/dd.c b/coreutils/dd.c index 347a19454..9973a145b 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; } -- 2.25.1