chiark / gitweb /
networkd: link - fix memory leak
authorTom Gundersen <teg@jklm.no>
Mon, 31 Mar 2014 08:04:32 +0000 (10:04 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 31 Mar 2014 08:04:32 +0000 (10:04 +0200)
src/network/networkd-link.c

index aa59dd7..752ecae 100644 (file)
@@ -1427,7 +1427,7 @@ int link_save(Link *link) {
                 link_state_to_string(link->state));
 
         if (link->dhcp_lease) {
                 link_state_to_string(link->state));
 
         if (link->dhcp_lease) {
-                char *lease_file;
+                _cleanup_free_ char *lease_file = NULL;
 
                 r = asprintf(&lease_file, "/run/systemd/network/leases/%"PRIu64,
                              link->ifindex);
 
                 r = asprintf(&lease_file, "/run/systemd/network/leases/%"PRIu64,
                              link->ifindex);