Skip to content

Commit

Permalink
Merge pull request #4559 from cgwalters/fix-search-leaks
Browse files Browse the repository at this point in the history
daemon/search: Fix memory leaks
  • Loading branch information
jmarrero authored Aug 28, 2023
2 parents b161a4c + a43aa5e commit 212a196
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/daemon/rpmostreed-os.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,8 @@ search_packages_by_filter (HyQuery query, GVariantBuilder *builder, const gchar
std::vector<int> keynames, const gchar *id)
{
std::set<const gchar *, cstrless> result_set;
HyQuery intermediate_query = hy_query_clone (query);
HyQuery final_query = hy_query_clone (query);
hy_autoquery HyQuery intermediate_query = hy_query_clone (query);
hy_autoquery HyQuery final_query = hy_query_clone (query);

int names_count = 0;
for (guint i = 0; names[i] != NULL; i++)
Expand Down Expand Up @@ -1241,6 +1241,7 @@ search_packages_by_filter (HyQuery query, GVariantBuilder *builder, const gchar
}
else
{
hy_query_clear (intermediate_query);
intermediate_query = hy_query_clone (query);
}

Expand All @@ -1255,6 +1256,7 @@ search_packages_by_filter (HyQuery query, GVariantBuilder *builder, const gchar
}
else
{
hy_query_clear (final_query);
final_query = hy_query_clone (intermediate_query);
}
}
Expand Down

0 comments on commit 212a196

Please sign in to comment.