Fix memory leak on object and assoc array processing