From 455ca55f4efecf48bf86904e4a67a4b124cf1838 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 26 Aug 2011 13:10:37 +0200 Subject: 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 Signed-off-by: Dan McGee --- lib/libalpm/be_sync.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- cgit v1.2.3-24-g4f1b