Skip to content

Commit

Permalink
flatpak-dir: Fix a memory leak when installing a package
Browse files Browse the repository at this point in the history
The path was clobbered make the g_autoptr no work

Signed-off-by: Hubert Figuière <[email protected]>
  • Loading branch information
hfiguiere authored and smcv committed May 13, 2024
1 parent 739065e commit 9d60df4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/flatpak-dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,8 @@ flatpak_ensure_system_user_cache_dir_location (GError **error)
(st_buf.st_mode & 0777) == 0755)
return g_file_new_for_path (path);

g_clear_pointer (&path, g_free);

path = g_strdup ("/var/tmp/flatpak-cache-XXXXXX");

if (g_mkdtemp_full (path, 0755) == NULL)
Expand Down

0 comments on commit 9d60df4

Please sign in to comment.