From 8457cc3690a2f1368dcde46d0aad157d0f491861 Mon Sep 17 00:00:00 2001
From: Philippe PITTOLI
Date: Tue, 28 Jan 2020 13:42:19 +0100
Subject: [PATCH] Put fd to -1 before freeing memory.
---
src/communication.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/communication.c b/src/communication.c
index 4bfe5b9..7650e40 100644
--- a/src/communication.c
+++ b/src/communication.c
@@ -563,6 +563,7 @@ struct ipc_error ipc_del_fd (struct ipc_connection_infos *cinfos, int fd)
size_t i;
for (i = 0; i < cinfos->size; i++) {
if (cinfos->cinfos[i]->fd == fd) {
+ cinfos->cinfos[i]->fd = -1;
free (cinfos->cinfos[i]);
cinfos->size--;
if (cinfos->size == 0) {