Merge pull request #10682 from yuwata/fix-oss-fuzz-network-issues
network: fix memleak
This commit is contained in:
commit
8d2411f693
|
@ -369,6 +369,7 @@ void network_free(Network *network) {
|
||||||
strv_free(network->search_domains);
|
strv_free(network->search_domains);
|
||||||
strv_free(network->route_domains);
|
strv_free(network->route_domains);
|
||||||
strv_free(network->bind_carrier);
|
strv_free(network->bind_carrier);
|
||||||
|
strv_free(network->router_search_domains);
|
||||||
|
|
||||||
netdev_unref(network->bridge);
|
netdev_unref(network->bridge);
|
||||||
netdev_unref(network->bond);
|
netdev_unref(network->bond);
|
||||||
|
@ -1154,8 +1155,7 @@ int config_parse_radv_search_domains(
|
||||||
assert(rvalue);
|
assert(rvalue);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
_cleanup_free_ char *w = NULL;
|
_cleanup_free_ char *w = NULL, *idna = NULL;
|
||||||
_cleanup_free_ char *idna = NULL;
|
|
||||||
|
|
||||||
r = extract_first_word(&p, &w, NULL, 0);
|
r = extract_first_word(&p, &w, NULL, 0);
|
||||||
if (r == -ENOMEM)
|
if (r == -ENOMEM)
|
||||||
|
@ -1168,11 +1168,15 @@ int config_parse_radv_search_domains(
|
||||||
break;
|
break;
|
||||||
|
|
||||||
r = dns_name_apply_idna(w, &idna);
|
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) {
|
if (r > 0) {
|
||||||
r = strv_push(&n->router_search_domains, idna);
|
r = strv_push(&n->router_search_domains, idna);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
idna = NULL;
|
idna = NULL;
|
||||||
} else if (r == 0) {
|
} else {
|
||||||
r = strv_push(&n->router_search_domains, w);
|
r = strv_push(&n->router_search_domains, w);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
w = NULL;
|
w = NULL;
|
||||||
|
|
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11286
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11286
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11287
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11287
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11296
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11296
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11297
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11297
Normal file
Binary file not shown.
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11299
Normal file
BIN
test/fuzz/fuzz-netdev-parser/oss-fuzz-11299
Normal file
Binary file not shown.
2
test/fuzz/fuzz-network-parser/oss-fuzz-11285
Normal file
2
test/fuzz/fuzz-network-parser/oss-fuzz-11285
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[IPv6PrefixDelegation]
|
||||||
|
Domains=m
|
Loading…
Reference in a new issue