From: Theodore Ts'o Date: Fri, 3 Jan 2014 14:51:44 +0000 (-0500) Subject: e2fsck: fix possible double free when searching for config file X-Git-Tag: v1.42.10~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=603fc2cb4b0f04f7c4e9c75bfea1b91fe000e47a;p=thirdparty%2Fe2fsprogs.git e2fsck: fix possible double free when searching for config file This happens if there is an error while scanning a directory for config file fragments. This is rarely used, which is why we didn't notice this. Addresses-Coverity-Bug: #1138576 Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/profile.c b/e2fsck/profile.c index 92aa89399..9cfab3778 100644 --- a/e2fsck/profile.c +++ b/e2fsck/profile.c @@ -320,6 +320,7 @@ profile_init(const char **files, profile_t *ret_profile) for (fs = files; !PROFILE_LAST_FILESPEC(*fs); fs++) { if (array) free_list(array); + array = NULL; retval = get_dirlist(*fs, &array); if (retval == 0) { if (!array)