From c2b7a0bf9978091c9a51b72fdbd94cc9286041df Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Mon, 8 Aug 2016 21:06:55 +0200 Subject: ipcpd: Fix missing close of lsockfd --- src/ipcpd/ipcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 9ecc411d..839a5a9b 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -141,6 +141,8 @@ void * ipcp_main_loop(void * o) break; } + pthread_cleanup_push(close_ptr, (void *) &lsockfd); + count = read(lsockfd, buf, IPCP_MSG_BUF_SIZE); if (count <= 0) { LOG_ERR("Failed to read from socket"); @@ -278,6 +280,7 @@ void * ipcp_main_loop(void * o) } free(buffer.data); + pthread_cleanup_pop(true); } -- cgit v1.2.3