fixing a memory leak

pollfd
Karchnu 2020-07-10 23:43:11 +02:00
parent ff21ff42cb
commit 02c25c150d
1 changed files with 4 additions and 2 deletions

View File

@ -328,9 +328,11 @@ struct ipc_error fd_switching_read (struct ipc_event *event, struct ipc_ctx *ctx
// 1. put the message in the list to be sent
m.fd = dest_fd;
ipc_write (ctx, &m);
// 2. set event IPC_EVENT_TYPE_SWITCH, inform ipcd of a successful reception.
// 2. delete the message (a deep copy has been made)
ipc_message_empty (&m);
// 3. set event IPC_EVENT_TYPE_SWITCH, inform ipcd of a successful reception.
IPC_EVENT_SET (event, IPC_EVENT_TYPE_SWITCH, index, ctx->pollfd[index].fd, NULL);
// 3. IPC_RETURN_NO_ERROR
// 4. IPC_RETURN_NO_ERROR
IPC_RETURN_NO_ERROR;
}