mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 04:50:30 +01:00
libnm: fix memory leak when parsing IP configuration
When the dictionary contains keys "address" and "uri", the first value
is leaked.
==4730== 14 bytes in 1 blocks are definitely lost in loss record 51 of 1,755
==4730== at 0x4841866: malloc (vg_replace_malloc.c:446)
==4730== by 0x4CC5CB9: g_malloc (gmem.c:100)
==4730== by 0x4CDF518: g_strdup (gstrfuncs.c:323)
==4730== by 0x496A6B8: g_strdup_inline (gstrfuncs.h:321)
==4730== by 0x496A6B8: nm_inet_ntop_dup (nm-inet-utils.h:355)
==4730== by 0x496A95B: nm_inet_parse_str (nm-inet-utils.c:539)
==4730== by 0x48AF3A3: _notify_update_prop_nameservers (nm-ip-config.c:179)
Fixes: 4422b14704 ('core, libnm: support per-connection DNS URIs')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2184
This commit is contained in:
parent
26f2673b90
commit
37d8945b13
1 changed files with 1 additions and 0 deletions
|
|
@ -180,6 +180,7 @@ _notify_update_prop_nameservers(NMClient *client,
|
|||
goto next;
|
||||
nameserver = g_steal_pointer(&val_str);
|
||||
} else if (nm_streq(key, "uri")) {
|
||||
g_free(nameserver);
|
||||
nameserver = g_variant_dup_string(val, NULL);
|
||||
}
|
||||
next:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue