lib/repo-pull: Fix a potential minor leak
authorPhilip Withnall <withnall@endlessm.com>
Thu, 21 Sep 2017 15:01:44 +0000 (16:01 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 27 Sep 2017 16:38:07 +0000 (16:38 +0000)
If override-remote-name is specified in the options to
ostree_repo_pull_with_options(), but the remote_name_or_baseurl argument
is also set to a remote name, the override-remote-name would be leaked.

Note that this is currently an invalid configuration, so this leak is
basically never hit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1202
Approved by: cgwalters

src/libostree/ostree-repo-pull.c

index 45e3eae512b1aabbab256458b7c66a1b389be4cf..cad7f86e605198136f15c4ec2c570b45ebbf2beb 100644 (file)
@@ -3360,6 +3360,7 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
     {
       g_autofree char *unconfigured_state = NULL;
 
+      g_free (pull_data->remote_name);
       pull_data->remote_name = g_strdup (remote_name_or_baseurl);
 
       /* Fetch GPG verification settings from remote if it wasn't already