Fix a compiler warning.

The compiler barks about fd being used without potentially being
initialized. We fix this and also make the code more future proof by
ensuring that the file is closed iff it was previously opened,
regardless of the path conditions that led to it being opened.

TEST=Package builds.

Change-Id: I5e2a2a5653b5ebe1c1c73e7193d7b226d8b5bd16
Tested-by: Gilad Arnold <>
Reviewed-by: Ben Chan <>
Commit-Queue: Gilad Arnold <>
1 file changed