summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r--src/ipcpd/ipcp.c3
1 files changed, 3 insertions, 0 deletions
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);
}