Commit 8846574e authored by Allan McRae's avatar Allan McRae
Browse files

Fix leak in _alpm_db_search on error condition

parent eaa2770c
......@@ -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(&reg, 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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment