libgit2/libgit2 — pull request #1344 by arrbee (2013-02-16 00:12:23+00:00)
Title: Fix static analyzer issues

Issue #1341 flags a number of warnings from the [cppcheck](http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page) tool for the libgit2 code base. Even though these are almost entirely false positives, it seemed like it might be worthwhile to clear them up in the interest of being tidy.

There is one commit just for `examples/general.c` because instead of just fixing the warning, I actually updated that file more dramatically, adding in some rudimentary error checking and reformatting all the comments to 80 columns.

There is one commit for the single real error from the bug, a memory leak in an error handling path on the Amiga version of `p_getaddrinfo()`.

And there is a commit with a bunch of tiny rearrangements or unnecessary initializers to clear up code paths that cppcheck apparently fails to understand. I don't think any of these changes make the code worse, so I felt like "why not?"

Several of the spurious warnings I didn't fix because the code is obviously correct and I didn't see a clear way to make it more obviously right to cppcheck.