free error message buffer after exception