1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

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>
This commit is contained in:
Lukas Fleischer 2011-08-26 13:10:37 +02:00 committed by Dan McGee
parent a2002b8f69
commit 455ca55f4e

View File

@ -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);
}