ostree_repo_pull_from_remotes_async: Fix leak of options
authorAlexander Larsson <alexl@redhat.com>
Tue, 14 Aug 2018 08:09:32 +0000 (10:09 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 14 Aug 2018 12:49:28 +0000 (12:49 +0000)
copy_option() unnecessarily passed ownership of the value
to g_variant_dict_insert_value, but that already refs, so it was leaked.

Closes: #1702
Approved by: cgwalters

src/libostree/ostree-repo-pull.c

index 2a0f1c9871bdb7c25700b8f5adc1d4b0b6390a09..80c31ed8bef67613986cd60e8da8d5829e7ba33f 100644 (file)
@@ -5667,7 +5667,7 @@ copy_option (GVariantDict       *master_options,
 {
   g_autoptr(GVariant) option_v = g_variant_dict_lookup_value (master_options, key, expected_type);
   if (option_v != NULL)
-    g_variant_dict_insert_value (slave_options, key, g_steal_pointer (&option_v));
+    g_variant_dict_insert_value (slave_options, key, option_v);
 }
 
 /**