From 679b347e00f920b01c4a6c542ca4c23ae2abf10e Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 22 Jun 2022 02:39:09 +0900 Subject: [PATCH] lsfd: fix memory leak related to ENDPOINTS field `struct ipc' is the data structure used behind ENDPOINTS field. The objects of the data structure and its hash table were not freed. Signed-off-by: Masatake YAMATO --- misc-utils/lsfd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index 184e8d6832..b0896979a9 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -858,12 +858,13 @@ static void free_ipc(struct ipc *ipc) { if (ipc->class->free) ipc->class->free(ipc); + free(ipc); } static void finalize_ipc_table(void) { for (int i = 0; i < IPC_TABLE_SIZE; i++) - list_free(ipc_table.tables, struct ipc, ipcs, free_ipc); + list_free(&ipc_table.tables[i], struct ipc, ipcs, free_ipc); } struct ipc *get_ipc(struct file *file) -- 2.47.2