The patch titled Subject: tools/mm: Free the allocated memory has been added to the -mm mm-nonmm-unstable branch. Its filename is tools-mm-free-the-allocated-memory.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/tools-mm-free-the-allocated-memory.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Liu Jing <liujing@xxxxxxxxxxxxxxxxxxxx> Subject: tools/mm: Free the allocated memory Date: Tue, 22 Oct 2024 09:25:26 +0800 The comm_str memory needs to be freed if the search_pattern function call fails in get_comm Link: https://lkml.kernel.org/r/20241022012526.7597-1-liujing@xxxxxxxxxxxxxxxxxxxx Signed-off-by: Liu Jing <liujing@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/mm/page_owner_sort.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/mm/page_owner_sort.c~tools-mm-free-the-allocated-memory +++ a/tools/mm/page_owner_sort.c @@ -377,6 +377,7 @@ static char *get_comm(char *buf) if (errno != 0) { if (debug_on) fprintf(stderr, "wrong comm in follow buf:\n%s\n", buf); + free (comm_str); return NULL; } _ Patches currently in -mm which might be from liujing@xxxxxxxxxxxxxxxxxxxx are tools-mm-free-the-allocated-memory.patch