1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-01 01:41:52 -05:00

create_tempfile: fix memory leak on error

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2014-12-24 10:37:28 +10:00
parent 123ecb8e07
commit 52d2ff648d

View File

@ -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;
}