fix two minor free after use errors