diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-08-26 13:10:37 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-28 19:40:22 -0500 |
commit | 455ca55f4efecf48bf86904e4a67a4b124cf1838 (patch) | |
tree | f649a4e1bb3271876e161b59f6581cfef5a0dcf0 /lib | |
parent | a2002b8f690e12a7e8c75a3a9184570d27709c71 (diff) | |
download | pacman-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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/be_sync.c | 2 |
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); } |