Fixed #4867 (Memory Leak: Return value of malloc)