Fixed a memory leak in unicore.php