When the program runs in debugging but the release fails, the problem is actually often buffer overflowed, so you should look for something like the wrong variable buffer length.
, , . , , . , , malloc-ed, .
, , , , . DLL , DLL- DLL. , , , , .
, , . undefined .
: , , , _NO_DEBUG_HEAP = 1. ( ).