mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-03 23:04:49 -04:00
Fix leak in flatpak_dir_find_remote_related_for_metadata
This puts the checksum autoptr in the inner scope of the loop where
it gets assigned to avoid leaking all but the last iteration value.
Closes: #3093
Approved by: mwleeds
(cherry picked from commit ca72dd5474)
This commit is contained in:
committed by
Alexander Larsson
parent
12cecc852c
commit
7844735dcf
@@ -13569,7 +13569,6 @@ flatpak_dir_find_remote_related_for_metadata (FlatpakDir *self,
|
||||
g_autofree char *extension_collection_id = NULL;
|
||||
const char *default_branches[] = { NULL, NULL};
|
||||
const char **branches;
|
||||
g_autofree char *checksum = NULL;
|
||||
int branch_i;
|
||||
|
||||
/* Parse actual extension name */
|
||||
@@ -13606,6 +13605,7 @@ flatpak_dir_find_remote_related_for_metadata (FlatpakDir *self,
|
||||
for (branch_i = 0; branches[branch_i] != NULL; branch_i++)
|
||||
{
|
||||
g_autofree char *extension_ref = NULL;
|
||||
g_autofree char *checksum = NULL;
|
||||
const char *branch = branches[branch_i];
|
||||
|
||||
extension_ref = g_build_filename ("runtime", extension, parts[2], branch, NULL);
|
||||
|
||||
Reference in New Issue
Block a user