Skip to content

Commit

Permalink
Use a fresh alpm_list_t for each 3-arg alpm_db_search call
Browse files Browse the repository at this point in the history
Because why would you document the behavior of your API?
  • Loading branch information
falconindy committed Nov 21, 2019
1 parent 5ad0117 commit cce4a96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/expac.c
Expand Up @@ -605,11 +605,13 @@ static alpm_list_t *search_packages(alpm_list_t *dbs, alpm_list_t *targets)
alpm_list_t *i, *packages = NULL;

for(i = dbs; i; i = i->next) {
alpm_list_t *results = NULL;
#ifdef HAVE_THREE_ARG_DB_SEARCH
alpm_db_search(i->data, targets, &packages);
alpm_db_search(i->data, targets, &results);
#else
packages = alpm_list_join(packages, alpm_db_search(i->data, targets));
results = alpm_db_search(i->data, targets);
#endif
packages = alpm_list_join(packages, results);
}

return packages;
Expand Down

0 comments on commit cce4a96

Please sign in to comment.