summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/dload.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2014-12-24 01:37:28 +0100
committerAllan McRae <allan@archlinux.org>2014-12-24 02:19:30 +0100
commit52d2ff648d2d6672b7a6458b76f639388f32d3df (patch)
treea3e0ac49b24c2d569244f7702f0cc1fe06873305 /lib/libalpm/dload.c
parent123ecb8e07a6489ceb2fc2e89f4ef62370aaf5bf (diff)
downloadpacman-52d2ff648d2d6672b7a6458b76f639388f32d3df.tar.gz
pacman-52d2ff648d2d6672b7a6458b76f639388f32d3df.tar.xz
create_tempfile: fix memory leak on error
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/dload.c')
-rw-r--r--lib/libalpm/dload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index e3409f99..c5186bef 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -379,7 +379,7 @@ static FILE *create_tempfile(struct dload_payload *payload, const char *localpat
payload->tempfile_name = randpath;
free(payload->remote_name);
STRDUP(payload->remote_name, strrchr(randpath, '/') + 1,
- RET_ERR(payload->handle, ALPM_ERR_MEMORY, NULL));
+ fclose(fp); RET_ERR(payload->handle, ALPM_ERR_MEMORY, NULL));
return fp;
}