From 8da9be0955fc759f43c40dab8985f9d17ac8462a Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Thu, 1 Jan 2015 19:00:23 -0500 Subject: initialize pointers passed to _alpm_pkg_dup _alpm_pkg_dup leaves the destination pointer unaltered in case of fatal errors, so when commits 2f0ca00e and be4198b3 freed the pointer, they fixed a memory leak on non-fatal errors by replacing it with a segmentation fault on fatal errors. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/deps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index d4fbf950..c340f112 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -609,7 +609,7 @@ int _alpm_recursedeps(alpm_db_t *db, alpm_list_t **targs, int include_explicit) alpm_pkg_t *deppkg = j->data; if(_alpm_pkg_depends_on(pkg, deppkg) && can_remove_package(db, deppkg, *targs, include_explicit)) { - alpm_pkg_t *copy; + alpm_pkg_t *copy = NULL; _alpm_log(db->handle, ALPM_LOG_DEBUG, "adding '%s' to the targets\n", deppkg->name); /* add it to the target list */ -- cgit v1.2.3-24-g4f1b