Strange core dump fix.

Might be caused by different linked malloc in C and C++.