_alpm_runscriptlet: free memory on error

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2014-12-24 10:52:15 +10:00
parent 88eedef6c6
commit 9cf1b2c004
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
/* either extract or copy the scriptlet */
len += strlen("/.INSTALL");
MALLOC(scriptfn, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
MALLOC(scriptfn, len, free(tmpdir); RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(scriptfn, len, "%s/.INSTALL", tmpdir);
if(is_archive) {
if(_alpm_unpack_single(handle, filepath, tmpdir, ".INSTALL")) {