Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-03-23 15:28:48 -0500
committerDan McGee <dan@archlinux.org>2008-03-23 16:55:52 -0500
commit1086950c82ab649ffc36a00cd8d343da376252fe (patch)
treeea3298b195122e928e10a1ea2f527e6577c3fe80 /lib/libalpm/add.c
parent7995a25d0ed75968df72fcf65d231508417ec060 (diff)
memleak fix: ensure backup fname isn't lost if unused
The _alpm_backup_split function always alloced memory for the fname, and we let it disappear in a specific case (upgrade026.py). Fix the issue. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index eddf637e..8b06bef5 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -243,6 +243,7 @@ static int upgrade_remove(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *trans, pm
char *backup = _alpm_backup_file(b->data);
/* safety check (fix the upgrade026 pactest) */
if(!alpm_list_find_str(filelist, backup)) {
+ FREE(backup);
continue;
}
_alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",