[systemd-commits] 2 commits - src/network
Tom Gundersen
tomegun at kemper.freedesktop.org
Mon Mar 31 01:08:14 PDT 2014
src/network/networkd-link.c | 2 +-
src/network/networkd-manager.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit fd88eb8ab0ae6b3dec15b29725ad040eafe7ac67
Author: Tom Gundersen <teg at jklm.no>
Date: Mon Mar 31 10:04:32 2014 +0200
networkd: link - fix memory leak
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index aa59dd7..752ecae 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1427,7 +1427,7 @@ int link_save(Link *link) {
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);
commit 2292547af9638e2b3f7e0e96a56dd6c909e516dc
Author: Tom Gundersen <teg at jklm.no>
Date: Mon Mar 31 10:01:59 2014 +0200
networkd: fix use-after-free
Free networks before links (the reverse of creation order).
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index b2cb0fa..ddbdabb 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -145,13 +145,13 @@ void manager_free(Manager *m) {
sd_event_source_unref(m->sigint_event_source);
sd_event_unref(m->event);
- while ((network = m->networks))
- network_free(network);
-
while ((link = hashmap_first(m->links)))
link_free(link);
hashmap_free(m->links);
+ while ((network = m->networks))
+ network_free(network);
+
while ((netdev = hashmap_first(m->netdevs)))
netdev_free(netdev);
hashmap_free(m->netdevs);
More information about the systemd-commits
mailing list