Plug potential resource leak

Change-Id: Ic01475e7f5dec64ab97af2674f05dc6303b334b7