From c0d9d260704ac59691b9c3cec5aa154be868948c Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 21 Dec 2014 23:51:08 +1000 Subject: build_payload: free memory on error Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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; -- cgit v1.2.3-70-g09d2