ccmake: Add missing initializers reported by cppcheck

The return statement uses d1, d2, d3, and d4 variables but the code
which initialize them inside a if statement and not always this if
statement is corrent.  On the other hand these variables are using for
return statement and needed to be initialized.  A trivial fix to pervent
some compilers will give build error.

Reviewed-by: Igor Murzov <e-mail@date.by>
libarchive: Fix free() order to avoid accessing freed memory

The archive_string_conv type sc variable already freed via free(sc) on
the other hand in second line we are tyring to free its subset via
free(sc->from_charset) this will cause a problem because we couldn't
reach sc after first release.

Reviewed-by: Igor Murzov <e-mail@date.by>
cmcurl: Fix resource leak reported by cppcheck

Add missing fclose calls.

Reviewed-by: Igor Murzov <e-mail@date.by>
cmake: Fix resource leak reported by cppcheck

Return early in cmake::ReportUndefinedPropertyAccesses if there is no
global generator instead of opening a file and leaking the descriptor.

Reported-by: Ömer Fadıl USTA <omerusta@gmail.com>
Merge topic 'cppcheck-fixes' into next

a20c819 cmake: Fix resource leak reported by cppcheck
c8adab9 cmcurl: Fix resource leak reported by cppcheck
499531c libarchive: Fix free() order to avoid accessing freed memory
3b849a7 ccmake: Add missing initializers reported by cppcheck