server icon indicating copy to clipboard operation
server copied to clipboard

memory leak in CuFailInternal

Open ennorehling opened this issue 9 years ago • 0 comments

CuTest.c has a memory leak. In version 1.5, line 156, the test case message is assigned from a string buffer which is never free'd. The CuString is on the stack in CuFail_Line, the buffer inside the string is allocated in CuStringInit and then grown by subsequent CuStringAppend calls. tc->message = string->buffer; To clean this up, CuStringDelete cannot be called, because (a) the testcase.message pointer must survive, and b) the CuString in question is not on the heap.

When solved, submit this bugfix to the CuTest maintainers at http://sourceforge.net/projects/cutest/

ennorehling avatar Feb 25 '16 15:02 ennorehling