lib: Fix a leak in remote parsing

As the docs say, `g_regex_match()` still allocates a match even if it
returns `FALSE`.  Using `g_autoptr` is just plain better.

Closes: #292
Approved by: krnowak
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-06-09 21:10:35 +00:00
1 parent 04ca15cb0e
commit 0f7bf7be95
1 file changed
+1 -3
+1 -3
View File
@@ -130,7 +130,7 @@ static OstreeRemote *
ost_remote_new_from_keyfile (GKeyFile *keyfile,
const gchar *group)
{
GMatchInfo *match = NULL;
g_autoptr(GMatchInfo) match = NULL;
OstreeRemote *remote;
static gsize regex_initialized;
@@ -157,8 +157,6 @@ ost_remote_new_from_keyfile (GKeyFile *keyfile,
ot_keyfile_copy_group (keyfile, remote->options, group);
g_match_info_unref (match);
return remote;
}