diff options
Diffstat (limited to 'src/socket-proxy/socket-proxyd.c')
-rw-r--r-- | src/socket-proxy/socket-proxyd.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 8887e2f989..d4f401d996 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -92,19 +92,10 @@ static void connection_free(Connection *c) { } static void context_free(Context *context) { - sd_event_source *es; - Connection *c; - assert(context); - while ((es = set_steal_first(context->listen))) - sd_event_source_unref(es); - - while ((c = set_first(context->connections))) - connection_free(c); - - set_free(context->listen); - set_free(context->connections); + set_free_with_destructor(context->listen, sd_event_source_unref); + set_free_with_destructor(context->connections, connection_free); sd_event_unref(context->event); sd_resolve_unref(context->resolve); |