summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-02-24 11:55:49 +0100
committerAllan McRae <allan@archlinux.org>2015-03-03 07:54:17 +0100
commitfc5be14dac50798024a6dee1d6c3a1acb0154314 (patch)
tree53d003c185bcc1ddab926af7b69b798fc962ac2d /lib
parent2108d9552600bbfd7d7586dfebaa9750dec728ac (diff)
downloadpacman-fc5be14dac50798024a6dee1d6c3a1acb0154314.tar.gz
pacman-fc5be14dac50798024a6dee1d6c3a1acb0154314.tar.xz
parse_descfile: fix memory leak in error case
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_package.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index 3e27232d..e284254a 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -237,7 +237,7 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *
} else if(strcmp(key, "backup") == 0) {
alpm_backup_t *backup;
CALLOC(backup, 1, sizeof(alpm_backup_t), return -1);
- STRDUP(backup->name, ptr, return -1);
+ STRDUP(backup->name, ptr, FREE(backup); return -1);
newpkg->backup = alpm_list_add(newpkg->backup, backup);
} else if(strcmp(key, "force") == 0) {
/* deprecated, skip it */