Scan build fixes

Fix some trivial warnings coming out of Clang's static analysis.
This variable seems to be unused. Isn't it better to remove it completely?