summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2018-07-10 17:10:02 +0100
committerRichard Hughes <richard@hughsie.com>2018-07-10 17:10:02 +0100
commit2b8ef27a6f0e0b348eab835af3a450669ed1e3b3 (patch)
treef948e600ddd1b6febc2110d7e3aab3a93f8986e9
parent905d7ca096406866e0dcd82c0249d89b832d4d65 (diff)
downloadflatpak-2b8ef27a6f0e0b348eab835af3a450669ed1e3b3.tar.gz
Fix two tiny memory leakswip/hughsie/trivial-memleaks
-rw-r--r--common/flatpak-dir.c3
-rw-r--r--common/flatpak-installation.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index b95483f6..5bf0ca0f 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -5358,12 +5358,13 @@ export_mime_file (int parent_fd,
static char *
format_flatpak_run_args_from_run_opts (GStrv flatpak_run_args)
{
- GString *str = g_string_new ("");
+ GString *str;
GStrv iter = flatpak_run_args;
if (flatpak_run_args == NULL)
return NULL;
+ str = g_string_new ("");
for (; *iter != NULL; ++iter)
{
if (g_strcmp0 (*iter, "no-a11y-bus") == 0)
diff --git a/common/flatpak-installation.c b/common/flatpak-installation.c
index 65784284..4b5d1697 100644
--- a/common/flatpak-installation.c
+++ b/common/flatpak-installation.c
@@ -1043,7 +1043,7 @@ flatpak_installation_list_installed_refs_for_update (FlatpakInstallation *self,
{
FlatpakInstalledRef *installed_ref = g_ptr_array_index (installed, i);
const char *remote_name = flatpak_installed_ref_get_origin (installed_ref);
- const char *ref = flatpak_ref_format_ref (FLATPAK_REF (installed_ref));
+ g_autofree char *ref = flatpak_ref_format_ref (FLATPAK_REF (installed_ref));
g_autofree char *collection_id = NULL;
g_autoptr(OstreeCollectionRef) collection_ref = NULL;