diff --git a/src/iperf_api.c b/src/iperf_api.c index b374690..e40fb52 100755 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -2601,7 +2601,7 @@ iperf_free_stream(struct iperf_stream *sp) close(sp->buffer_fd); if (sp->diskfile_fd >= 0) close(sp->diskfile_fd); - for (irp = TAILQ_FIRST(&sp->result->interval_results); irp != TAILQ_END(sp->result->interval_results); irp = nirp) { + for (irp = TAILQ_FIRST(&sp->result->interval_results); irp != NULL; irp = nirp) { nirp = TAILQ_NEXT(irp, irlistentries); free(irp); }