[pacman-dev] [PATCH 2/4] be_local.c: Fix memory leak in _alpm_local_db_write()
Lukas Fleischer
archlinux at cryptocrack.de
Fri Aug 26 07:10:36 EDT 2011
Jump to the cleanup label, free "pkgpath" and restore umask if a
non-local database is passed.
Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
lib/libalpm/be_local.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index f53bd64..4844ade 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -760,7 +760,8 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
oldmask = umask(0022);
if(strcmp(db->treename, "local") != 0) {
- return -1;
+ retval = -1;
+ goto cleanup;
}
/* DESC */
--
1.7.6.1
More information about the pacman-dev
mailing list