Memory leak check problem

40 views
Skip to first unread message

William Ivory

unread,
Jul 16, 2020, 11:56:31 AM7/16/20
to cppu...@googlegroups.com
Hi,

I'm struggling with the memory leak detection at present. The scenario is that I am calling malloc in the production code, checking the content of this memory in the test code, and then freeing it in the test code. That counts as a leak apparently. While I could pull some tests out into a non-leak-checked test suite, there are places where I would like all bar one malloc call to be matched by a free, and to be able to check that.

Is this possible?

Thanks,

William

Nolan Hergert

unread,
Jan 6, 2021, 1:51:04 PM1/6/21
to cpputest
I am not seeing any leaks detected when I do the scenario you describe (malloc in production code and free in test code). Also, when I comment out the free in the test code, it correctly detects the leak.

Maybe you have an actual leak somewhere? Is the leak detector complaining about that variable?
Reply all
Reply to author
Forward
0 new messages