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 2016-05-11 13:32:40 -04:00 committed by Atomic Bot
parent 04ca15cb0e
commit 0f7bf7be95

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;
}