api: fix leak when a api function is incorrectly called with a list.

This applies both to msgpack-rpc and eval.
This commit is contained in:
Björn Linse
2016-07-16 16:51:56 +02:00
parent 98a08c3e5a
commit acb7c826b3
4 changed files with 9 additions and 10 deletions

View File

@@ -7140,8 +7140,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
end:
// All arguments were freed already, but we still need to free the array
xfree(args.items);
api_free_array(args);
api_free_object(result);
}