Skip to content

memory leak in CuFailInternal #492

@ennorehling

Description

@ennorehling

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions