mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-11 09:18:20 +03:00
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,
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user