From 4a0b974b85f36011fb1a8c17bf59bc272d96a522 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 4 Jul 2023 16:43:52 +0200 Subject: tcp_server: always clean up connection descriptors --- src/tcp_server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tcp_server.c') diff --git a/src/tcp_server.c b/src/tcp_server.c index fe55e4f..221b27e 100644 --- a/src/tcp_server.c +++ b/src/tcp_server.c @@ -72,13 +72,13 @@ static void *connection_thread(void *_ctx) * handled in the main thread. */ ret = signal_block_sigterms(); if (ret < 0) - goto free_ctx; + goto close; ctx->conn_handler(ctx->fd, ctx->arg); -free_ctx: +close: + net_close(ctx->fd); free(ctx); - return NULL; } -- cgit v1.2.3