networkd: fix memleak when the same NetDev is specified twice
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Feb 2019 13:15:29 +0000 (14:15 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Feb 2019 13:31:28 +0000 (14:31 +0100)
commit83ec4592760db3dc35f0843b9f1e03624a792e9e
tree1862a5b3dcfeb4ecee447637db7f3e26a62265aa
parent3772cfde036dc7707cb300c62bc39cabe16e7c20
networkd: fix memleak when the same NetDev is specified twice

hashmap_put() returns 0 if the (key, value) pair is already present in the
hashmap, and -EEXIST if the key exists, but the value is different.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13433
src/network/networkd-network.c
test/fuzz/fuzz-network-parser/oss-fuzz-13433 [new file with mode: 0644]