Skip to content

Public SDK returns memory allocated by malloc instead of DfsMalloc #6

Description

@leetftw

dataBuf = (void*)malloc(return_size);

This function (ApplyMonofilePatchMemoryToMemoryEx) returns a pointer which has been allocated by a statically linked malloc function. This should not be done, because the callee has no way to free this memory.

For Release builds one can simply call Win32 HeapFree, since CRT free is just a wrapper around that function. This does not work in Debug builds however, since free uses the CRT heap. Anyways, this should probably just be done with DfsMalloc and DfsFree for consistency.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions