Incorrect pointer validation after malloc()

As part of the Audio classification project done using EdgeImpulse, the generated code for Arduino seems to be checking an incorrect pointer after memory allocation and attempting to free() in case of failure.

Though this path has not been exercised and/or fewer chances of hitting it during execution. Would like to bring it to your attention, as it is still a bug.

Attached snip of the code for the same.

The project is currently private, however I could share more details that might help here.


Good find, thanks! Will make sure we get it fixed!