mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 05:28:07 +02:00
keyfile: fix memleak in read_hash_of_string()
Fixes:10661abe17(cherry picked from commitcb33e3f3c2)
This commit is contained in:
parent
1d08391ed1
commit
e7b32fb2b8
1 changed files with 3 additions and 3 deletions
|
|
@ -715,7 +715,8 @@ mac_address_parser_INFINIBAND (KeyfileReaderInfo *info, NMSetting *setting, cons
|
||||||
static void
|
static void
|
||||||
read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key)
|
read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key)
|
||||||
{
|
{
|
||||||
char **keys, **iter;
|
gs_strfreev char **keys = NULL;
|
||||||
|
const char *const*iter;
|
||||||
char *value;
|
char *value;
|
||||||
const char *setting_name = nm_setting_get_name (setting);
|
const char *setting_name = nm_setting_get_name (setting);
|
||||||
|
|
||||||
|
|
@ -723,7 +724,7 @@ read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key)
|
||||||
if (!keys || !*keys)
|
if (!keys || !*keys)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (iter = keys; *iter; iter++) {
|
for (iter = (const char *const*) keys; *iter; iter++) {
|
||||||
value = nm_keyfile_plugin_kf_get_string (file, setting_name, *iter, NULL);
|
value = nm_keyfile_plugin_kf_get_string (file, setting_name, *iter, NULL);
|
||||||
if (!value)
|
if (!value)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -739,7 +740,6 @@ read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key)
|
||||||
}
|
}
|
||||||
g_free (value);
|
g_free (value);
|
||||||
}
|
}
|
||||||
g_strfreev (keys);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gsize
|
static gsize
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue