mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-11 07:10:36 +01:00
config: fix memleak in read_config()
(cherry picked from commit b49fdae59e)
Conflicts:
src/nm-config.c
This commit is contained in:
parent
63a23439ee
commit
74d44dd563
1 changed files with 4 additions and 2 deletions
|
|
@ -407,8 +407,8 @@ read_config (NMConfig *config, const char *path, GError **error)
|
|||
|
||||
if (keys[k][len - 1] == '+') {
|
||||
char *base_key = g_strndup (keys[k], len - 1);
|
||||
const char *old_val = g_key_file_get_value (priv->keyfile, groups[g], base_key, NULL);
|
||||
const char *new_val = g_key_file_get_value (kf, groups[g], keys[k], NULL);
|
||||
char *old_val = g_key_file_get_value (priv->keyfile, groups[g], base_key, NULL);
|
||||
char *new_val = g_key_file_get_value (kf, groups[g], keys[k], NULL);
|
||||
|
||||
if (old_val && *old_val) {
|
||||
char *combined = g_strconcat (old_val, ",", new_val, NULL);
|
||||
|
|
@ -419,6 +419,8 @@ read_config (NMConfig *config, const char *path, GError **error)
|
|||
g_key_file_set_value (priv->keyfile, groups[g], base_key, new_val);
|
||||
|
||||
g_free (base_key);
|
||||
g_free (old_val);
|
||||
g_free (new_val);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue