1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

networkd: fix a couple of memory leaks

This commit is contained in:
Lennart Poettering 2014-03-24 23:45:33 +01:00
parent c3ebdce39a
commit 79e16ce3bf
4 changed files with 17 additions and 1 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}