From: Namhyung Kim Date: Wed, 23 May 2012 02:36:47 +0000 (+0900) Subject: tools lib traceevent: Fix a possible memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=57d34dc5568f6ac700ef7e5c67f2bd6a8c7c4659;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1337740619-27925-11-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 33450c901e17..d598b376e3c1 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -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; }