]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: fix memory leak in promote_secondaries_enabled 7547/head
authorHristo Venev <hristo@venev.name>
Tue, 5 Dec 2017 14:51:23 +0000 (16:51 +0200)
committerHristo Venev <hristo@venev.name>
Tue, 5 Dec 2017 14:56:54 +0000 (16:56 +0200)
src/network/networkd-dhcp4.c

index 5ce03e5d40cb07490667f62ea5b0d893ebe71109..ac1781d83ee432f7b95e718637185050696dc496 100644 (file)
@@ -590,7 +590,8 @@ static int dhcp4_set_hostname(Link *link) {
 }
 
 static bool promote_secondaries_enabled(const char *ifname) {
-        char *promote_secondaries_sysctl, *promote_secondaries_path;
+        _cleanup_free_ char *promote_secondaries_sysctl = NULL;
+        char *promote_secondaries_path;
         int r;
 
         promote_secondaries_path = strjoina("net/ipv4/conf/", ifname, "/promote_secondaries");