Skip to content

Commit f759996

Browse files
codypssofar
authored andcommitted
Avoid leaking sampledata
link_prev for `head` is always NULL, causing the code not to iterate. link_next is set to something useful for our iteration though.
1 parent 1e82895 commit f759996

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/bootchart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ int main(int argc, char *argv[]) {
525525
free(ps_first);
526526

527527
sampledata = head;
528-
while (sampledata->link_prev) {
528+
while (sampledata->link_next) {
529529
struct list_sample_data *old_sampledata = sampledata;
530-
sampledata = sampledata->link_prev;
530+
sampledata = sampledata->link_next;
531531
free(old_sampledata);
532532
}
533533
free(sampledata);

0 commit comments

Comments
 (0)