Merge pull request #10682 from yuwata/fix-oss-fuzz-network-issues

network: fix memleak
This commit is contained in:
Lennart Poettering 2018-11-08 09:37:35 +01:00 committed by GitHub
commit 8d2411f693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 3 deletions

View File

@ -369,6 +369,7 @@ void network_free(Network *network) {
strv_free(network->search_domains);
strv_free(network->route_domains);
strv_free(network->bind_carrier);
strv_free(network->router_search_domains);
netdev_unref(network->bridge);
netdev_unref(network->bond);
@ -1154,8 +1155,7 @@ int config_parse_radv_search_domains(
assert(rvalue);
for (;;) {
_cleanup_free_ char *w = NULL;
_cleanup_free_ char *idna = NULL;
_cleanup_free_ char *w = NULL, *idna = NULL;
r = extract_first_word(&p, &w, NULL, 0);
if (r == -ENOMEM)
@ -1168,11 +1168,15 @@ int config_parse_radv_search_domains(
break;
r = dns_name_apply_idna(w, &idna);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to apply IDNA to domain name '%s', ignoring: %m", w);
continue;
}
if (r > 0) {
r = strv_push(&n->router_search_domains, idna);
if (r >= 0)
idna = NULL;
} else if (r == 0) {
} else {
r = strv_push(&n->router_search_domains, w);
if (r >= 0)
w = NULL;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
[IPv6PrefixDelegation]
Domains=m