Static analysis fixes (clang scan-build)

9 jobs for sanitizer_fixes in 3 minutes and 23 seconds (queued for 1 second)