mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
networkd: Do not set config to NULL immediately.
fd45e52
sets
n to NULL which leads to crash.
fixes: #5418
This commit is contained in:
parent
b965427b59
commit
fcc48287eb
@ -85,7 +85,9 @@ int address_new_static(Network *network, const char *filename, unsigned section_
|
||||
|
||||
if (filename) {
|
||||
address->section = n;
|
||||
hashmap_put(network->addresses_by_section, n, address);
|
||||
n = NULL;
|
||||
|
||||
hashmap_put(network->addresses_by_section, address->section, address);
|
||||
}
|
||||
|
||||
address->network = network;
|
||||
@ -94,7 +96,6 @@ int address_new_static(Network *network, const char *filename, unsigned section_
|
||||
|
||||
*ret = address;
|
||||
address = NULL;
|
||||
n = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ int route_new_static(Network *network, const char *filename, unsigned section_li
|
||||
route->section = n;
|
||||
n = NULL;
|
||||
|
||||
r = hashmap_put(network->routes_by_section, n, route);
|
||||
r = hashmap_put(network->routes_by_section, route->section, route);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user