summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2014-12-21 14:51:08 +0100
committerAllan McRae <allan@archlinux.org>2014-12-24 02:19:29 +0100
commitc0d9d260704ac59691b9c3cec5aa154be868948c (patch)
tree9665920531f4684865522160444986acce94883e /lib/libalpm/sync.c
parent32ebd7ad5d0c96951065ef251f1766637ae5dd66 (diff)
downloadpacman-c0d9d260704ac59691b9c3cec5aa154be868948c.tar.gz
pacman-c0d9d260704ac59691b9c3cec5aa154be868948c.tar.xz
build_payload: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index c513b6b5..36646759 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -862,7 +862,7 @@ static struct dload_payload *build_payload(alpm_handle_t *handle,
struct dload_payload *payload;
CALLOC(payload, 1, sizeof(*payload), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
- STRDUP(payload->remote_name, filename, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
+ STRDUP(payload->remote_name, filename, FREE(payload); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
payload->max_size = size;
payload->servers = servers;
return payload;