supermin/0001-ext2-fix-small-memory-leak-on-error.patch
2014-10-07 15:27:35 +02:00

27 lines
716 B
Diff

From b84a7d38902199382a7264cc17be509384940020 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 9 Sep 2014 14:43:02 +0200
Subject: [PATCH] ext2: fix small memory leak on error
When failing to read the output of `readlink -f`, free the memory buffer
used for it.
---
src/ext2fs-c.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c
index 9e0770a..f3ca7dc 100644
--- a/src/ext2fs-c.c
+++ b/src/ext2fs-c.c
@@ -631,6 +631,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest)
}
if (fgets (new_dirname, PATH_MAX, fp) == NULL) {
pclose (fp);
+ free (new_dirname);
goto cont;
}
pclose (fp);
--
1.9.3