summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-08-26 13:10:37 +0200
committerDan McGee <dan@archlinux.org>2011-08-28 19:40:22 -0500
commit455ca55f4efecf48bf86904e4a67a4b124cf1838 (patch)
treef649a4e1bb3271876e161b59f6581cfef5a0dcf0
parenta2002b8f690e12a7e8c75a3a9184570d27709c71 (diff)
downloadpacman-455ca55f4efecf48bf86904e4a67a4b124cf1838.tar.xz
be_sync.c: Fix memory leak in alpm_db_update()
Free "syncpath" and restore umask if we fail to grab a lock. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/be_sync.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index d7c0a749..ac99e05e 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -177,6 +177,8 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
/* attempt to grab a lock */
if(_alpm_handle_lock(handle)) {
+ free(syncpath);
+ umask(oldmask);
RET_ERR(handle, ALPM_ERR_HANDLE_LOCK, -1);
}