Skip to content

Incorrect delete in Dispatch JNI invokev() #40

@EJP286CRSKW

Description

@EJP286CRSKW

In the error handling case at the end of the method we have:

buf = CreateErrorMsgFromInfo(hr, &excepInfo, nm);

and

dispIdAsName = new char[256];

and later:

if (buf) delete buf;
if (dispIdAsName) delete dispIdAsName;

The latter should be:

delete[] buf;
delete[] dispIdAsName;

to agree with how they were created, as new wchar_t[...] and new char[...] respectively.
The null tests are unnecessary.

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