Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/mm: free the allocated memory

The comm_str memory needs to be freed if the search_pattern function call
fails in get_comm

[akpm@linux-foundation.org: fix whitespace]
Link: https://lkml.kernel.org/r/20241022012526.7597-1-liujing@cmss.chinamobile.com
Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liu Jing and committed by
Andrew Morton
3f1f947a 39ac9985

+1
+1
tools/mm/page_owner_sort.c
··· 377 377 if (errno != 0) { 378 378 if (debug_on) 379 379 fprintf(stderr, "wrong comm in follow buf:\n%s\n", buf); 380 + free(comm_str); 380 381 return NULL; 381 382 } 382 383