Fixed memory leak in array parsing