Fix a heap corruption issue leading to a server-side crash. (#564)

Commit 5ab2132c (PR #551) fixed, among other things, a memory
leak.  The solution, however, causes a hazard where a free() of
an invalid pointer can corrupt the heap.  We've observed this
fairly repeatably while running the test_commands.sh script on
CentOS 7.

To remedy this, we NULL out a pointer after the object it
pointed to has been free-d, just like a number of other similar
objects.

(cherry picked from commit 103d4318e8)
This commit is contained in:
Bruce A. Mah 2017-05-04 14:16:42 -07:00 committed by Bruce A. Mah
parent 30d8c2828a
commit a7a4ec7f9c
No known key found for this signature in database
GPG Key ID: 4984910A8CAAEE8A

View File

@ -466,6 +466,7 @@ cleanup_server(struct iperf_test *test)
}
if (test->congestion_used != NULL) {
free(test->congestion_used);
test->congestion_used = NULL;
}
if (test->timer != NULL) {
tmr_cancel(test->timer);