Avoid freeing ROM area in the error situation.

I think this patch will fix an underlying bug.
I just reviewed by my eyes and I've not tested yet.