Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933941Ab2EXRSD (ORCPT ); Thu, 24 May 2012 13:18:03 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56222 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167Ab2EXRSA (ORCPT ); Thu, 24 May 2012 13:18:00 -0400 Date: Thu, 24 May 2012 10:17:21 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl, namhyung.kim@lge.com, namhyung@gmail.com, bp@alien8.de, fweisbec@gmail.com, rostedt@goodmis.org, dsahern@gmail.com, tglx@linutronix.de Reply-To: mingo@kernel.org, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, namhyung.kim@lge.com, bp@alien8.de, namhyung@gmail.com, fweisbec@gmail.com, rostedt@goodmis.org, dsahern@gmail.com, tglx@linutronix.de In-Reply-To: <1337740619-27925-11-git-send-email-namhyung.kim@lge.com> References: <1337740619-27925-11-git-send-email-namhyung.kim@lge.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] tools lib traceevent: Fix a possible memory leak Git-Commit-ID: 57d34dc5568f6ac700ef7e5c67f2bd6a8c7c4659 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (terminus.zytor.com [127.0.0.1]); Thu, 24 May 2012 10:17:27 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1796 Lines: 49 Commit-ID: 57d34dc5568f6ac700ef7e5c67f2bd6a8c7c4659 Gitweb: http://git.kernel.org/tip/57d34dc5568f6ac700ef7e5c67f2bd6a8c7c4659 Author: Namhyung Kim AuthorDate: Wed, 23 May 2012 11:36:47 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 24 May 2012 11:32:10 -0300 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 --- tools/lib/traceevent/event-parse.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 33450c9..d598b37 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/