lib: Fix memory leaks of OstreeRemote

The _ostree_repo_get_remote() and _ostree_repo_get_remote_inherited()
methods transfer ownership of the returned OstreeRemote to the caller,
so this commit fixes a few call sites that weren't properly freeing it.

Closes: #1478
Approved by: cgwalters
This commit is contained in:
Matthew Leeds authored and Atomic Bot committed 2018-03-05 20:00:16 +00:00
1 parent 79d6f635df
commit fe6ae92ebc
3 files changed
+6 -6

No files matched your search

+1 -3
View File
@@ -4914,7 +4914,7 @@ _ostree_repo_gpg_verify_data_internal (OstreeRepo *self,
g_autofree char *gpgkeypath = NULL;
/* Add the remote's keyring file if it exists. */
OstreeRemote *remote;
g_autoptr(OstreeRemote) remote = NULL;
remote = _ostree_repo_get_remote_inherited (self, remote_name, error);
if (remote == NULL)
@@ -4936,8 +4936,6 @@ _ostree_repo_gpg_verify_data_internal (OstreeRepo *self,
if (gpgkeypath)
_ostree_gpg_verifier_add_key_ascii_file (verifier, gpgkeypath);
ostree_remote_unref (remote);
}
if (add_global_keyring_dir)