summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2014-12-24 01:52:15 +0100
committerAllan McRae <allan@archlinux.org>2014-12-24 02:19:30 +0100
commit9cf1b2c00432420499c0f1031d15ebccd23b2ae9 (patch)
treee1f7c7e146dbbaa6df4c78d245139ea94181d920 /lib
parent88eedef6c653d6308fcd93dd49ea9abecd7e5f62 (diff)
downloadpacman-9cf1b2c00432420499c0f1031d15ebccd23b2ae9.tar.gz
pacman-9cf1b2c00432420499c0f1031d15ebccd23b2ae9.tar.xz
_alpm_runscriptlet: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/trans.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 7cdb096f..e680feb3 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -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")) {