diff options
| -rw-r--r-- | trace-input.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/trace-input.c b/trace-input.c index 6fee129..eead50c 100644 --- a/trace-input.c +++ b/trace-input.c | |||
| @@ -593,7 +593,7 @@ static struct record * | |||
| 593 | read_event(struct tracecmd_handle *handle, unsigned long long offset, | 593 | read_event(struct tracecmd_handle *handle, unsigned long long offset, |
| 594 | int cpu) | 594 | int cpu) |
| 595 | { | 595 | { |
| 596 | struct record *record; | 596 | struct record *record = NULL; |
| 597 | 597 | ||
| 598 | /* | 598 | /* |
| 599 | * Since the timestamp is calculated from the beginnnig | 599 | * Since the timestamp is calculated from the beginnnig |
| @@ -607,8 +607,13 @@ read_event(struct tracecmd_handle *handle, unsigned long long offset, | |||
| 607 | handle->cpu_data[cpu].index = 0; | 607 | handle->cpu_data[cpu].index = 0; |
| 608 | 608 | ||
| 609 | do { | 609 | do { |
| 610 | if (record) | ||
| 611 | free(record); | ||
| 610 | /* Make sure peek returns new data */ | 612 | /* Make sure peek returns new data */ |
| 611 | handle->cpu_data[cpu].next = NULL; | 613 | if (handle->cpu_data[cpu].next) { |
| 614 | free(handle->cpu_data[cpu].next); | ||
| 615 | handle->cpu_data[cpu].next = NULL; | ||
| 616 | } | ||
| 612 | record = tracecmd_read_data(handle, cpu); | 617 | record = tracecmd_read_data(handle, cpu); |
| 613 | } while (record && (record->offset + record->record_size) <= offset); | 618 | } while (record && (record->offset + record->record_size) <= offset); |
| 614 | 619 | ||
