Remove possible leak when exception occurred.

Change-Id: I176d6db568fecbf40bb2daf3afc3b329f8dd8595