aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tcp_server.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-04 16:43:52 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-04 16:47:08 +0200
commit4a0b974b85f36011fb1a8c17bf59bc272d96a522 (patch)
treefc05115a4e0f1b37cfd1733acdf1981c3005ae03 /src/tcp_server.c
parentsqlite: store new runs in SQLite (diff)
downloadcimple-4a0b974b85f36011fb1a8c17bf59bc272d96a522.tar.gz
cimple-4a0b974b85f36011fb1a8c17bf59bc272d96a522.zip
tcp_server: always clean up connection descriptors
Diffstat (limited to 'src/tcp_server.c')
-rw-r--r--src/tcp_server.c6
1 files changed, 3 insertions, 3 deletions
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;
}