mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 06:50:17 +01:00
device: fix memleak for ndisc_search->domain in ndisc_set_router_config()
It is a bit fragile not to clone the string because we depend on nm_ip6_config_get_search(priv->ip6_config) to be stable. In practice, it's no problem. Saves an additional strdup and the effort to cleanup the memory afterwards.
This commit is contained in:
parent
b058c45d28
commit
60be9cbc9e
1 changed files with 1 additions and 1 deletions
|
|
@ -1875,7 +1875,7 @@ ndisc_set_router_config (NMNDisc *ndisc, NMDevice *self)
|
|||
NMNDiscDNSDomain *ndisc_search;
|
||||
|
||||
ndisc_search = &g_array_index (dns_domains, NMNDiscDNSDomain, i);
|
||||
ndisc_search->domain = g_strdup (search);
|
||||
ndisc_search->domain = (char *) search;
|
||||
ndisc_search->timestamp = now;
|
||||
ndisc_search->lifetime = NM_NDISC_ROUTER_LIFETIME;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue