[git commit] md5/sha1sum: fix small resource leak

Denys Vlasenko vda.linux at googlemail.com
Sat Apr 16 16:49:39 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=88a838438819f7a5224a2ab3ea99219f9a666bf4
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Alexey Fomenko <ext-alexey.fomenko at nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/md5_sha1_sum.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 09f3a00..8270d97 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -107,6 +107,9 @@ static uint8_t *hash_file(const char *filename)
 
 	src_fd = open_or_warn_stdin(filename);
 	if (src_fd < 0) {
+		if (ENABLE_FEATURE_CLEAN_UP) {
+			RELEASE_CONFIG_BUFFER(in_buf);
+		}
 		return NULL;
 	}
 
-- 
1.7.3.4



More information about the busybox-cvs mailing list