[pacman-dev] [PATCH] local_db_read: fix memory leak on error

Allan McRae allan at archlinux.org
Sun Dec 21 14:42:35 UTC 2014


Signed-off-by: Allan McRae <allan at archlinux.org>
---
 lib/libalpm/be_local.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 9376396..d0e8944 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -801,6 +801,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
 					alpm_backup_t *backup;
 					CALLOC(backup, 1, sizeof(alpm_backup_t), goto error);
 					if(_alpm_split_backup(line, &backup)) {
+						FREE(backup);
 						goto error;
 					}
 					info->backup = alpm_list_add(info->backup, backup);
-- 
2.2.0


More information about the pacman-dev mailing list