Found bug in platform/CCImage.cpp:
line 162.
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)M
\ FILE\ *\ source\ =\ fmemopen;M
CC_BREAK_IF(!source);M
\ jpeg_stdio_src;M
//fclose(source);^M <——BUG HERE——-<<
#else^M
I just moved that line right before the while loop and forgot about it till I updated.