* lib/glob.c (glob): Free allocated memory before returning.
Reported by Coverity via Tim Rühsen.
+2017-03-31 Bruno Haible <bruno@clisp.org>
+
+ glob: Fix memory leaks.
+ * lib/glob.c (glob): Free allocated memory before returning.
+ Reported by Coverity via Tim Rühsen.
+
2017-03-31 Bruno Haible <bruno@clisp.org>
md5, sha1, sha256, sha512: Add comments regarding correctness.
malloc_home_dir = 1;
}
memcpy (home_dir, p->pw_dir, home_dir_len);
-
- free (pwtmpbuf);
}
}
+ free (malloc_pwtmpbuf);
+ }
+ else
+ {
+ if (__glibc_unlikely (malloc_name))
+ free (name);
}
}
if (home_dir == NULL || home_dir[0] == '\0')
dirname = newp;
dirlen += home_len - 1;
malloc_dirname = !use_alloca;
+
+ if (__glibc_unlikely (malloc_home_dir))
+ free (home_dir);
}
dirname_modified = 1;
}
if (newcount > SIZE_MAX / sizeof (char *) - 2)
{
nospace:
+ if (__glibc_unlikely (malloc_dirname))
+ free (dirname);
free (pglob->gl_pathv);
pglob->gl_pathv = NULL;
pglob->gl_pathc = 0;