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:
parent
04ca15cb0e
commit
0f7bf7be95
|
|
@ -130,7 +130,7 @@ static OstreeRemote *
|
||||||
ost_remote_new_from_keyfile (GKeyFile *keyfile,
|
ost_remote_new_from_keyfile (GKeyFile *keyfile,
|
||||||
const gchar *group)
|
const gchar *group)
|
||||||
{
|
{
|
||||||
GMatchInfo *match = NULL;
|
g_autoptr(GMatchInfo) match = NULL;
|
||||||
OstreeRemote *remote;
|
OstreeRemote *remote;
|
||||||
|
|
||||||
static gsize regex_initialized;
|
static gsize regex_initialized;
|
||||||
|
|
@ -157,8 +157,6 @@ ost_remote_new_from_keyfile (GKeyFile *keyfile,
|
||||||
|
|
||||||
ot_keyfile_copy_group (keyfile, remote->options, group);
|
ot_keyfile_copy_group (keyfile, remote->options, group);
|
||||||
|
|
||||||
g_match_info_unref (match);
|
|
||||||
|
|
||||||
return remote;
|
return remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue