Merge pull request #3607 from pks-t/pks/coverity-improvements Coverity improvements for GITERR_CHECK_ALLOC