diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-04-18 15:44:33 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-04-18 15:44:33 -0400 |
commit | 596e9a8a69ef2ca04da55d46d6a7569e54962ebb (patch) | |
tree | fff514a2937678a919e900373d1fb94cbb504f45 | |
parent | 45ae24b973bd86a0a83c0c054d035de2487b3c30 (diff) |
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 <rostedt@goodmis.org>
-rw-r--r-- | trace-output.c | 6 |
1 files 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, | |||
1015 | out_free: | 1015 | out_free: |
1016 | free(offsets); | 1016 | free(offsets); |
1017 | free(sizes); | 1017 | free(sizes); |
1018 | |||
1019 | tracecmd_output_close(handle); | ||
1020 | return -1; | 1018 | return -1; |
1021 | } | 1019 | } |
1022 | 1020 | ||
@@ -1087,8 +1085,10 @@ tracecmd_create_file_glob(const char *output_file, | |||
1087 | if (!handle) | 1085 | if (!handle) |
1088 | return NULL; | 1086 | return NULL; |
1089 | 1087 | ||
1090 | if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) < 0) | 1088 | if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) < 0) { |
1089 | tracecmd_output_close(handle); | ||
1091 | return NULL; | 1090 | return NULL; |
1091 | } | ||
1092 | 1092 | ||
1093 | return handle; | 1093 | return handle; |
1094 | } | 1094 | } |