Free allocated memory if commit failed