Fixed memory leak in function status