Repository: trafficserver Updated Branches: refs/heads/master 78acb3ab1 -> a22f6436c
TS-4066: Memory leaks in gmake check tests This closes #468 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a22f6436 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a22f6436 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a22f6436 Branch: refs/heads/master Commit: a22f6436c6968d0e963e350a134632793576e46e Parents: 78acb3a Author: Bryan Call <[email protected]> Authored: Thu Feb 11 20:58:35 2016 -0800 Committer: Bryan Call <[email protected]> Committed: Thu Feb 11 20:58:35 2016 -0800 ---------------------------------------------------------------------- lib/ts/test_List.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a22f6436/lib/ts/test_List.cc ---------------------------------------------------------------------- diff --git a/lib/ts/test_List.cc b/lib/ts/test_List.cc index a09d4fd..f5e78a5 100644 --- a/lib/ts/test_List.cc +++ b/lib/ts/test_List.cc @@ -51,11 +51,15 @@ main() s.push(f); d.push(s.pop()); q.enqueue(d.pop()); - for (int i = 0; i < 100; i++) + for (int i = 0; i < 100; i++) { q.enqueue(new Foo(i)); + } int tot = 0; - for (int i = 0; i < 101; i++) - tot += q.dequeue()->x; + for (int i = 0; i < 101; i++) { + Foo *foo = q.dequeue(); + tot += foo->x; + delete foo; + } if (tot != 4957) { printf("test_List FAILED\n"); exit(1);
