[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1316206180-6375-22-git-send-email-sandeen@redhat.com>
Date: Fri, 16 Sep 2011 15:49:36 -0500
From: Eric Sandeen <sandeen@...hat.com>
To: linux-ext4@...r.kernel.org
Cc: Eric Sandeen <sandeen@...hat.com>
Subject: [PATCH 21/25] e2fsck: Fix leaks in error paths
fn and/or array was not freed in some error paths.
Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---
e2fsck/profile.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/e2fsck/profile.c b/e2fsck/profile.c
index 327bfb4..c790623 100644
--- a/e2fsck/profile.c
+++ b/e2fsck/profile.c
@@ -276,6 +276,7 @@ static errcode_t get_dirlist(const char *dirname, char***ret_array)
new_array = realloc(array, sizeof(char *) * (max+1));
if (!new_array) {
retval = ENOMEM;
+ free(fn);
goto errout;
}
array = new_array;
@@ -345,6 +346,7 @@ profile_init(const char **files, profile_t *ret_profile)
* If all the files were not found, return the appropriate error.
*/
if (!profile->first_file) {
+ free_list(array);
profile_release(profile);
return ENOENT;
}
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists