Plug memory leak on error path in the easy interfaces