diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-02-12 17:19:35 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-02-12 17:19:35 -0500 |
| commit | bdeda78cf66c59d38109b033546639ee662cdc3b (patch) | |
| tree | 9fb0ac6e293574562b1e2e53c80a8be867337024 | |
| parent | 307d6dfc196e321073ffb8087319e685cf77bad6 (diff) | |
trace-cmd: Move free of record out of show_data in trace-cmd read
There is no reason that the record that is passed to show_data should be
freed by show_data. Free it from the location that allocated it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | trace-read.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/trace-read.c b/trace-read.c index f7b9e17..12862b5 100644 --- a/trace-read.c +++ b/trace-read.c | |||
| @@ -203,8 +203,6 @@ static void show_data(struct tracecmd_input *handle, | |||
| 203 | pevent_print_event(pevent, &s, record); | 203 | pevent_print_event(pevent, &s, record); |
| 204 | trace_seq_do_printf(&s); | 204 | trace_seq_do_printf(&s); |
| 205 | printf("\n"); | 205 | printf("\n"); |
| 206 | |||
| 207 | free_record(record); | ||
| 208 | } | 206 | } |
| 209 | 207 | ||
| 210 | static void read_rest(void) | 208 | static void read_rest(void) |
| @@ -252,9 +250,10 @@ static void read_data_info(struct tracecmd_input *handle) | |||
| 252 | } else | 250 | } else |
| 253 | record = tracecmd_read_next_data(handle, &cpu); | 251 | record = tracecmd_read_next_data(handle, &cpu); |
| 254 | 252 | ||
| 255 | if (record) | 253 | if (record) { |
| 256 | show_data(handle, record, next); | 254 | show_data(handle, record, next); |
| 257 | 255 | free_record(record); | |
| 256 | } | ||
| 258 | } while (record); | 257 | } while (record); |
| 259 | 258 | ||
| 260 | show_test(handle); | 259 | show_test(handle); |
