md5/sha1sum: fix small resource leak
authorAlexey Fomenko <ext-alexey.fomenko@nokia.com>
Sat, 16 Apr 2011 16:49:39 +0000 (18:49 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 16 Apr 2011 16:49:39 +0000 (18:49 +0200)
Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/md5_sha1_sum.c

index 09f3a00..8270d97 100644 (file)
@@ -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;
        }