tap: fix memory errors in create/delete