mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-28 16:56:26 +00:00
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>
This commit is contained in:
parent
39ac99852f
commit
3f1f947a32
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user