[pacman-dev] [PATCH] Fix leak in _alpm_db_search on error condition
21 Nov
2019
21 Nov
'19
12:42 p.m.
--- lib/libalpm/db.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index cf4c865f..43ca1fc8 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -422,7 +422,10 @@ int _alpm_db_search(alpm_db_t *db, const alpm_list_t *needles, _alpm_log(db->handle, ALPM_LOG_DEBUG, "searching for target '%s'\n", targ); if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) { - RET_ERR(db->handle, ALPM_ERR_INVALID_REGEX, -1); + db->handle->pm_errno = ALPM_ERR_INVALID_REGEX; + alpm_list_free(list); + alpm_list_free(*ret); + return -1; } for(j = list; j; j = j->next) { -- 2.24.0
1858
Age (days ago)
1858
Last active (days ago)
0 comments
1 participants
participants (1)
-
Allan McRae