]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: fix memory leak related to ENDPOINTS field
authorMasatake YAMATO <yamato@redhat.com>
Tue, 21 Jun 2022 17:39:09 +0000 (02:39 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Tue, 21 Jun 2022 17:39:09 +0000 (02:39 +0900)
`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 <yamato@redhat.com>
misc-utils/lsfd.c

index 184e8d683287d6a2fcc8f28bfe0a4206294fe902..b0896979a979f2dbe02ce1e34d21acdcce59ed52 100644 (file)
@@ -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)