diff options
author | Liu Jing <liujing@cmss.chinamobile.com> | 2024-10-22 09:25:26 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-11-06 20:11:17 -0800 |
commit | 3f1f947a322d2bdf0b16ff9158ce6be7cc23b974 (patch) | |
tree | df285200a3fb4af904a7b3cea6d77b559e38145c /tools/mm | |
parent | 39ac99852fca98ca44d52716d792dfaf24981f53 (diff) |
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>
Diffstat (limited to 'tools/mm')
-rw-r--r-- | tools/mm/page_owner_sort.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/mm/page_owner_sort.c b/tools/mm/page_owner_sort.c index e1f264444342..880e36df0c11 100644 --- a/tools/mm/page_owner_sort.c +++ b/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; } |