get memory leak in error path