Merge pull request #5421 from ssahani/net7

networkd: Do not set config to NULL immediately.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-02-22 11:56:16 -05:00
committed by GitHub
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -85,7 +85,11 @@ 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;
r = hashmap_put(network->addresses_by_section, address->section, address);
if (r < 0)
return r;
}
address->network = network;
@@ -94,7 +98,6 @@ int address_new_static(Network *network, const char *filename, unsigned section_
*ret = address;
address = NULL;
n = NULL;
return 0;
}
+1 -1
View File
@@ -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;
}