summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-24 23:45:33 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-24 23:46:13 +0100
commit79e16ce3bf734434081e57f1170333277830a592 (patch)
tree5edbca6884ba0427ad743a09be2ae1fbc48512f4
parentc3ebdce39a748f738f3731730cd085ff3551b379 (diff)
networkd: fix a couple of memory leaks
-rw-r--r--src/libsystemd/sd-event/sd-event.c2
-rw-r--r--src/libsystemd/sd-rtnl/sd-rtnl.c6
-rw-r--r--src/network/networkd-netdev.c5
-rw-r--r--src/network/networkd-network.c5
4 files changed, 17 insertions, 1 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 4552f4dad6..a4b67431ef 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -2170,7 +2170,7 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
r = flush_timer(e, e->boottime_alarm.fd, ev_queue[i].events, &e->boottime_alarm.next);
else if (ev_queue[i].data.ptr == INT_TO_PTR(SOURCE_SIGNAL))
r = process_signal(e, ev_queue[i].events);
- else if (ev_queue[i].data.ptr == INT_TO_PTR(SOURCE_WATCHDOG))
+ else if (ev_queue[i].data.ptr == INT_TO_PTR(SOURCE_WATCHDOG))
r = flush_timer(e, e->watchdog_fd, ev_queue[i].events, NULL);
else
r = process_io(e, ev_queue[i].data.ptr, ev_queue[i].events);
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index 551e95b592..695a2daccf 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -178,6 +178,12 @@ sd_rtnl *sd_rtnl_unref(sd_rtnl *rtnl) {
}
safe_close(rtnl->fd);
+
+ sd_event_source_unref(rtnl->io_event_source);
+ sd_event_source_unref(rtnl->time_event_source);
+ sd_event_source_unref(rtnl->exit_event_source);
+ sd_event_unref(rtnl->event);
+
free(rtnl);
return NULL;
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index cdf07ad704..e333c47b1f 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -67,6 +67,11 @@ void netdev_free(NetDev *netdev) {
free(netdev->description);
free(netdev->name);
+ condition_free_list(netdev->match_host);
+ condition_free_list(netdev->match_virt);
+ condition_free_list(netdev->match_kernel);
+ condition_free_list(netdev->match_arch);
+
free(netdev);
}
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 776a9d3040..47fab4ecb0 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -176,6 +176,11 @@ void network_free(Network *network) {
if (network->manager && network->manager->networks)
LIST_REMOVE(networks, network->manager->networks, network);
+ condition_free_list(network->match_host);
+ condition_free_list(network->match_virt);
+ condition_free_list(network->match_kernel);
+ condition_free_list(network->match_arch);
+
free(network);
}