perf script: Fix double free on command_line
authorColin Ian King <colin.king@canonical.com>
Tue, 1 Mar 2016 23:46:20 +0000 (23:46 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 3 Mar 2016 14:10:37 +0000 (11:10 -0300)
commit979ac257b00c53aacec3eacf86142e8c00bee889
treef640a1f3e9d0a51c56bec2f79bd684fad86e4ebb
parent676787939ef8ccfcf8039104f766ebe5ebe23924
perf script: Fix double free on command_line

The 'command_line' variable is free'd twice if db_export__branch_types()
fails. To avoid this, defer the free'ing of 'command_line' to after this
call so that the error return path will just free 'command_line' once.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Javi Merino <javi.merino@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1456875980-25606-1-git-send-email-colin.king@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/scripting-engines/trace-event-python.c