#158 Address issues discovered by clang and coverity
Merged by rcritten. Opened by rcritten.
rcritten/certmonger clang_coverity  into  master