Skip to content

memory leak in CuFailInternal #492

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/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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