mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 23:40:54 +07:00
tools lib traceevent: Fix a possible memory leak
If event_read_fields failed in the middle, each member of struct format_field should be freed also. Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337740619-27925-11-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
00b9da7219
commit
57d34dc556
@ -1434,8 +1434,11 @@ static int event_read_fields(struct event_format *event, struct format_field **f
|
||||
fail:
|
||||
free_token(token);
|
||||
fail_expect:
|
||||
if (field)
|
||||
if (field) {
|
||||
free(field->type);
|
||||
free(field->name);
|
||||
free(field);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user