From 596e9a8a69ef2ca04da55d46d6a7569e54962ebb Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 18 Apr 2011 15:44:33 -0400 Subject: trace-cmd: Release handle in proper location in trace-output.c tracecmd_append_cpu_data() does not create the handle and should not release it. Move the release of the handle to the location that created it: tracecmd_create_file_glob() Signed-off-by: Steven Rostedt --- trace-output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trace-output.c b/trace-output.c index 5e77fda..e2aa1bb 100644 --- a/trace-output.c +++ b/trace-output.c @@ -1015,8 +1015,6 @@ int tracecmd_append_cpu_data(struct tracecmd_output *handle, out_free: free(offsets); free(sizes); - - tracecmd_output_close(handle); return -1; } @@ -1087,8 +1085,10 @@ tracecmd_create_file_glob(const char *output_file, if (!handle) return NULL; - if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) < 0) + if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) < 0) { + tracecmd_output_close(handle); return NULL; + } return handle; } -- cgit v1.2.2