criu-4.2-11.fc44

List of Findings

Error: CPPCHECK_WARNING (CWE-476): [#def1]
criu-4.2/compel/plugins/std/infect.c:106: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  104|   	return fini_sigreturn(new_sp);
#  105|   
#  106|-> 	BUG();
#  107|   
#  108|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2]
criu-4.2/compel/plugins/std/string.c:14:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
criu-4.2/compel/plugins/std/string.c:115:6: enter_function: entry to ‘std_dprintf’
criu-4.2/compel/plugins/std/string.c:119:9: acquire_resource: ‘va_start’ called here
criu-4.2/compel/plugins/std/string.c:120:9: call_function: calling ‘std_vdprintf’ from ‘std_dprintf’
#   12|   void std_dputc(int fd, char c)
#   13|   {
#   14|-> 	sys_write(fd, &c, 1);
#   15|   }
#   16|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
criu-4.2/compel/src/lib/handle-elf-host.c:48:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: call_function: calling ‘test_pointer’ from ‘handle_elf_x86_64’
#   46|   {
#   47|   	if (__ptr_oob((const uintptr_t)ptr, (const uintptr_t)start, size)) {
#   48|-> 		pr_err("Corrupted pointer %p (%s) at %s:%d\n", ptr, name, file, line);
#   49|   		return true;
#   50|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
criu-4.2/compel/src/lib/handle-elf-host.c:102:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
#  100|   
#  101|   	if (__ptr_struct_oob(sec_table, sec_table_size, mem, size)) {
#  102|-> 		pr_err("Section table [%#zx, %#zx) is out of [%#zx, %#zx)\n", sec_table, sec_table + sec_table_size,
#  103|   		       mem, mem + size);
#  104|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
criu-4.2/compel/src/lib/handle-elf-host.c:113:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
#  111|   	addr = sec_table + ((size_t)hdr->e_shentsize) * hdr->e_shstrndx;
#  112|   	if (__ptr_struct_oob(addr, sizeof(Elf_Shdr), sec_table, sec_table_size)) {
#  113|-> 		pr_err("String section header @%#zx is out of [%#zx, %#zx)\n", addr, sec_table,
#  114|   		       sec_table + sec_table_size);
#  115|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
criu-4.2/compel/src/lib/handle-elf-host.c:121:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
#  119|   	addr = mem + secstrings_hdr->sh_offset;
#  120|   	if (__ptr_struct_oob(addr, secstrings_hdr->sh_size, mem, size)) {
#  121|-> 		pr_err("String section @%#zx size %#lx is out of [%#zx, %#zx)\n", addr,
#  122|   		       (unsigned long)secstrings_hdr->sh_size, mem, mem + size);
#  123|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  172|   		goto err;
#  173|   
#  174|-> 	pr_debug("Sections\n");
#  175|   	pr_debug("------------\n");
#  176|   	for (i = 0; i < hdr->e_shnum; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
criu-4.2/compel/src/lib/handle-elf-host.c:175:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:175:9: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:175:9: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  173|   
#  174|   	pr_debug("Sections\n");
#  175|-> 	pr_debug("------------\n");
#  176|   	for (i = 0; i < hdr->e_shnum; i++) {
#  177|   		Elf_Shdr *sh = mem + hdr->e_shoff + hdr->e_shentsize * i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  182|   
#  183|   		ptr_func_exit(&secstrings[sh->sh_name]);
#  184|-> 		pr_debug("\t index %-2zd type 0x%-2x name %s\n", i, (unsigned)sh->sh_type, &secstrings[sh->sh_name]);
#  185|   
#  186|   		sec_hdrs[i] = sh;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
criu-4.2/compel/src/lib/handle-elf-host.c:207:25: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:199:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:200:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:206:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:207:25: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:207:25: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  205|   		}
#  206|   		if (sh->sh_addr && sh->sh_addr != k)
#  207|-> 			pr_info("Overriding unexpected precalculated address of section (section %s addr 0x%lx expected 0x%lx)\n",
#  208|   				&secstrings[sh->sh_name], (unsigned long)sh->sh_addr, (unsigned long)k);
#  209|   		sh->sh_addr = k;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
criu-4.2/compel/src/lib/handle-elf-host.c:214:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_true: following ‘true’ branch (when ‘symtab_hdr’ is NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:214:17: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:214:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:214:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  212|   
#  213|   	if (!symtab_hdr) {
#  214|-> 		pr_err("No symbol table present\n");
#  215|   		goto err;
#  216|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
criu-4.2/compel/src/lib/handle-elf-host.c:219:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:219:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:219:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
#  217|   
#  218|   	if (!symtab_hdr->sh_link || symtab_hdr->sh_link >= hdr->e_shnum) {
#  219|-> 		pr_err("Corrupted symtab header\n");
#  220|   		goto err;
#  221|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
criu-4.2/compel/src/lib/handle-elf-host.c:223:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:223:9: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:223:9: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
#  221|   	}
#  222|   
#  223|-> 	pr_debug("Symbols\n");
#  224|   	pr_debug("------------\n");
#  225|   	strtab_hdr = sec_hdrs[symtab_hdr->sh_link];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
criu-4.2/compel/src/lib/handle-elf-host.c:224:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:224:9: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:224:9: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  222|   
#  223|   	pr_debug("Symbols\n");
#  224|-> 	pr_debug("------------\n");
#  225|   	strtab_hdr = sec_hdrs[symtab_hdr->sh_link];
#  226|   	ptr_func_exit(strtab_hdr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
criu-4.2/compel/src/lib/handle-elf-host.c:234:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:234:17: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:234:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:234:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
#  232|   
#  233|   	if (sizeof(*symbols) != symtab_hdr->sh_entsize) {
#  234|-> 		pr_err("Symbol table align differ\n");
#  235|   		goto err;
#  236|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
criu-4.2/compel/src/lib/handle-elf-host.c:253:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:241:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:242:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:246:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:247:36: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:248:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:250:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:250:20: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:253:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:253:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:253:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#  251|   			continue;
#  252|   
#  253|-> 		pr_debug("\ttype 0x%-2x bind 0x%-2x shndx 0x%-4x value 0x%-2lx name %s\n",
#  254|   			 (unsigned)ELF_ST_TYPE(sym->st_info), (unsigned)ELF_ST_BIND(sym->st_info),
#  255|   			 (unsigned)sym->st_shndx, (unsigned long)sym->st_value, name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
criu-4.2/compel/src/lib/handle-elf-host.c:282:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:282:9: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:282:9: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
#  280|   	pr_out("static __maybe_unused compel_reloc_t %s_relocs[] = {\n", opts.prefix);
#  281|   #ifndef NO_RELOCS
#  282|-> 	pr_debug("Relocations\n");
#  283|   	pr_debug("------------\n");
#  284|   	for (i = 0; i < hdr->e_shnum; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
criu-4.2/compel/src/lib/handle-elf-host.c:283:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:283:9: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:283:9: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
#  281|   #ifndef NO_RELOCS
#  282|   	pr_debug("Relocations\n");
#  283|-> 	pr_debug("------------\n");
#  284|   	for (i = 0; i < hdr->e_shnum; i++) {
#  285|   		Elf_Shdr *sh = sec_hdrs[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:288:20: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:291:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
#  292|   		ptr_func_exit(sh_rel);
#  293|   
#  294|-> 		pr_debug("\tsection %2zd type 0x%-2x link 0x%-2x info 0x%-2x name %s\n", i, (unsigned)sh->sh_type,
#  295|   			 (unsigned)sh->sh_link, (unsigned)sh->sh_info, &secstrings[sh->sh_name]);
#  296|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
#  318|   			ptr_func_exit(where);
#  319|   
#  320|-> 			pr_debug("\t\tr_offset 0x%-4lx r_info 0x%-4lx / sym 0x%-2lx type 0x%-2lx symsecoff 0x%-4lx\n",
#  321|   				 (unsigned long)r->rel.r_offset, (unsigned long)r->rel.r_info,
#  322|   				 (unsigned long)ELF_R_SYM(r->rel.r_info), (unsigned long)ELF_R_TYPE(r->rel.r_info),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
criu-4.2/compel/src/lib/handle-elf-host.c:337:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:337:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:337:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
#  335|   				}
#  336|   #else
#  337|-> 				pr_err("Unexpected undefined symbol: `%s'. External symbol in PIE?\n", name);
#  338|   				goto err;
#  339|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
criu-4.2/compel/src/lib/handle-elf-host.c:347:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:347:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:347:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/8)
#  345|   				 * For now, we punt.
#  346|   				 */
#  347|-> 				pr_err("Unsupported COMMON symbol: `%s'. Try initializing the variable\n", name);
#  348|   				goto err;
#  349|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
criu-4.2/compel/src/lib/handle-elf-host.c:361:25: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:361:25: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:361:25: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/8)
#  359|   			place = sh_rel->sh_addr + r->rel.r_offset;
#  360|   
#  361|-> 			pr_debug("\t\t\tvalue 0x%-8lx addend32 %-4d addend64 %-8ld place %-8lx symname %s\n",
#  362|   				 (unsigned long)sym->st_value, addend32, (long)addend64, (long)place, name);
#  363|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
criu-4.2/compel/src/lib/handle-elf-host.c:371:41: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:371:41: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:371:41: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/8)
#  369|   
#  370|   				if ((unsigned)sym->st_shndx > (unsigned)hdr->e_shnum) {
#  371|-> 					pr_err("Unexpected symbol section index %u/%u\n", (unsigned)sym->st_shndx,
#  372|   					       hdr->e_shnum);
#  373|   					goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
criu-4.2/compel/src/lib/handle-elf-host.c:559:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:559:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:559:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/8)
#  557|   			case R_X86_64_32:  /* Symbol + Addend (4 bytes) */
#  558|   			case R_X86_64_32S: /* Symbol + Addend (4 bytes) */
#  559|-> 				pr_debug("\t\t\t\tR_X86_64_32       at 0x%-4lx val 0x%x\n", place, value32);
#  560|   				pr_out("	{ .offset = 0x%-8x, .type = COMPEL_TYPE_INT,  "
#  561|   				       ".addend = %-8d, .value = 0x%-16x, }, /* R_X86_64_32 */\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
criu-4.2/compel/src/lib/handle-elf-host.c:565:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:364:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:365:52: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:565:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:565:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/8)
#  563|   				break;
#  564|   			case R_X86_64_64: /* Symbol + Addend (8 bytes) */
#  565|-> 				pr_debug("\t\t\t\tR_X86_64_64       at 0x%-4lx val 0x%lx\n", place, (long)value64);
#  566|   				pr_out("	{ .offset = 0x%-8x, .type = COMPEL_TYPE_LONG, "
#  567|   				       ".addend = %-8ld, .value = 0x%-16lx, }, /* R_X86_64_64 */\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
criu-4.2/compel/src/lib/handle-elf-host.c:571:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:571:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:571:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/8)
#  569|   				break;
#  570|   			case R_X86_64_PC32: /* Symbol + Addend - Place (4 bytes) */
#  571|-> 				pr_debug("\t\t\t\tR_X86_64_PC32     at 0x%-4lx val 0x%x\n", place,
#  572|   					 value32 + addend32 - (int32_t)place);
#  573|   				/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
criu-4.2/compel/src/lib/handle-elf-host.c:579:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:579:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:579:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/8)
#  577|   				break;
#  578|   			case R_X86_64_PLT32: /* ProcLinkage + Addend - Place (4 bytes) */
#  579|-> 				pr_debug("\t\t\t\tR_X86_64_PLT32    at 0x%-4lx val 0x%x\n", place,
#  580|   					 value32 + addend32 - (int32_t)place);
#  581|   				/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
criu-4.2/compel/src/lib/handle-elf-host.c:589:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:589:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:589:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/8)
#  587|   			case R_X86_64_REX_GOTPCRELX:
#  588|   			case R_X86_64_GOTPCREL: /* SymbolOffsetInGot + GOT + Addend - Place  (4 bytes) */
#  589|-> 				pr_debug("\t\t\t\tR_X86_64_GOTPCREL at 0x%-4lx val 0x%x\n", place, value32);
#  590|   				pr_out("	{ .offset = 0x%-8x, .type = COMPEL_TYPE_LONG | COMPEL_TYPE_GOTPCREL, "
#  591|   				       ".addend = %-8d, .value = 0x%-16x, }, /* R_X86_64_GOTPCREL */\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
criu-4.2/compel/src/lib/handle-elf-host.c:640:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:284:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:285:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:292:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:294:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:297:29: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:308:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:309:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:311:40: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:312:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:314:44: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:315:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:317:39: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:318:25: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:320:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:325:28: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:340:35: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:351:29: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:351:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:352:33: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:640:33: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:640:33: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/8)
#  638|   #endif
#  639|   			default:
#  640|-> 				pr_err("Unsupported relocation of type %lu\n",
#  641|   				       (unsigned long)ELF_R_TYPE(r->rel.r_info));
#  642|   				goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
criu-4.2/compel/src/lib/handle-elf-host.c:660:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sec_hdrs’
criu-4.2/compel/src/lib/handle-elf-host.c:135:5: enter_function: entry to ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:158:14: call_function: inlined call to ‘is_header_supported’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:163:47: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:163:20: acquire_memory: allocated here
criu-4.2/compel/src/lib/handle-elf-host.c:164:12: branch_false: following ‘false’ branch (when ‘sec_hdrs’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: call_function: calling ‘get_strings_section’ from ‘handle_elf_x86_64’
criu-4.2/compel/src/lib/handle-elf-host.c:170:22: return_function: returning to ‘handle_elf_x86_64’ from ‘get_strings_section’
criu-4.2/compel/src/lib/handle-elf-host.c:171:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:174:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:176:21: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:177:38: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:178:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:21: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:180:20: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:183:17: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:184:17: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:213:12: branch_false: following ‘false’ branch (when ‘symtab_hdr’ is non-NULL)...
criu-4.2/compel/src/lib/handle-elf-host.c:218:14: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:218:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:226:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:228:25: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:229:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:230:28: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:231:9: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:233:33: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:238:9: branch_false: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:651:28: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:652:40: branch_true: ...to here
criu-4.2/compel/src/lib/handle-elf-host.c:656:20: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/handle-elf-host.c:660:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/handle-elf-host.c:660:17: danger: ‘sec_hdrs’ leaks here; was allocated at [(9)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/8)
#  658|   
#  659|   		shdata = mem + sh->sh_offset;
#  660|-> 		pr_debug("Copying section '%s'\n"
#  661|   			 "\tstart:0x%lx (gap:0x%lx) size:0x%lx\n",
#  662|   			 &secstrings[sh->sh_name], (unsigned long)sh->sh_addr, (unsigned long)(sh->sh_addr - k),

Error: CPPCHECK_WARNING (CWE-476): [#def32]
criu-4.2/compel/src/lib/infect.c:428: error[nullPointer]: Null pointer dereference: (struct sockaddr_un*)0
#  426|   
#  427|   	saddr->sun_family = AF_UNIX;
#  428|-> 	snprintf(saddr->sun_path, UNIX_PATH_MAX, "X/crtools-pr-%d-%s", key, compel_run_id);
#  429|   
#  430|   	sun_len = SUN_LEN(saddr);

Error: CPPCHECK_WARNING (CWE-476): [#def33]
criu-4.2/compel/src/lib/infect.c:708: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  706|   		goto err;
#  707|   
#  708|-> 	futex_wait_while_eq(&args->daemon_connected, 0);
#  709|   	if (futex_get(&args->daemon_connected) != 1) {
#  710|   		errno = -(int)futex_get(&args->daemon_connected);

Error: CPPCHECK_WARNING (CWE-476): [#def34]
criu-4.2/compel/src/lib/infect.c:929: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  927|   			*where = elf_relocs[i].value + elf_relocs[i].addend + (unsigned long)vbase;
#  928|   		} else
#  929|-> 			BUG();
#  930|   	}
#  931|   #endif

Error: GCC_ANALYZER_WARNING (CWE-476): [#def35]
criu-4.2/compel/src/lib/infect.c:929:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/compel/src/lib/infect.c:909:28: branch_true: following ‘true’ branch (when ‘i < nr_relocs’)...
criu-4.2/compel/src/lib/infect.c:910:31: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:929:25: danger: dereference of NULL ‘0’
#  927|   			*where = elf_relocs[i].value + elf_relocs[i].addend + (unsigned long)vbase;
#  928|   		} else
#  929|-> 			BUG();
#  930|   	}
#  931|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
criu-4.2/compel/src/lib/infect.c:1207:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&aux, "r")’
criu-4.2/compel/src/lib/infect.c:1198:13: acquire_resource: opened here
criu-4.2/compel/src/lib/infect.c:1199:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1199:12: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1202:16: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1206:25: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1207:23: danger: ‘fopen(&aux, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1205|   
# 1206|   		start = strtoul(aux, &f, 16);
# 1207|-> 		end = strtoul(f + 1, &f, 16);
# 1208|   
# 1209|   		/* f now points at " rwx" (yes, with space) part */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
criu-4.2/compel/src/lib/infect.c:1207:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&aux, "r")’
criu-4.2/compel/src/lib/infect.c:1198:13: acquire_memory: allocated here
criu-4.2/compel/src/lib/infect.c:1199:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1199:12: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1202:16: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1206:25: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1207:23: danger: ‘fopen(&aux, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1205|   
# 1206|   		start = strtoul(aux, &f, 16);
# 1207|-> 		end = strtoul(f + 1, &f, 16);
# 1208|   
# 1209|   		/* f now points at " rwx" (yes, with space) part */

Error: CPPCHECK_WARNING (CWE-476): [#def38]
criu-4.2/compel/src/lib/infect.c:1211: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
# 1209|   		/* f now points at " rwx" (yes, with space) part */
# 1210|   		if (f[3] == 'x') {
# 1211|-> 			BUG_ON(end - start < PARASITE_START_AREA_MIN);
# 1212|   			ret = start;
# 1213|   			break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
criu-4.2/compel/src/lib/infect.c:1211:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/compel/src/lib/infect.c:1199:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1199:12: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1202:16: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1206:25: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1211:25: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1211:25: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1211:25: danger: dereference of NULL ‘0’
# 1209|   		/* f now points at " rwx" (yes, with space) part */
# 1210|   		if (f[3] == 'x') {
# 1211|-> 			BUG_ON(end - start < PARASITE_START_AREA_MIN);
# 1212|   			ret = start;
# 1213|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
criu-4.2/compel/src/lib/infect.c:1240:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&p, 0)’
criu-4.2/compel/src/lib/infect.c:1234:14: acquire_resource: opened here
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1240:15: throw: if ‘open’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1240:15: danger: ‘open(&p, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1238|   	}
# 1239|   
# 1240|-> 	mfd = open("/proc/self/ns/net", O_RDONLY);
# 1241|   	if (mfd < 0) {
# 1242|   		pr_perror("Can't open self netns");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
criu-4.2/compel/src/lib/infect.c:1242:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&p, 0)’
criu-4.2/compel/src/lib/infect.c:1234:14: acquire_resource: opened here
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1242:17: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1242:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1242:17: danger: ‘open(&p, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1240|   	mfd = open("/proc/self/ns/net", O_RDONLY);
# 1241|   	if (mfd < 0) {
# 1242|-> 		pr_perror("Can't open self netns");
# 1243|   		goto out_c;
# 1244|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
criu-4.2/compel/src/lib/infect.c:1247:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/ns/net", 0)’
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1240:15: acquire_resource: opened here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1246:13: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1246:12: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1247:17: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1247:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1247:17: danger: ‘open("/proc/self/ns/net", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1245|   
# 1246|   	if (setns(fd, CLONE_NEWNET)) {
# 1247|-> 		pr_perror("Can't setup target netns");
# 1248|   		goto out_cm;
# 1249|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
criu-4.2/compel/src/lib/infect.c:1253:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/ns/net", 0)’
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1240:15: acquire_resource: opened here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1246:13: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1246:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1251:14: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1252:12: branch_true: following ‘true’ branch (when ‘sk < 0’)...
criu-4.2/compel/src/lib/infect.c:1253:17: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1253:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1253:17: danger: ‘open("/proc/self/ns/net", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1251|   	sk = socket(PF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
# 1252|   	if (sk < 0)
# 1253|-> 		pr_perror("Can't create seqsk");
# 1254|   
# 1255|   	ret = setns(mfd, CLONE_NEWNET);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
criu-4.2/compel/src/lib/infect.c:1257:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1246:13: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1246:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1251:14: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1251:14: acquire_resource: socket created here
criu-4.2/compel/src/lib/infect.c:1252:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/compel/src/lib/infect.c:1255:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1256:12: branch_true: following ‘true’ branch (when ‘ret != 0’)...
criu-4.2/compel/src/lib/infect.c:1257:17: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1257:17: throw: if ‘compel_print_on_level’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1257:17: danger: ‘sk’ leaks here
# 1255|   	ret = setns(mfd, CLONE_NEWNET);
# 1256|   	if (ret) {
# 1257|-> 		pr_perror("Can't restore former netns");
# 1258|   		if (sk >= 0)
# 1259|   			close(sk);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
criu-4.2/compel/src/lib/infect.c:1259:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1246:13: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1246:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1251:14: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1251:14: acquire_resource: socket created here
criu-4.2/compel/src/lib/infect.c:1252:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/compel/src/lib/infect.c:1255:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1256:12: branch_true: following ‘true’ branch (when ‘ret != 0’)...
criu-4.2/compel/src/lib/infect.c:1257:17: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1258:20: branch_true: following ‘true’ branch (when ‘sk >= 0’)...
criu-4.2/compel/src/lib/infect.c:1259:25: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1259:25: throw: if ‘close’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1259:25: danger: ‘sk’ leaks here
# 1257|   		pr_perror("Can't restore former netns");
# 1258|   		if (sk >= 0)
# 1259|-> 			close(sk);
# 1260|   		sk = -1;
# 1261|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
criu-4.2/compel/src/lib/infect.c:1263:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1246:13: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1246:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1251:14: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1251:14: acquire_resource: socket created here
criu-4.2/compel/src/lib/infect.c:1252:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/compel/src/lib/infect.c:1255:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1256:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/compel/src/lib/infect.c:1262:1: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1263:9: throw: if ‘close’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1263:9: danger: ‘sk’ leaks here
# 1261|   	}
# 1262|   out_cm:
# 1263|-> 	close(mfd);
# 1264|   out_c:
# 1265|   	close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
criu-4.2/compel/src/lib/infect.c:1265:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/compel/src/lib/infect.c:1235:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1240:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1241:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1246:13: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1246:12: branch_false: following ‘false’ branch...
criu-4.2/compel/src/lib/infect.c:1251:14: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1251:14: acquire_resource: socket created here
criu-4.2/compel/src/lib/infect.c:1252:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/compel/src/lib/infect.c:1255:15: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1256:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/compel/src/lib/infect.c:1262:1: branch_false: ...to here
criu-4.2/compel/src/lib/infect.c:1265:9: throw: if ‘close’ throws an exception...
criu-4.2/compel/src/lib/infect.c:1265:9: danger: ‘sk’ leaks here
# 1263|   	close(mfd);
# 1264|   out_c:
# 1265|-> 	close(fd);
# 1266|   out:
# 1267|   	return sk;

Error: CPPCHECK_WARNING (CWE-476): [#def48]
criu-4.2/compel/src/lib/infect.c:1537: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
# 1535|   void *compel_parasite_args_s(struct parasite_ctl *ctl, unsigned long args_size)
# 1536|   {
# 1537|-> 	BUG_ON(args_size > ctl->args_size);
# 1538|   	return compel_parasite_args_p(ctl);
# 1539|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
criu-4.2/compel/src/lib/infect.c:1537:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/compel/src/lib/infect.c:1537:9: branch_true: following ‘true’ branch...
criu-4.2/compel/src/lib/infect.c:1537:9: branch_true: ...to here
criu-4.2/compel/src/lib/infect.c:1537:9: danger: dereference of NULL ‘0’
# 1535|   void *compel_parasite_args_s(struct parasite_ctl *ctl, unsigned long args_size)
# 1536|   {
# 1537|-> 	BUG_ON(args_size > ctl->args_size);
# 1538|   	return compel_parasite_args_p(ctl);
# 1539|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def50]
criu-4.2/compel/src/lib/log-host.c:32:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
criu-4.2/compel/src/lib/log-host.c:25:6: enter_function: entry to ‘compel_print_on_level’
criu-4.2/compel/src/lib/log-host.c:30:12: branch_true: following ‘true’ branch (when ‘fn’ is non-NULL)...
criu-4.2/compel/src/lib/log-host.c:30:28: call_function: inlined call to ‘pr_quelled’ from ‘compel_print_on_level’
criu-4.2/compel/src/lib/log-host.c:31:17: branch_false: ...to here
criu-4.2/compel/src/lib/log-host.c:31:17: acquire_resource: ‘va_start’ called here
criu-4.2/compel/src/lib/log-host.c:32:17: throw: if the called function throws an exception...
criu-4.2/compel/src/lib/log-host.c:32:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   30|   	if (fn != NULL && !pr_quelled(loglevel)) {
#   31|   		va_start(params, format);
#   32|-> 		fn(loglevel, format, params);
#   33|   		va_end(params);
#   34|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def51]
criu-4.2/compel/src/lib/log.c:32:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
criu-4.2/compel/src/lib/log.c:25:6: enter_function: entry to ‘compel_print_on_level’
criu-4.2/compel/src/lib/log.c:30:12: branch_true: following ‘true’ branch (when ‘fn’ is non-NULL)...
criu-4.2/compel/src/lib/log.c:30:28: call_function: inlined call to ‘pr_quelled’ from ‘compel_print_on_level’
criu-4.2/compel/src/lib/log.c:31:17: branch_false: ...to here
criu-4.2/compel/src/lib/log.c:31:17: acquire_resource: ‘va_start’ called here
criu-4.2/compel/src/lib/log.c:32:17: throw: if the called function throws an exception...
criu-4.2/compel/src/lib/log.c:32:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   30|   	if (fn != NULL && !pr_quelled(loglevel)) {
#   31|   		va_start(params, format);
#   32|-> 		fn(loglevel, format, params);
#   33|   		va_end(params);
#   34|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
criu-4.2/compel/src/main-host.c:280:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
criu-4.2/compel/src/main-host.c:253:12: branch_false: following ‘false’ branch (when ‘len != 0’)...
criu-4.2/compel/src/main-host.c:258:18: branch_false: ...to here
criu-4.2/compel/src/main-host.c:267:12: branch_true: following ‘true’ branch (when ‘p1’ is NULL)...
criu-4.2/compel/src/main-host.c:267:12: branch_true: ...to here
criu-4.2/compel/src/main-host.c:269:12: branch_true: following ‘true’ branch (when ‘p2’ is NULL)...
criu-4.2/compel/src/main-host.c:270:17: branch_true: ...to here
criu-4.2/compel/src/main-host.c:273:12: branch_false: following ‘false’ branch (when ‘len != 0’)...
criu-4.2/compel/src/main-host.c:276:15: branch_false: ...to here
criu-4.2/compel/src/main-host.c:276:15: acquire_memory: this call could return NULL
criu-4.2/compel/src/main-host.c:280:23: danger: ‘p’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  278|   	// Now, check if we got a valid C identifier. We don't need to care
#  279|   	// about C reserved keywords, as this is only used as a prefix.
#  280|-> 	for (p = ret; *p != '\0'; p++) {
#  281|   		if (isalpha(*p))
#  282|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
criu-4.2/criu/action-scripts.c:152:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  150|   		break;
#  151|   	default:
#  152|-> 		BUG();
#  153|   	}
#  154|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
criu-4.2/criu/action-scripts.c:173:24: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/action-scripts.c:169:18: acquire_memory: allocated here
criu-4.2/criu/action-scripts.c:169:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/action-scripts.c:173:24: branch_false: ...to here
criu-4.2/criu/action-scripts.c:173:24: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/action-scripts.c:173:24: branch_true: ...to here
criu-4.2/criu/action-scripts.c:173:24: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/action-scripts.c:173:24: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  171|   		return -1;
#  172|   
#  173|-> 	script->path = xstrdup(path);
#  174|   	if (!script->path) {
#  175|   		xfree(script);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
criu-4.2/criu/action-scripts.c:195:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/action-scripts.c:187:14: acquire_resource: opened here
criu-4.2/criu/action-scripts.c:188:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
criu-4.2/criu/action-scripts.c:193:9: branch_false: ...to here
criu-4.2/criu/action-scripts.c:195:13: throw: if ‘install_service_fd’ throws an exception...
criu-4.2/criu/action-scripts.c:195:13: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  193|   	scripts_mode = SCRIPTS_RPC;
#  194|   
#  195|-> 	if (install_service_fd(RPC_SK_OFF, fd) < 0)
#  196|   		return -1;
#  197|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
criu-4.2/criu/aio.c:31:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/aio.c:23:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/aio.c:23:9: branch_false: ...to here
criu-4.2/criu/aio.c:24:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/aio.c:27:14: branch_false: ...to here
criu-4.2/criu/aio.c:27:14: acquire_memory: allocated here
criu-4.2/criu/aio.c:27:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/aio.c:31:9: branch_false: ...to here
criu-4.2/criu/aio.c:31:9: throw: if ‘aio_ring_entry__init’ throws an exception...
criu-4.2/criu/aio.c:31:9: danger: ‘___p’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#   29|   		return -1;
#   30|   
#   31|-> 	aio_ring_entry__init(re);
#   32|   	re->id = vma->e->start;
#   33|   	re->ring_len = vma->e->end - vma->e->start;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
criu-4.2/criu/apparmor.c:572:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 1)’
criu-4.2/criu/apparmor.c:623:5: enter_function: entry to ‘suspend_aa’
criu-4.2/criu/apparmor.c:626:12: branch_false: following ‘false’ branch...
criu-4.2/criu/apparmor.c:631:15: branch_false: ...to here
criu-4.2/criu/apparmor.c:631:15: call_function: calling ‘do_suspend’ from ‘suspend_aa’
#  570|   
#  571|   		if (suspend) {
#  572|-> 			pr_info("suspending policy %s\n", p->name);
#  573|   			data = get_suspend_policy(p->name, &len);
#  574|   			if (!data) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
criu-4.2/criu/apparmor.c:580:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 1)’
criu-4.2/criu/apparmor.c:638:5: enter_function: entry to ‘unsuspend_aa’
criu-4.2/criu/apparmor.c:640:16: call_function: calling ‘do_suspend’ from ‘unsuspend_aa’
#  578|   		}
#  579|   
#  580|-> 		n = write(fd, data, len);
#  581|   		close(fd);
#  582|   		if (suspend && munmap(data, len) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
criu-4.2/criu/apparmor.c:654:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/apparmor.c:648:12: branch_false: following ‘false’ branch...
criu-4.2/criu/apparmor.c:651:14: branch_false: ...to here
criu-4.2/criu/apparmor.c:651:14: acquire_memory: allocated here
criu-4.2/criu/apparmor.c:651:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/apparmor.c:654:9: branch_false: ...to here
criu-4.2/criu/apparmor.c:654:9: throw: if ‘apparmor_entry__init’ throws an exception...
criu-4.2/criu/apparmor.c:654:9: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  652|   	if (!ae)
#  653|   		return -1;
#  654|-> 	apparmor_entry__init(ae);
#  655|   
#  656|   	ae->n_namespaces = n_namespaces;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
criu-4.2/criu/arch/x86/cpu.c:321:13: warning[-Wanalyzer-malloc-leak]: leak of ‘img_to_cpuinfo(img_x86_entry)’
criu-4.2/criu/arch/x86/cpu.c:398:5: enter_function: entry to ‘cpu_validate_cpuinfo’
criu-4.2/criu/arch/x86/cpu.c:407:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/cpu.c:410:13: call_function: inlined call to ‘empty_image’ from ‘cpu_validate_cpuinfo’
criu-4.2/criu/arch/x86/cpu.c:416:13: branch_false: ...to here
criu-4.2/criu/arch/x86/cpu.c:416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/cpu.c:419:25: branch_false: ...to here
criu-4.2/criu/arch/x86/cpu.c:419:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/cpu.c:426:25: branch_false: ...to here
criu-4.2/criu/arch/x86/cpu.c:427:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/cpu.c:433:20: branch_false: ...to here
criu-4.2/criu/arch/x86/cpu.c:433:20: call_function: calling ‘img_to_cpuinfo’ from ‘cpu_validate_cpuinfo’
criu-4.2/criu/arch/x86/cpu.c:433:20: return_function: returning to ‘cpu_validate_cpuinfo’ from ‘img_to_cpuinfo’
criu-4.2/criu/arch/x86/cpu.c:434:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/cpu.c:435:23: branch_true: ...to here
criu-4.2/criu/arch/x86/cpu.c:435:23: call_function: calling ‘cpu_validate_features’ from ‘cpu_validate_cpuinfo’
#  319|   	BUILD_BUG_ON(ARRAY_SIZE(rt_cpu_info.x86_capability) != NCAPINTS);
#  320|   
#  321|-> 	if (img_x86_entry->vendor_id != CPUINFO_X86_ENTRY__VENDOR__INTEL &&
#  322|   	    img_x86_entry->vendor_id != CPUINFO_X86_ENTRY__VENDOR__AMD) {
#  323|   		pr_err("Image carries unknown vendor %u\n", (unsigned)img_x86_entry->vendor_id);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
criu-4.2/criu/arch/x86/crtools.c:107:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:94:12: branch_false: following ‘false’ branch (when ‘fpregs’ is non-NULL)...
criu-4.2/criu/arch/x86/crtools.c:97:9: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:107:9: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:107:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:107:9: danger: dereference of NULL ‘0’
#  105|   
#  106|   	/* Make sure we have enough space */
#  107|-> 	BUG_ON(core->thread_info->fpregs->n_st_space != ARRAY_SIZE(fpregs->i387.st_space));
#  108|   	BUG_ON(core->thread_info->fpregs->n_xmm_space != ARRAY_SIZE(fpregs->i387.xmm_space));
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def62]
criu-4.2/criu/arch/x86/crtools.c:108:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:94:12: branch_false: following ‘false’ branch (when ‘fpregs’ is non-NULL)...
criu-4.2/criu/arch/x86/crtools.c:97:9: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:107:9: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:108:9: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:108:9: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:108:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:108:9: danger: dereference of NULL ‘0’
#  106|   	/* Make sure we have enough space */
#  107|   	BUG_ON(core->thread_info->fpregs->n_st_space != ARRAY_SIZE(fpregs->i387.st_space));
#  108|-> 	BUG_ON(core->thread_info->fpregs->n_xmm_space != ARRAY_SIZE(fpregs->i387.xmm_space));
#  109|   
#  110|   	assign_array(core->thread_info->fpregs, fpregs->i387, st_space);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
criu-4.2/criu/arch/x86/crtools.c:512:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: danger: dereference of NULL ‘0’
#  510|   			 * inside memory layout (xstate_size calculation).
#  511|   			 */
#  512|-> 			assign_xsave(XFEATURE_YMM, xsave, ymmh_space, extended_state_area);
#  513|   			assign_xsave(XFEATURE_BNDREGS, xsave, bndreg_state, extended_state_area);
#  514|   			assign_xsave(XFEATURE_BNDCSR, xsave, bndcsr_state, extended_state_area);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
criu-4.2/criu/arch/x86/crtools.c:513:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:513:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:513:25: danger: dereference of NULL ‘0’
#  511|   			 */
#  512|   			assign_xsave(XFEATURE_YMM, xsave, ymmh_space, extended_state_area);
#  513|-> 			assign_xsave(XFEATURE_BNDREGS, xsave, bndreg_state, extended_state_area);
#  514|   			assign_xsave(XFEATURE_BNDCSR, xsave, bndcsr_state, extended_state_area);
#  515|   			assign_xsave(XFEATURE_OPMASK, xsave, opmask_reg, extended_state_area);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def65]
criu-4.2/criu/arch/x86/crtools.c:514:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:514:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:514:25: danger: dereference of NULL ‘0’
#  512|   			assign_xsave(XFEATURE_YMM, xsave, ymmh_space, extended_state_area);
#  513|   			assign_xsave(XFEATURE_BNDREGS, xsave, bndreg_state, extended_state_area);
#  514|-> 			assign_xsave(XFEATURE_BNDCSR, xsave, bndcsr_state, extended_state_area);
#  515|   			assign_xsave(XFEATURE_OPMASK, xsave, opmask_reg, extended_state_area);
#  516|   			assign_xsave(XFEATURE_ZMM_Hi256, xsave, zmm_upper, extended_state_area);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def66]
criu-4.2/criu/arch/x86/crtools.c:515:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:515:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:515:25: danger: dereference of NULL ‘0’
#  513|   			assign_xsave(XFEATURE_BNDREGS, xsave, bndreg_state, extended_state_area);
#  514|   			assign_xsave(XFEATURE_BNDCSR, xsave, bndcsr_state, extended_state_area);
#  515|-> 			assign_xsave(XFEATURE_OPMASK, xsave, opmask_reg, extended_state_area);
#  516|   			assign_xsave(XFEATURE_ZMM_Hi256, xsave, zmm_upper, extended_state_area);
#  517|   			assign_xsave(XFEATURE_Hi16_ZMM, xsave, hi16_zmm, extended_state_area);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
criu-4.2/criu/arch/x86/crtools.c:516:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:516:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:516:25: danger: dereference of NULL ‘0’
#  514|   			assign_xsave(XFEATURE_BNDCSR, xsave, bndcsr_state, extended_state_area);
#  515|   			assign_xsave(XFEATURE_OPMASK, xsave, opmask_reg, extended_state_area);
#  516|-> 			assign_xsave(XFEATURE_ZMM_Hi256, xsave, zmm_upper, extended_state_area);
#  517|   			assign_xsave(XFEATURE_Hi16_ZMM, xsave, hi16_zmm, extended_state_area);
#  518|   			assign_xsave(XFEATURE_PKRU, xsave, pkru, extended_state_area);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def68]
criu-4.2/criu/arch/x86/crtools.c:517:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:517:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:517:25: danger: dereference of NULL ‘0’
#  515|   			assign_xsave(XFEATURE_OPMASK, xsave, opmask_reg, extended_state_area);
#  516|   			assign_xsave(XFEATURE_ZMM_Hi256, xsave, zmm_upper, extended_state_area);
#  517|-> 			assign_xsave(XFEATURE_Hi16_ZMM, xsave, hi16_zmm, extended_state_area);
#  518|   			assign_xsave(XFEATURE_PKRU, xsave, pkru, extended_state_area);
#  519|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def69]
criu-4.2/criu/arch/x86/crtools.c:518:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/crtools.c:425:5: enter_function: entry to ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:427:22: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:428:34: call_function: inlined call to ‘core_is_compat’ from ‘restore_fpu’
criu-4.2/criu/arch/x86/crtools.c:428:30: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:436:12: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/crtools.c:441:14: branch_false: ...to here
criu-4.2/criu/arch/x86/crtools.c:441:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:444:9: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:491:12: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:503:21: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:503:20: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:512:25: branch_true: ...to here
criu-4.2/criu/arch/x86/crtools.c:518:25: branch_true: following ‘true’ branch...
criu-4.2/criu/arch/x86/crtools.c:518:25: danger: dereference of NULL ‘0’
#  516|   			assign_xsave(XFEATURE_ZMM_Hi256, xsave, zmm_upper, extended_state_area);
#  517|   			assign_xsave(XFEATURE_Hi16_ZMM, xsave, hi16_zmm, extended_state_area);
#  518|-> 			assign_xsave(XFEATURE_PKRU, xsave, pkru, extended_state_area);
#  519|   		}
#  520|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
criu-4.2/criu/arch/x86/shstk.c:107:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/shstk.c:107:9: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/shstk.c:107:9: branch_false: ...to here
criu-4.2/criu/arch/x86/shstk.c:107:9: danger: dereference of NULL ‘0’
#  105|   		return 0;
#  106|   
#  107|-> 	futex_wait_until(&rsti(item)->shstk_enable, 1);
#  108|   
#  109|   	if (ptrace(PTRACE_SEIZE, pid, 0, 0)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def71]
criu-4.2/criu/arch/x86/shstk.c:150:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/arch/x86/shstk.c:144:13: enter_function: entry to ‘shstk_sync_unlock’
criu-4.2/criu/arch/x86/shstk.c:147:9: call_function: calling ‘futex_set_and_wake’ from ‘shstk_sync_unlock’
criu-4.2/criu/arch/x86/shstk.c:147:9: return_function: returning to ‘shstk_sync_unlock’ from ‘futex_set_and_wake’
criu-4.2/criu/arch/x86/shstk.c:150:9: branch_false: following ‘false’ branch...
criu-4.2/criu/arch/x86/shstk.c:150:9: branch_false: ...to here
criu-4.2/criu/arch/x86/shstk.c:150:9: danger: dereference of NULL ‘0’
#  148|   
#  149|   	/* ... and wait until it unlocks its features with ptrace */
#  150|-> 	futex_wait_until(&rsti(item)->shstk_unlock, 1);
#  151|   }
#  152|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
criu-4.2/criu/autofs.c:170:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pgrp, 0, "fd"))’
criu-4.2/criu/autofs.c:164:15: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:164:15: branch_false: ...to here
criu-4.2/criu/autofs.c:164:15: acquire_memory: allocated here
criu-4.2/criu/autofs.c:164:15: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:168:9: branch_false: ...to here
criu-4.2/criu/autofs.c:170:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/autofs.c:170:22: danger: ‘fdopendir(do_open_proc(pgrp, 0, "fd"))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  168|   	*read_fd = -1;
#  169|   
#  170|-> 	while ((de = readdir(dir))) {
#  171|   		struct stat buf;
#  172|   		int found, mode, fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
criu-4.2/criu/autofs.c:341:13: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:336:15: acquire_memory: allocated here
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: throw: if ‘do_open_proc’ throws an exception...
criu-4.2/criu/autofs.c:341:13: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  339|   	}
#  340|   
#  341|-> 	f = fopen_proc(getpid(), "mountinfo");
#  342|   	if (!f)
#  343|   		goto free_str;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
criu-4.2/criu/autofs.c:355:39: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:336:15: acquire_memory: allocated here
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:345:16: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:346:21: branch_true: ...to here
criu-4.2/criu/autofs.c:353:24: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
criu-4.2/criu/autofs.c:354:29: branch_true: ...to here
criu-4.2/criu/autofs.c:354:28: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:355:39: branch_true: ...to here
criu-4.2/criu/autofs.c:355:39: throw: if ‘xatoi’ throws an exception...
criu-4.2/criu/autofs.c:355:39: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  353|   		while ((token = strsep(&str, " ")) != NULL) {
#  354|   			if (mnt_id == -1) {
#  355|-> 				ret = xatoi(token, &mnt_id);
#  356|   				if (ret)
#  357|   					goto close_proc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
criu-4.2/criu/autofs.c:355:39: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: acquire_memory: allocated here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:345:16: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:346:21: branch_true: ...to here
criu-4.2/criu/autofs.c:353:24: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
criu-4.2/criu/autofs.c:354:29: branch_true: ...to here
criu-4.2/criu/autofs.c:354:28: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:355:39: branch_true: ...to here
criu-4.2/criu/autofs.c:355:39: throw: if ‘xatoi’ throws an exception...
criu-4.2/criu/autofs.c:355:39: danger: ‘__f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  353|   		while ((token = strsep(&str, " ")) != NULL) {
#  354|   			if (mnt_id == -1) {
#  355|-> 				ret = xatoi(token, &mnt_id);
#  356|   				if (ret)
#  357|   					goto close_proc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
criu-4.2/criu/autofs.c:364:47: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:336:15: acquire_memory: allocated here
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:345:16: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:346:21: branch_true: ...to here
criu-4.2/criu/autofs.c:354:28: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:355:39: branch_true: ...to here
criu-4.2/criu/autofs.c:356:36: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:358:47: branch_false: ...to here
criu-4.2/criu/autofs.c:360:35: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:362:38: branch_true: ...to here
criu-4.2/criu/autofs.c:364:47: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:364:47: branch_true: ...to here
criu-4.2/criu/autofs.c:364:47: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:364:47: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  362|   				free(pm->options);
#  363|   
#  364|-> 				pm->options = xstrdup(token);
#  365|   				if (!pm->options)
#  366|   					pr_err("failed to duplicate string\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
criu-4.2/criu/autofs.c:364:47: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: acquire_memory: allocated here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:345:16: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:346:21: branch_true: ...to here
criu-4.2/criu/autofs.c:354:28: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:355:39: branch_true: ...to here
criu-4.2/criu/autofs.c:356:36: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:358:47: branch_false: ...to here
criu-4.2/criu/autofs.c:360:35: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:362:38: branch_true: ...to here
criu-4.2/criu/autofs.c:364:47: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:364:47: branch_true: ...to here
criu-4.2/criu/autofs.c:364:47: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:364:47: danger: ‘__f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  362|   				free(pm->options);
#  363|   
#  364|-> 				pm->options = xstrdup(token);
#  365|   				if (!pm->options)
#  366|   					pr_err("failed to duplicate string\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
criu-4.2/criu/autofs.c:366:41: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:336:15: acquire_memory: allocated here
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:345:16: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:346:21: branch_true: ...to here
criu-4.2/criu/autofs.c:354:28: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:355:39: branch_true: ...to here
criu-4.2/criu/autofs.c:356:36: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:358:47: branch_false: ...to here
criu-4.2/criu/autofs.c:360:35: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:362:38: branch_true: ...to here
criu-4.2/criu/autofs.c:364:47: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:364:47: branch_true: ...to here
criu-4.2/criu/autofs.c:365:36: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:366:41: branch_true: ...to here
criu-4.2/criu/autofs.c:366:41: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:366:41: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  364|   				pm->options = xstrdup(token);
#  365|   				if (!pm->options)
#  366|-> 					pr_err("failed to duplicate string\n");
#  367|   				else
#  368|   					ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
criu-4.2/criu/autofs.c:366:41: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: acquire_memory: allocated here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:345:16: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:346:21: branch_true: ...to here
criu-4.2/criu/autofs.c:354:28: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:355:39: branch_true: ...to here
criu-4.2/criu/autofs.c:356:36: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:358:47: branch_false: ...to here
criu-4.2/criu/autofs.c:360:35: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:362:38: branch_true: ...to here
criu-4.2/criu/autofs.c:364:47: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:364:47: branch_true: ...to here
criu-4.2/criu/autofs.c:365:36: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:366:41: branch_true: ...to here
criu-4.2/criu/autofs.c:366:41: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:366:41: danger: ‘__f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  364|   				pm->options = xstrdup(token);
#  365|   				if (!pm->options)
#  366|-> 					pr_err("failed to duplicate string\n");
#  367|   				else
#  368|   					ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
criu-4.2/criu/autofs.c:374:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:336:15: acquire_memory: allocated here
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:374:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:374:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  372|   	}
#  373|   
#  374|-> 	pr_err("failed to find autofs mount with mnt_id %d\n", pm->mnt_id);
#  375|   	ret = -ENOENT;
#  376|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
criu-4.2/criu/autofs.c:374:9: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/autofs.c:336:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:341:13: branch_false: ...to here
criu-4.2/criu/autofs.c:341:13: acquire_memory: allocated here
criu-4.2/criu/autofs.c:341:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:342:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/autofs.c:342:12: branch_false: ...to here
criu-4.2/criu/autofs.c:374:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:374:9: danger: ‘__f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  372|   	}
#  373|   
#  374|-> 	pr_err("failed to find autofs mount with mnt_id %d\n", pm->mnt_id);
#  375|   	ret = -ENOENT;
#  376|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
criu-4.2/criu/autofs.c:556:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:553:17: acquire_memory: allocated here
criu-4.2/criu/autofs.c:553:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:556:9: branch_false: ...to here
criu-4.2/criu/autofs.c:556:9: throw: if ‘autofs_entry__init’ throws an exception...
criu-4.2/criu/autofs.c:556:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  554|   	if (!entry)
#  555|   		return -1;
#  556|-> 	autofs_entry__init(entry);
#  557|   
#  558|   	err = autofs_create_entry(pm, entry);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def83]
criu-4.2/criu/autofs.c:631:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  629|   	err = ioctl(fd, cmd, param);
#  630|   	if (err)
#  631|-> 		pr_perror("%s ioctl failed", path);
#  632|   
#  633|   	return err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
criu-4.2/criu/autofs.c:631:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  629|   	err = ioctl(fd, cmd, param);
#  630|   	if (err)
#  631|-> 		pr_perror("%s ioctl failed", path);
#  632|   
#  633|   	return err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def85]
criu-4.2/criu/autofs.c:641:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  639|   	int fd, err;
#  640|   
#  641|-> 	fd = open(path, O_RDONLY);
#  642|   	if (fd == -1) {
#  643|   		pr_perror("failed to open %s", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
criu-4.2/criu/autofs.c:641:14: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:694:12: enter_function: entry to ‘autofs_mnt_open’
criu-4.2/criu/autofs.c:703:17: acquire_memory: allocated here
criu-4.2/criu/autofs.c:703:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:707:9: branch_false: ...to here
criu-4.2/criu/autofs.c:712:15: call_function: calling ‘autofs_dev_ioctl’ from ‘autofs_mnt_open’
#  639|   	int fd, err;
#  640|   
#  641|-> 	fd = open(path, O_RDONLY);
#  642|   	if (fd == -1) {
#  643|   		pr_perror("failed to open %s", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
criu-4.2/criu/autofs.c:643:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  641|   	fd = open(path, O_RDONLY);
#  642|   	if (fd == -1) {
#  643|-> 		pr_perror("failed to open %s", path);
#  644|   		return -1;
#  645|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
criu-4.2/criu/autofs.c:643:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:694:12: enter_function: entry to ‘autofs_mnt_open’
criu-4.2/criu/autofs.c:703:17: acquire_memory: allocated here
criu-4.2/criu/autofs.c:703:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:707:9: branch_false: ...to here
criu-4.2/criu/autofs.c:712:15: call_function: calling ‘autofs_dev_ioctl’ from ‘autofs_mnt_open’
#  641|   	fd = open(path, O_RDONLY);
#  642|   	if (fd == -1) {
#  643|-> 		pr_perror("failed to open %s", path);
#  644|   		return -1;
#  645|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def89]
criu-4.2/criu/autofs.c:649:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  647|   	err = autofs_ioctl(path, fd, cmd, param);
#  648|   
#  649|-> 	close(fd);
#  650|   	return err;
#  651|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
criu-4.2/criu/autofs.c:649:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  647|   	err = autofs_ioctl(path, fd, cmd, param);
#  648|   
#  649|-> 	close(fd);
#  650|   	return err;
#  651|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
criu-4.2/criu/autofs.c:700:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  698|   	size_t size, fd;
#  699|   
#  700|-> 	pr_info("%s: open mount %s\n", __func__, mnt_path);
#  701|   
#  702|   	size = sizeof(*param) + strlen(mnt_path) + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
criu-4.2/criu/autofs.c:700:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  698|   	size_t size, fd;
#  699|   
#  700|-> 	pr_info("%s: open mount %s\n", __func__, mnt_path);
#  701|   
#  702|   	size = sizeof(*param) + strlen(mnt_path) + 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def93]
criu-4.2/criu/autofs.c:703:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  701|   
#  702|   	size = sizeof(*param) + strlen(mnt_path) + 1;
#  703|-> 	param = xmalloc(size);
#  704|   	if (!param)
#  705|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
criu-4.2/criu/autofs.c:703:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  701|   
#  702|   	size = sizeof(*param) + strlen(mnt_path) + 1;
#  703|-> 	param = xmalloc(size);
#  704|   	if (!param)
#  705|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
criu-4.2/criu/autofs.c:729:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  727|   		char *path, *rel_path;
#  728|   
#  729|-> 		rel_path = get_relative_path(c->ns_mountpoint, mi->ns_mountpoint);
#  730|   		if (!rel_path) {
#  731|   			pr_err("Can't get path %s relative to %s\n", c->ns_mountpoint, mi->ns_mountpoint);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
criu-4.2/criu/autofs.c:729:28: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  727|   		char *path, *rel_path;
#  728|   
#  729|-> 		rel_path = get_relative_path(c->ns_mountpoint, mi->ns_mountpoint);
#  730|   		if (!rel_path) {
#  731|   			pr_err("Can't get path %s relative to %s\n", c->ns_mountpoint, mi->ns_mountpoint);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
criu-4.2/criu/autofs.c:731:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  729|   		rel_path = get_relative_path(c->ns_mountpoint, mi->ns_mountpoint);
#  730|   		if (!rel_path) {
#  731|-> 			pr_err("Can't get path %s relative to %s\n", c->ns_mountpoint, mi->ns_mountpoint);
#  732|   			return -1;
#  733|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
criu-4.2/criu/autofs.c:731:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  729|   		rel_path = get_relative_path(c->ns_mountpoint, mi->ns_mountpoint);
#  730|   		if (!rel_path) {
#  731|-> 			pr_err("Can't get path %s relative to %s\n", c->ns_mountpoint, mi->ns_mountpoint);
#  732|   			return -1;
#  733|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
criu-4.2/criu/autofs.c:739:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  737|   			continue;
#  738|   
#  739|-> 		path = xsprintf("%s/%s", mnt_path, rel_path);
#  740|   		if (!path)
#  741|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
criu-4.2/criu/autofs.c:739:24: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  737|   			continue;
#  738|   
#  739|-> 		path = xsprintf("%s/%s", mnt_path, rel_path);
#  740|   		if (!path)
#  741|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
criu-4.2/criu/autofs.c:743:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  741|   			return -1;
#  742|   		if (mkdir(path, 0555) < 0) {
#  743|-> 			pr_perror("Failed to create autofs dentry %s", path);
#  744|   			free(path);
#  745|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
criu-4.2/criu/autofs.c:743:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  741|   			return -1;
#  742|   		if (mkdir(path, 0555) < 0) {
#  743|-> 			pr_perror("Failed to create autofs dentry %s", path);
#  744|   			free(path);
#  745|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
criu-4.2/criu/autofs.c:757:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  755|   		return 0;
#  756|   
#  757|-> 	return autofs_create_dentries(mi, service_mountpoint(mi));
#  758|   }
#  759|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
criu-4.2/criu/autofs.c:757:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1058:15: call_function: calling ‘autofs_populate_mount’ from ‘autofs_mount’
#  755|   		return 0;
#  756|   
#  757|-> 	return autofs_create_dentries(mi, service_mountpoint(mi));
#  758|   }
#  759|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
criu-4.2/criu/autofs.c:764:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  762|   	int mnt_fd;
#  763|   
#  764|-> 	pr_info("%s: set timeout for %s and make it catatonic\n", __func__, mnt_path);
#  765|   
#  766|   	mnt_fd = autofs_mnt_open(mnt_path, mnt_dev);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
criu-4.2/criu/autofs.c:764:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1000:5: enter_function: entry to ‘autofs_mount’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:15: call_function: calling ‘autofs_post_mount’ from ‘autofs_mount’
#  762|   	int mnt_fd;
#  763|   
#  764|-> 	pr_info("%s: set timeout for %s and make it catatonic\n", __func__, mnt_path);
#  765|   
#  766|   	mnt_fd = autofs_mnt_open(mnt_path, mnt_dev);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def107]
criu-4.2/criu/autofs.c:949:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/autofs.c:949:9: branch_true: following ‘true’ branch (when ‘master’ is NULL)...
criu-4.2/criu/autofs.c:949:9: branch_true: ...to here
criu-4.2/criu/autofs.c:949:9: danger: dereference of NULL ‘0’
#  947|   	else
#  948|   		master = pstree_item_by_virt(entry->pgrp);
#  949|-> 	BUG_ON(!master);
#  950|   
#  951|   	ple = autofs_pipe_le(master, entry);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def108]
criu-4.2/criu/autofs.c:1022:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1022:16: throw: if ‘xsprintf’ throws an exception...
criu-4.2/criu/autofs.c:1022:16: danger: ‘control_pipe[0]’ leaks here
# 1020|   		mode = "offset";
# 1021|   
# 1022|-> 	opts = xsprintf("fd=%d,pgrp=%d,minproto=%d,maxproto=%d,%s", control_pipe[1], getpgrp(), entry->minproto,
# 1023|   			entry->maxproto, mode);
# 1024|   	if (opts && entry->has_uid)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
criu-4.2/criu/autofs.c:1022:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[1]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1022:16: throw: if ‘xsprintf’ throws an exception...
criu-4.2/criu/autofs.c:1022:16: danger: ‘control_pipe[1]’ leaks here
# 1020|   		mode = "offset";
# 1021|   
# 1022|-> 	opts = xsprintf("fd=%d,pgrp=%d,minproto=%d,maxproto=%d,%s", control_pipe[1], getpgrp(), entry->minproto,
# 1023|   			entry->maxproto, mode);
# 1024|   	if (opts && entry->has_uid)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
criu-4.2/criu/autofs.c:1025:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1025:24: throw: if ‘xstrcat’ throws an exception...
criu-4.2/criu/autofs.c:1025:24: danger: ‘control_pipe[0]’ leaks here
# 1023|   			entry->maxproto, mode);
# 1024|   	if (opts && entry->has_uid)
# 1025|-> 		opts = xstrcat(opts, ",uid=%d", entry->uid);
# 1026|   	if (opts && entry->has_gid)
# 1027|   		opts = xstrcat(opts, ",gid=%d", entry->gid);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def111]
criu-4.2/criu/autofs.c:1027:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1027:24: throw: if ‘xstrcat’ throws an exception...
criu-4.2/criu/autofs.c:1027:24: danger: ‘control_pipe[0]’ leaks here
# 1025|   		opts = xstrcat(opts, ",uid=%d", entry->uid);
# 1026|   	if (opts && entry->has_gid)
# 1027|-> 		opts = xstrcat(opts, ",gid=%d", entry->gid);
# 1028|   	if (!opts) {
# 1029|   		pr_err("Failed to create options string\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def112]
criu-4.2/criu/autofs.c:1029:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_true: following ‘true’ branch (when ‘opts’ is NULL)...
criu-4.2/criu/autofs.c:1029:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1029:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:1029:17: danger: ‘control_pipe[0]’ leaks here
# 1027|   		opts = xstrcat(opts, ",gid=%d", entry->gid);
# 1028|   	if (!opts) {
# 1029|-> 		pr_err("Failed to create options string\n");
# 1030|   		goto close_pipe;
# 1031|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def113]
criu-4.2/criu/autofs.c:1033:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1033:9: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1033:9: danger: ‘control_pipe[0]’ leaks here
# 1031|   	}
# 1032|   
# 1033|-> 	pr_info("autofs: mounting to %s with options: \"%s\"\n", service_mountpoint(mi), opts);
# 1034|   
# 1035|   	if (mount(source, service_mountpoint(mi), filesystemtype, mountflags, opts) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def114]
criu-4.2/criu/autofs.c:1035:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:27: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1035:27: danger: ‘control_pipe[0]’ leaks here
# 1033|   	pr_info("autofs: mounting to %s with options: \"%s\"\n", service_mountpoint(mi), opts);
# 1034|   
# 1035|-> 	if (mount(source, service_mountpoint(mi), filesystemtype, mountflags, opts) < 0) {
# 1036|   		pr_perror("Failed to mount autofs to %s", service_mountpoint(mi));
# 1037|   		goto free_opts;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
criu-4.2/criu/autofs.c:1036:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1036:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1036:17: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1036:17: danger: ‘control_pipe[0]’ leaks here
# 1034|   
# 1035|   	if (mount(source, service_mountpoint(mi), filesystemtype, mountflags, opts) < 0) {
# 1036|-> 		pr_perror("Failed to mount autofs to %s", service_mountpoint(mi));
# 1037|   		goto free_opts;
# 1038|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def116]
criu-4.2/criu/autofs.c:1040:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/autofs.c:1040:16: branch_true: ...to here
criu-4.2/criu/autofs.c:1040:16: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/autofs.c:1040:16: danger: ‘control_pipe[0]’ leaks here
# 1038|   	}
# 1039|   
# 1040|-> 	info = xmalloc(sizeof(*info));
# 1041|   	if (!info)
# 1042|   		goto umount;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
criu-4.2/criu/autofs.c:1051:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:18: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1051:18: danger: ‘control_pipe[0]’ leaks here
# 1049|   	 * shared data in autofs_add_mount_info().
# 1050|   	 */
# 1051|-> 	if (stat(service_mountpoint(mi), &buf) < 0) {
# 1052|   		pr_perror("Failed to stat %s", service_mountpoint(mi));
# 1053|   		goto free_info;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
criu-4.2/criu/autofs.c:1051:18: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:18: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1051:18: danger: ‘___p’ leaks here; was allocated at [(14)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/13)
# 1049|   	 * shared data in autofs_add_mount_info().
# 1050|   	 */
# 1051|-> 	if (stat(service_mountpoint(mi), &buf) < 0) {
# 1052|   		pr_perror("Failed to stat %s", service_mountpoint(mi));
# 1053|   		goto free_info;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def119]
criu-4.2/criu/autofs.c:1052:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1052:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1052:17: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1052:17: danger: ‘control_pipe[0]’ leaks here
# 1050|   	 */
# 1051|   	if (stat(service_mountpoint(mi), &buf) < 0) {
# 1052|-> 		pr_perror("Failed to stat %s", service_mountpoint(mi));
# 1053|   		goto free_info;
# 1054|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
criu-4.2/criu/autofs.c:1052:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1052:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1052:17: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1052:17: danger: ‘___p’ leaks here; was allocated at [(14)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/13)
# 1050|   	 */
# 1051|   	if (stat(service_mountpoint(mi), &buf) < 0) {
# 1052|-> 		pr_perror("Failed to stat %s", service_mountpoint(mi));
# 1053|   		goto free_info;
# 1054|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def121]
criu-4.2/criu/autofs.c:1063:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:33: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1063:33: danger: ‘control_pipe[0]’ leaks here
# 1061|   
# 1062|   	/* In case of catatonic mounts all we need as the function call below */
# 1063|-> 	ret = autofs_post_mount(service_mountpoint(mi), buf.st_dev, entry->timeout);
# 1064|   	if (ret < 0)
# 1065|   		goto free_info;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
criu-4.2/criu/autofs.c:1063:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1040:16: acquire_memory: allocated here
criu-4.2/criu/autofs.c:1040:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/autofs.c:1043:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1055:25: branch_false: ...to here
criu-4.2/criu/autofs.c:1059:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1063:74: branch_false: ...to here
criu-4.2/criu/autofs.c:1063:33: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1063:33: danger: ‘___p’ leaks here; was allocated at [(14)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/13)
# 1061|   
# 1062|   	/* In case of catatonic mounts all we need as the function call below */
# 1063|-> 	ret = autofs_post_mount(service_mountpoint(mi), buf.st_dev, entry->timeout);
# 1064|   	if (ret < 0)
# 1065|   		goto free_info;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def123]
criu-4.2/criu/autofs.c:1079:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_true: following ‘true’ branch (when ‘opts’ is NULL)...
criu-4.2/criu/autofs.c:1029:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1079:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/autofs.c:1079:9: danger: ‘control_pipe[0]’ leaks here
# 1077|   	free(opts);
# 1078|   close_pipe:
# 1079|-> 	close(control_pipe[1]);
# 1080|   	close(control_pipe[0]);
# 1081|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
criu-4.2/criu/autofs.c:1080:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_true: following ‘true’ branch (when ‘opts’ is NULL)...
criu-4.2/criu/autofs.c:1029:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1080:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/autofs.c:1080:9: danger: ‘control_pipe[0]’ leaks here
# 1078|   close_pipe:
# 1079|   	close(control_pipe[1]);
# 1080|-> 	close(control_pipe[0]);
# 1081|   	return ret;
# 1082|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
criu-4.2/criu/autofs.c:1086:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1086:20: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1086:20: danger: ‘control_pipe[0]’ leaks here
# 1084|   	free(info);
# 1085|   umount:
# 1086|-> 	if (umount(service_mountpoint(mi)) < 0)
# 1087|   		pr_perror("Failed to umount %s", service_mountpoint(mi));
# 1088|   	goto close_pipe;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
criu-4.2/criu/autofs.c:1087:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
criu-4.2/criu/autofs.c:1008:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1011:13: branch_false: ...to here
criu-4.2/criu/autofs.c:1011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1017:18: branch_false: ...to here
criu-4.2/criu/autofs.c:1024:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1024:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1026:12: branch_true: following ‘true’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1026:26: branch_true: ...to here
criu-4.2/criu/autofs.c:1028:12: branch_false: following ‘false’ branch (when ‘opts’ is non-NULL)...
criu-4.2/criu/autofs.c:1033:9: branch_false: ...to here
criu-4.2/criu/autofs.c:1035:12: branch_false: following ‘false’ branch...
criu-4.2/criu/autofs.c:1040:16: branch_false: ...to here
criu-4.2/criu/autofs.c:1086:12: branch_true: following ‘true’ branch...
criu-4.2/criu/autofs.c:1087:17: branch_true: ...to here
criu-4.2/criu/autofs.c:1087:17: throw: if ‘service_mountpoint’ throws an exception...
criu-4.2/criu/autofs.c:1087:17: danger: ‘control_pipe[0]’ leaks here
# 1085|   umount:
# 1086|   	if (umount(service_mountpoint(mi)) < 0)
# 1087|-> 		pr_perror("Failed to umount %s", service_mountpoint(mi));
# 1088|   	goto close_pipe;
# 1089|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
criu-4.2/criu/bfd.c:330:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/bfd.c:310:12: branch_false: following ‘false’ branch...
criu-4.2/criu/bfd.c:310:12: branch_false: ...to here
criu-4.2/criu/bfd.c:313:16: branch_true: following ‘true’ branch (when ‘more == 1’)...
criu-4.2/criu/bfd.c:316:17: branch_true: ...to here
criu-4.2/criu/bfd.c:327:20: branch_false: following ‘false’ branch (when ‘filled >= size’)...
criu-4.2/criu/bfd.c:330:25: branch_false: ...to here
criu-4.2/criu/bfd.c:330:25: branch_true: following ‘true’ branch (when ‘filled > size’)...
criu-4.2/criu/bfd.c:330:25: branch_true: ...to here
criu-4.2/criu/bfd.c:330:25: danger: dereference of NULL ‘0’
#  328|   			more = brefill(bfd);
#  329|   		else {
#  330|-> 			BUG_ON(filled > size);
#  331|   			more = 0;
#  332|   		}

Error: CPPCHECK_WARNING (CWE-476): [#def128]
criu-4.2/criu/cgroup-props.c:129: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  127|   			break;
#  128|   		} else
#  129|-> 			BUG();
#  130|   	}
#  131|   

Error: CPPCHECK_WARNING (CWE-682): [#def129]
criu-4.2/criu/cgroup-props.c:206: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  204|   {
#  205|   	char *p = skip_ws ? skip_spaces(stream, len) : (stream ? *stream : NULL);
#  206|-> 	char *from = p + 1;
#  207|   	char *dst;
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
criu-4.2/criu/cgroup-props.c:209:19: warning[-Wanalyzer-malloc-leak]: leak of ‘get_quoted(&stream, & len, 0)’
criu-4.2/criu/cgroup-props.c:498:5: enter_function: entry to ‘cgp_init’
criu-4.2/criu/cgroup-props.c:502:15: call_function: inlined call to ‘cgp_parse_builtins’ from ‘cgp_init’
#  207|   	char *dst;
#  208|   
#  209|-> 	if (!p || *p != '\"')
#  210|   		return NULL;
#  211|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
criu-4.2/criu/cgroup.c:493:37: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cgroup.c:483:23: acquire_memory: allocated here
criu-4.2/criu/cgroup.c:483:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:487:29: branch_false: ...to here
criu-4.2/criu/cgroup.c:492:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cgroup.c:493:37: branch_true: ...to here
criu-4.2/criu/cgroup.c:493:37: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/cgroup.c:493:37: branch_true: ...to here
criu-4.2/criu/cgroup.c:493:37: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cgroup.c:493:37: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  491|   		/* chop off the first "/proc/self/fd/N" str */
#  492|   		if (fpath[path_pref_len] == '\0')
#  493|-> 			ncd->path = xstrdup("/");
#  494|   		else
#  495|   			ncd->path = xstrdup(fpath + path_pref_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
criu-4.2/criu/cgroup.c:495:37: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cgroup.c:483:23: acquire_memory: allocated here
criu-4.2/criu/cgroup.c:483:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:487:29: branch_false: ...to here
criu-4.2/criu/cgroup.c:492:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:495:37: branch_false: ...to here
criu-4.2/criu/cgroup.c:495:37: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/cgroup.c:495:37: branch_true: ...to here
criu-4.2/criu/cgroup.c:495:37: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cgroup.c:495:37: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  493|   			ncd->path = xstrdup("/");
#  494|   		else
#  495|-> 			ncd->path = xstrdup(fpath + path_pref_len);
#  496|   
#  497|   		if (!ncd->path)

Error: GCC_ANALYZER_WARNING (CWE-124): [#def133]
criu-4.2/criu/cgroup.c:1087:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite
criu-4.2/criu/cgroup.c:1660:5: enter_function: entry to ‘prepare_cgroup_properties’
criu-4.2/criu/cgroup.c:1665:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cgroup.c:1666:51: branch_true: ...to here
criu-4.2/criu/cgroup.c:1668:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1673:23: branch_false: ...to here
criu-4.2/criu/cgroup.c:1673:23: call_function: calling ‘ctrl_dir_and_opt’ from ‘prepare_cgroup_properties’
# 1085|   
# 1086|   	/* Chop the trailing ','-s */
# 1087|-> 	dir[--doff] = '\0';
# 1088|   	if (opt)
# 1089|   		opt[ooff - 1] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-124): [#def134]
criu-4.2/criu/cgroup.c:1089:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite
criu-4.2/criu/cgroup.c:1865:12: enter_function: entry to ‘prepare_cgroup_sfd’
criu-4.2/criu/cgroup.c:1870:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1873:9: branch_false: ...to here
criu-4.2/criu/cgroup.c:1878:27: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:1878:17: branch_false: ...to here
criu-4.2/criu/cgroup.c:1879:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:1898:9: branch_false: ...to here
criu-4.2/criu/cgroup.c:1900:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1905:15: branch_false: ...to here
criu-4.2/criu/cgroup.c:1906:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1909:14: branch_false: ...to here
criu-4.2/criu/cgroup.c:1911:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cgroup.c:1914:43: branch_true: ...to here
criu-4.2/criu/cgroup.c:1916:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1921:67: branch_false: ...to here
criu-4.2/criu/cgroup.c:1921:28: call_function: calling ‘ctrl_dir_and_opt’ from ‘prepare_cgroup_sfd’
# 1087|   	dir[--doff] = '\0';
# 1088|   	if (opt)
# 1089|-> 		opt[ooff - 1] = '\0';
# 1090|   
# 1091|   	return doff;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def135]
criu-4.2/criu/cgroup.c:1520:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cgroup.c:1660:5: enter_function: entry to ‘prepare_cgroup_properties’
criu-4.2/criu/cgroup.c:1665:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cgroup.c:1666:51: branch_true: ...to here
criu-4.2/criu/cgroup.c:1668:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1673:23: branch_false: ...to here
criu-4.2/criu/cgroup.c:1673:23: call_function: calling ‘ctrl_dir_and_opt’ from ‘prepare_cgroup_properties’
criu-4.2/criu/cgroup.c:1673:23: return_function: returning to ‘prepare_cgroup_properties’ from ‘ctrl_dir_and_opt’
criu-4.2/criu/cgroup.c:1674:21: call_function: calling ‘prepare_cgroup_dir_properties’ from ‘prepare_cgroup_properties’
# 1518|   static void add_freezer_state_for_restore(CgroupPropEntry *entry, char *path, size_t path_len)
# 1519|   {
# 1520|-> 	BUG_ON(path_len >= sizeof(freezer_path));
# 1521|   
# 1522|   	if (freezer_state_entry) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def136]
criu-4.2/criu/cgroup.c:1596:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘___p’
criu-4.2/criu/cgroup.c:1660:5: enter_function: entry to ‘prepare_cgroup_properties’
criu-4.2/criu/cgroup.c:1665:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cgroup.c:1666:51: branch_true: ...to here
criu-4.2/criu/cgroup.c:1668:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1673:23: branch_false: ...to here
criu-4.2/criu/cgroup.c:1673:23: call_function: calling ‘ctrl_dir_and_opt’ from ‘prepare_cgroup_properties’
criu-4.2/criu/cgroup.c:1673:23: return_function: returning to ‘prepare_cgroup_properties’ from ‘ctrl_dir_and_opt’
criu-4.2/criu/cgroup.c:1674:21: call_function: calling ‘prepare_cgroup_dir_properties’ from ‘prepare_cgroup_properties’
# 1594|   
# 1595|   	priomap.value = xmalloc(strlen(cpe->value) + 1);
# 1596|-> 	priomap.value[0] = '\0';
# 1597|   
# 1598|   	if (filter_ifpriomap(priomap.value, cpe->value))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def137]
criu-4.2/criu/cgroup.c:1905:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cg_yard, 65536)’
criu-4.2/criu/cgroup.c:1870:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1873:9: branch_false: ...to here
criu-4.2/criu/cgroup.c:1878:27: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:1878:17: branch_false: ...to here
criu-4.2/criu/cgroup.c:1879:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:1898:9: branch_false: ...to here
criu-4.2/criu/cgroup.c:1899:13: acquire_resource: opened here
criu-4.2/criu/cgroup.c:1900:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cgroup.c:1905:15: branch_false: ...to here
criu-4.2/criu/cgroup.c:1905:15: danger: ‘open(cg_yard, 65536)’ leaks here; was opened at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
# 1903|   	}
# 1904|   
# 1905|-> 	ret = install_service_fd(CGROUP_YARD, i);
# 1906|   	if (ret < 0)
# 1907|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
criu-4.2/criu/cgroup.c:2293:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cgroup.c:2284:12: branch_false: following ‘false’ branch (when ‘controller’ is non-NULL)...
criu-4.2/criu/cgroup.c:2289:13: branch_false: ...to here
criu-4.2/criu/cgroup.c:2289:13: acquire_memory: allocated here
criu-4.2/criu/cgroup.c:2289:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:2293:25: branch_false: ...to here
criu-4.2/criu/cgroup.c:2293:25: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/cgroup.c:2293:25: branch_true: ...to here
criu-4.2/criu/cgroup.c:2293:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cgroup.c:2293:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 2291|   		return -1;
# 2292|   
# 2293|-> 	o->controller = xstrdup(controller);
# 2294|   	if (!o->controller)
# 2295|   		goto err_ctrl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
criu-4.2/criu/cgroup.c:2296:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cgroup.c:2284:12: branch_false: following ‘false’ branch (when ‘controller’ is non-NULL)...
criu-4.2/criu/cgroup.c:2289:13: branch_false: ...to here
criu-4.2/criu/cgroup.c:2289:13: acquire_memory: allocated here
criu-4.2/criu/cgroup.c:2289:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:2293:25: branch_false: ...to here
criu-4.2/criu/cgroup.c:2293:25: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:2293:9: branch_false: ...to here
criu-4.2/criu/cgroup.c:2294:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cgroup.c:2296:22: branch_false: ...to here
criu-4.2/criu/cgroup.c:2296:22: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/cgroup.c:2296:22: branch_true: ...to here
criu-4.2/criu/cgroup.c:2296:22: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cgroup.c:2296:22: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 2294|   	if (!o->controller)
# 2295|   		goto err_ctrl;
# 2296|-> 	o->newroot = xstrdup(newroot);
# 2297|   	if (!o->newroot)
# 2298|   		goto err_newroot;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def140]
criu-4.2/criu/clone-noasan.c:41:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/clone-noasan.c:41:9: branch_true: following ‘true’ branch...
criu-4.2/criu/clone-noasan.c:41:9: danger: dereference of NULL ‘0’
#   39|   	void *stack_ptr = (void *)round_down((unsigned long)&stack_ptr - 1024, 16);
#   40|   
#   41|-> 	BUG_ON((flags & CLONE_VM) && !(flags & CLONE_VFORK));
#   42|   	/*
#   43|   	 * Reserve some bytes for clone() internal needs

Error: GCC_ANALYZER_WARNING (CWE-476): [#def141]
criu-4.2/criu/clone-noasan.c:53:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/clone-noasan.c:53:9: branch_true: following ‘true’ branch...
criu-4.2/criu/clone-noasan.c:53:9: branch_true: ...to here
criu-4.2/criu/clone-noasan.c:53:9: danger: dereference of NULL ‘0’
#   51|   	struct _clone_args c_args = {};
#   52|   
#   53|-> 	BUG_ON(flags & CLONE_VM);
#   54|   
#   55|   	/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def142]
criu-4.2/criu/clone-noasan.c:59:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/clone-noasan.c:53:9: branch_false: following ‘false’ branch...
criu-4.2/criu/clone-noasan.c:59:9: branch_false: ...to here
criu-4.2/criu/clone-noasan.c:59:9: branch_true: following ‘true’ branch...
criu-4.2/criu/clone-noasan.c:59:9: branch_true: ...to here
criu-4.2/criu/clone-noasan.c:59:9: danger: dereference of NULL ‘0’
#   57|   	 * exit_signal for that.
#   58|   	 */
#   59|-> 	BUG_ON(flags & 0xff);
#   60|   
#   61|   	pr_debug("Creating process using clone3()\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def143]
criu-4.2/criu/config.c:267:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filepath, "r")’
criu-4.2/criu/config.c:604:5: enter_function: entry to ‘parse_options’
criu-4.2/criu/config.c:718:12: branch_false: following ‘false’ branch...
criu-4.2/criu/config.c:718:12: branch_false: ...to here
criu-4.2/criu/config.c:724:20: branch_true: following ‘true’ branch (when ‘opt == -1’)...
criu-4.2/criu/config.c:726:28: branch_true: ...to here
criu-4.2/criu/config.c:737:33: call_function: calling ‘next_config’ from ‘parse_options’
#  265|   		return NULL;
#  266|   
#  267|-> 	pr_debug("Parsing config file %s\n", filepath);
#  268|   
#  269|   	configuration = xmalloc(config_size * sizeof(char *));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
criu-4.2/criu/config.c:267:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filepath, "r")’
criu-4.2/criu/config.c:604:5: enter_function: entry to ‘parse_options’
criu-4.2/criu/config.c:718:12: branch_false: following ‘false’ branch...
criu-4.2/criu/config.c:718:12: branch_false: ...to here
criu-4.2/criu/config.c:724:20: branch_true: following ‘true’ branch (when ‘opt == -1’)...
criu-4.2/criu/config.c:726:28: branch_true: ...to here
criu-4.2/criu/config.c:737:33: call_function: calling ‘next_config’ from ‘parse_options’
#  265|   		return NULL;
#  266|   
#  267|-> 	pr_debug("Parsing config file %s\n", filepath);
#  268|   
#  269|   	configuration = xmalloc(config_size * sizeof(char *));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def145]
criu-4.2/criu/config.c:269:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filepath, "r")’
criu-4.2/criu/config.c:604:5: enter_function: entry to ‘parse_options’
criu-4.2/criu/config.c:718:12: branch_false: following ‘false’ branch...
criu-4.2/criu/config.c:718:12: branch_false: ...to here
criu-4.2/criu/config.c:724:20: branch_true: following ‘true’ branch (when ‘opt == -1’)...
criu-4.2/criu/config.c:726:28: branch_true: ...to here
criu-4.2/criu/config.c:737:33: call_function: calling ‘next_config’ from ‘parse_options’
#  267|   	pr_debug("Parsing config file %s\n", filepath);
#  268|   
#  269|-> 	configuration = xmalloc(config_size * sizeof(char *));
#  270|   	if (configuration == NULL) {
#  271|   		fclose(configfile);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
criu-4.2/criu/config.c:269:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filepath, "r")’
criu-4.2/criu/config.c:604:5: enter_function: entry to ‘parse_options’
criu-4.2/criu/config.c:718:12: branch_false: following ‘false’ branch...
criu-4.2/criu/config.c:718:12: branch_false: ...to here
criu-4.2/criu/config.c:724:20: branch_true: following ‘true’ branch (when ‘opt == -1’)...
criu-4.2/criu/config.c:726:28: branch_true: ...to here
criu-4.2/criu/config.c:737:33: call_function: calling ‘next_config’ from ‘parse_options’
#  267|   	pr_debug("Parsing config file %s\n", filepath);
#  268|   
#  269|-> 	configuration = xmalloc(config_size * sizeof(char *));
#  270|   	if (configuration == NULL) {
#  271|   		fclose(configfile);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def147]
criu-4.2/criu/cr-check.c:97:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘slave’
criu-4.2/criu/cr-check.c:79:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:84:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:84:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:89:21: branch_false: ...to here
criu-4.2/criu/cr-check.c:90:17: acquire_resource: opened here
criu-4.2/criu/cr-check.c:91:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:97:17: branch_false: ...to here
criu-4.2/criu/cr-check.c:97:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:97:17: danger: ‘slave’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   95|   		}
#   96|   	} else {
#   97|-> 		pr_err("Managed to open locked pty.\n");
#   98|   		goto out;
#   99|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def148]
criu-4.2/criu/cr-check.c:103:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘slave’
criu-4.2/criu/cr-check.c:79:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:84:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:84:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:89:21: branch_false: ...to here
criu-4.2/criu/cr-check.c:90:17: acquire_resource: opened here
criu-4.2/criu/cr-check.c:91:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:97:17: branch_false: ...to here
criu-4.2/criu/cr-check.c:103:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/cr-check.c:103:9: danger: ‘slave’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  101|   	ret = 0;
#  102|   out:
#  103|-> 	close_safe(&master);
#  104|   	close_safe(&slave);
#  105|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def149]
criu-4.2/criu/cr-check.c:104:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘slave’
criu-4.2/criu/cr-check.c:79:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:84:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:84:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:89:21: branch_false: ...to here
criu-4.2/criu/cr-check.c:90:17: acquire_resource: opened here
criu-4.2/criu/cr-check.c:91:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:97:17: branch_false: ...to here
criu-4.2/criu/cr-check.c:104:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/cr-check.c:104:9: danger: ‘slave’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  102|   out:
#  103|   	close_safe(&master);
#  104|-> 	close_safe(&slave);
#  105|   	return ret;
#  106|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def150]
criu-4.2/criu/cr-check.c:141:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ns.<Ue820>.net.nlsk’
criu-4.2/criu/cr-check.c:135:23: acquire_resource: socket created here
criu-4.2/criu/cr-check.c:136:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:141:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:141:15: throw: if ‘collect_sockets’ throws an exception...
criu-4.2/criu/cr-check.c:141:15: danger: ‘ns.<Ue820>.net.nlsk’ leaks here
#  139|   	}
#  140|   
#  141|-> 	ret = collect_sockets(&ns);
#  142|   	if (!ret)
#  143|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def151]
criu-4.2/criu/cr-check.c:373:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_true: following ‘true’ branch (when ‘efd < 0’)...
criu-4.2/criu/cr-check.c:373:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:373:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:373:17: danger: ‘pfd[0]’ leaks here
#  371|   	efd = epoll_create(1);
#  372|   	if (efd < 0) {
#  373|-> 		pr_perror("Can't make epoll fd");
#  374|   		goto pipe_err;
#  375|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def152]
criu-4.2/criu/cr-check.c:373:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_true: following ‘true’ branch (when ‘efd < 0’)...
criu-4.2/criu/cr-check.c:373:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:373:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:373:17: danger: ‘pfd[1]’ leaks here
#  371|   	efd = epoll_create(1);
#  372|   	if (efd < 0) {
#  373|-> 		pr_perror("Can't make epoll fd");
#  374|   		goto pipe_err;
#  375|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def153]
criu-4.2/criu/cr-check.c:381:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/cr-check.c:377:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:380:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:381:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:381:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:381:17: danger: ‘pfd[1]’ leaks here
#  379|   
#  380|   	if (epoll_ctl(efd, EPOLL_CTL_ADD, pfd[0], &ev)) {
#  381|-> 		pr_perror("Can't add epoll tfd");
#  382|   		goto epoll_err;
#  383|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def154]
criu-4.2/criu/cr-check.c:385:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/cr-check.c:377:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:380:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:385:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:385:15: throw: if ‘parse_fdinfo’ throws an exception...
criu-4.2/criu/cr-check.c:385:15: danger: ‘pfd[1]’ leaks here
#  383|   	}
#  384|   
#  385|-> 	ret = parse_fdinfo(efd, FD_TYPES__EVENTPOLL, &efe);
#  386|   	if (ret) {
#  387|   		pr_err("Error parsing proc fdinfo\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def155]
criu-4.2/criu/cr-check.c:387:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/cr-check.c:377:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:380:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:385:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:386:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:387:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:387:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:387:17: danger: ‘pfd[1]’ leaks here
#  385|   	ret = parse_fdinfo(efd, FD_TYPES__EVENTPOLL, &efe);
#  386|   	if (ret) {
#  387|-> 		pr_err("Error parsing proc fdinfo\n");
#  388|   		goto epoll_err;
#  389|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def156]
criu-4.2/criu/cr-check.c:392:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/cr-check.c:377:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:380:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:385:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:386:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:391:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:392:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:392:17: danger: ‘pfd[1]’ leaks here
#  390|   
#  391|   	if (efe.n_tfd != 1 || efe.tfd[0]->tfd != pfd[0]) {
#  392|-> 		pr_err("TFD mismatch (or not met)\n");
#  393|   		ret = -1;
#  394|   		goto epoll_err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def157]
criu-4.2/criu/cr-check.c:397:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/cr-check.c:377:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:380:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:385:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:386:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:391:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:391:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:397:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:397:9: danger: ‘pfd[1]’ leaks here
#  395|   	}
#  396|   
#  397|-> 	pr_info("Epoll fdinfo works OK\n");
#  398|   
#  399|   epoll_err:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def158]
criu-4.2/criu/cr-check.c:400:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/cr-check.c:377:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:380:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:385:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:400:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:400:9: danger: ‘pfd[1]’ leaks here
#  398|   
#  399|   epoll_err:
#  400|-> 	close(efd);
#  401|   pipe_err:
#  402|   	close(pfd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def159]
criu-4.2/criu/cr-check.c:402:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_true: following ‘true’ branch (when ‘efd < 0’)...
criu-4.2/criu/cr-check.c:373:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:402:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:402:9: danger: ‘pfd[0]’ leaks here
#  400|   	close(efd);
#  401|   pipe_err:
#  402|-> 	close(pfd[0]);
#  403|   	close(pfd[1]);
#  404|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def160]
criu-4.2/criu/cr-check.c:402:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_true: following ‘true’ branch (when ‘efd < 0’)...
criu-4.2/criu/cr-check.c:373:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:402:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:402:9: danger: ‘pfd[1]’ leaks here
#  400|   	close(efd);
#  401|   pipe_err:
#  402|-> 	close(pfd[0]);
#  403|   	close(pfd[1]);
#  404|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def161]
criu-4.2/criu/cr-check.c:403:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:366:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:371:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:372:12: branch_true: following ‘true’ branch (when ‘efd < 0’)...
criu-4.2/criu/cr-check.c:373:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:403:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:403:9: danger: ‘pfd[1]’ leaks here
#  401|   pipe_err:
#  402|   	close(pfd[0]);
#  403|-> 	close(pfd[1]);
#  404|   
#  405|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def162]
criu-4.2/criu/cr-check.c:468:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[0]’
criu-4.2/criu/cr-check.c:462:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:466:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:468:15: throw: if ‘vmsplice’ throws an exception...
criu-4.2/criu/cr-check.c:468:15: danger: ‘p[0]’ leaks here
#  466|   	iov.iov_base = &buf;
#  467|   	iov.iov_len = sizeof(buf);
#  468|-> 	ret = vmsplice(p[1], &iov, 1, SPLICE_F_GIFT | SPLICE_F_NONBLOCK);
#  469|   	if (ret < 0) {
#  470|   		pr_perror("Unaligned vmsplice doesn't work");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def163]
criu-4.2/criu/cr-check.c:468:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[1]’
criu-4.2/criu/cr-check.c:462:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:466:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:468:15: throw: if ‘vmsplice’ throws an exception...
criu-4.2/criu/cr-check.c:468:15: danger: ‘p[1]’ leaks here
#  466|   	iov.iov_base = &buf;
#  467|   	iov.iov_len = sizeof(buf);
#  468|-> 	ret = vmsplice(p[1], &iov, 1, SPLICE_F_GIFT | SPLICE_F_NONBLOCK);
#  469|   	if (ret < 0) {
#  470|   		pr_perror("Unaligned vmsplice doesn't work");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def164]
criu-4.2/criu/cr-check.c:470:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[0]’
criu-4.2/criu/cr-check.c:462:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:466:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:469:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/cr-check.c:470:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:470:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:470:17: danger: ‘p[0]’ leaks here
#  468|   	ret = vmsplice(p[1], &iov, 1, SPLICE_F_GIFT | SPLICE_F_NONBLOCK);
#  469|   	if (ret < 0) {
#  470|-> 		pr_perror("Unaligned vmsplice doesn't work");
#  471|   		goto err;
#  472|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def165]
criu-4.2/criu/cr-check.c:474:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[0]’
criu-4.2/criu/cr-check.c:462:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:466:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:469:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:474:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:474:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:474:9: danger: ‘p[0]’ leaks here
#  472|   	}
#  473|   
#  474|-> 	pr_info("Unaligned vmsplice works OK\n");
#  475|   	ret = 0;
#  476|   err:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def166]
criu-4.2/criu/cr-check.c:477:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[0]’
criu-4.2/criu/cr-check.c:462:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:466:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:469:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/cr-check.c:470:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:477:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:477:9: danger: ‘p[0]’ leaks here
#  475|   	ret = 0;
#  476|   err:
#  477|-> 	close(p[0]);
#  478|   	close(p[1]);
#  479|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def167]
criu-4.2/criu/cr-check.c:477:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[ret]’
criu-4.2/criu/cr-check.c:462:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:466:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:469:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-check.c:474:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:477:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:477:9: danger: ‘p[ret]’ leaks here
#  475|   	ret = 0;
#  476|   err:
#  477|-> 	close(p[0]);
#  478|   	close(p[1]);
#  479|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
criu-4.2/criu/cr-check.c:613:33: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/cr-check.c:593:16: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:593:16: branch_false: ...to here
criu-4.2/criu/cr-check.c:593:16: acquire_memory: allocated here
criu-4.2/criu/cr-check.c:593:16: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/cr-check.c:594:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:594:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/cr-check.c:594:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:597:16: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:602:21: branch_true: ...to here
criu-4.2/criu/cr-check.c:603:20: branch_false: following ‘false’ branch (when ‘r == 2’)...
criu-4.2/criu/cr-check.c:603:20: branch_false: ...to here
criu-4.2/criu/cr-check.c:613:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:613:33: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  611|   				continue;
#  612|   			if (vmas[i].addr != MAP_FAILED) {
#  613|-> 				pr_err("Special mapping meet twice: %s\n", vmas[i].name);
#  614|   				ret = -1;
#  615|   				goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def169]
criu-4.2/criu/cr-check.c:958:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1000:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1001:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
criu-4.2/criu/cr-check.c:1006:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:1006:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1011:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1011:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
#  956|   	int ret = -ENOENT;
#  957|   
#  958|-> 	f = fopen_proc(PROC_SELF, "mountinfo");
#  959|   	if (!f)
#  960|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def170]
criu-4.2/criu/cr-check.c:967:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1000:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1001:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
criu-4.2/criu/cr-check.c:1006:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:1006:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1011:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1011:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
#  965|   				ret = 0;
#  966|   			else {
#  967|-> 				pr_err("autofs not supported.\n");
#  968|   				ret = -ENOTSUP;
#  969|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
criu-4.2/criu/cr-check.c:967:33: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/cr-check.c:958:13: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:958:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:958:13: acquire_memory: allocated here
criu-4.2/criu/cr-check.c:958:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/cr-check.c:959:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:959:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/cr-check.c:959:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:962:16: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:963:21: branch_true: ...to here
criu-4.2/criu/cr-check.c:963:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:964:29: branch_true: ...to here
criu-4.2/criu/cr-check.c:964:28: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:967:33: branch_false: ...to here
criu-4.2/criu/cr-check.c:967:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:967:33: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
#  965|   				ret = 0;
#  966|   			else {
#  967|-> 				pr_err("autofs not supported.\n");
#  968|   				ret = -ENOTSUP;
#  969|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def172]
criu-4.2/criu/cr-check.c:994:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:994:19: throw: if ‘xsprintf’ throws an exception...
criu-4.2/criu/cr-check.c:994:19: danger: ‘pfd[0]’ leaks here
#  992|   	ret = -1;
#  993|   
#  994|-> 	options = xsprintf("fd=%d,pgrp=%d,minproto=5,maxproto=5,direct", pfd[1], getpgrp());
#  995|   	if (!options) {
#  996|   		pr_err("failed to allocate autofs options\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
criu-4.2/criu/cr-check.c:994:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:994:19: throw: if ‘xsprintf’ throws an exception...
criu-4.2/criu/cr-check.c:994:19: danger: ‘pfd[1]’ leaks here
#  992|   	ret = -1;
#  993|   
#  994|-> 	options = xsprintf("fd=%d,pgrp=%d,minproto=5,maxproto=5,direct", pfd[1], getpgrp());
#  995|   	if (!options) {
#  996|   		pr_err("failed to allocate autofs options\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def174]
criu-4.2/criu/cr-check.c:996:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:996:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:996:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:996:17: danger: ‘pfd[0]’ leaks here
#  994|   	options = xsprintf("fd=%d,pgrp=%d,minproto=5,maxproto=5,direct", pfd[1], getpgrp());
#  995|   	if (!options) {
#  996|-> 		pr_err("failed to allocate autofs options\n");
#  997|   		goto close_pipe;
#  998|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def175]
criu-4.2/criu/cr-check.c:1002:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1000:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1001:12: branch_true: following ‘true’ branch (when ‘dir’ is NULL)...
criu-4.2/criu/cr-check.c:1002:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:1002:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:1002:17: danger: ‘pfd[0]’ leaks here
# 1000|   	dir = mkdtemp(template);
# 1001|   	if (!dir) {
# 1002|-> 		pr_perror("failed to construct temporary name");
# 1003|   		goto free_options;
# 1004|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def176]
criu-4.2/criu/cr-check.c:1007:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1000:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1001:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
criu-4.2/criu/cr-check.c:1006:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:1006:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1007:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:1007:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:1007:17: danger: ‘pfd[0]’ leaks here
# 1005|   
# 1006|   	if (mount("criu", dir, "autofs", 0, options) < 0) {
# 1007|-> 		pr_perror("failed to mount autofs");
# 1008|   		goto unlink_dir;
# 1009|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def177]
criu-4.2/criu/cr-check.c:1014:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1000:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1001:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
criu-4.2/criu/cr-check.c:1006:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:1006:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1011:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1013:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1014:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:1014:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:1014:17: danger: ‘pfd[0]’ leaks here
# 1012|   
# 1013|   	if (umount(dir))
# 1014|-> 		pr_perror("failed to umount %s", dir);
# 1015|   
# 1016|   unlink_dir:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def178]
criu-4.2/criu/cr-check.c:1018:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:995:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1000:15: branch_false: ...to here
criu-4.2/criu/cr-check.c:1001:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
criu-4.2/criu/cr-check.c:1006:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:1017:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1018:17: branch_true: ...to here
criu-4.2/criu/cr-check.c:1018:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:1018:17: danger: ‘pfd[0]’ leaks here
# 1016|   unlink_dir:
# 1017|   	if (rmdir(dir))
# 1018|-> 		pr_perror("failed to unlink %s", dir);
# 1019|   free_options:
# 1020|   	free(options);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def179]
criu-4.2/criu/cr-check.c:1022:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/cr-check.c:978:12: enter_function: entry to ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: call_function: calling ‘check_autofs_pipe_ino’ from ‘check_autofs’
criu-4.2/criu/cr-check.c:983:15: return_function: returning to ‘check_autofs’ from ‘check_autofs_pipe_ino’
criu-4.2/criu/cr-check.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:987:13: branch_false: ...to here
criu-4.2/criu/cr-check.c:987:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:994:19: branch_false: ...to here
criu-4.2/criu/cr-check.c:1022:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-check.c:1022:9: danger: ‘pfd[0]’ leaks here
# 1020|   	free(options);
# 1021|   close_pipe:
# 1022|-> 	close(pfd[0]);
# 1023|   	close(pfd[1]);
# 1024|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def180]
criu-4.2/criu/cr-check.c:1060:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/cr-check.c:1040:12: enter_function: entry to ‘check_tcp’
criu-4.2/criu/cr-check.c:1046:14: acquire_resource: stream socket created here
criu-4.2/criu/cr-check.c:1047:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/cr-check.c:1052:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:1053:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1053:35: call_function: inlined call to ‘has_cap_net_admin’ from ‘check_tcp’
criu-4.2/criu/cr-check.c:1053:13: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1060:17: branch_false: ...to here
criu-4.2/criu/cr-check.c:1060:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-check.c:1060:17: danger: ‘sk’ leaks here
# 1058|   		}
# 1059|   	} else {
# 1060|-> 		pr_info("Not checking for TCP repair mode. Please set CAP_NET_ADMIN\n");
# 1061|   	}
# 1062|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def181]
criu-4.2/criu/cr-check.c:1421:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/cr-check.c:1415:16: acquire_resource: opened here
criu-4.2/criu/cr-check.c:1416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1416:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:1421:16: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/0)
# 1419|   	}
# 1420|   
# 1421|-> 	while (fgets(buf, sizeof(buf), mapf)) {
# 1422|   		unsigned long start, end;
# 1423|   		uint32_t maj, min;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
criu-4.2/criu/cr-check.c:1421:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/cr-check.c:1415:16: acquire_memory: allocated here
criu-4.2/criu/cr-check.c:1416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1416:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:1421:16: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0)
# 1419|   	}
# 1420|   
# 1421|-> 	while (fgets(buf, sizeof(buf), mapf)) {
# 1422|   		unsigned long start, end;
# 1423|   		uint32_t maj, min;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def183]
criu-4.2/criu/cr-check.c:1426:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/cr-check.c:1415:16: acquire_resource: opened here
criu-4.2/criu/cr-check.c:1416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1416:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:1421:16: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1426:21: branch_true: ...to here
criu-4.2/criu/cr-check.c:1426:20: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/0)
# 1424|   		__u64 ino;
# 1425|   
# 1426|-> 		if (sscanf(buf, "%lx-%lx %*s %*s %x:%x %llu",
# 1427|   			   &start, &end, &maj, &min, &ino) != 5) {
# 1428|   			pr_perror("Unable to parse: %s", buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
criu-4.2/criu/cr-check.c:1426:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/cr-check.c:1415:16: acquire_memory: allocated here
criu-4.2/criu/cr-check.c:1416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1416:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:1421:16: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1426:21: branch_true: ...to here
criu-4.2/criu/cr-check.c:1426:20: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/0)
# 1424|   		__u64 ino;
# 1425|   
# 1426|-> 		if (sscanf(buf, "%lx-%lx %*s %*s %x:%x %llu",
# 1427|   			   &start, &end, &maj, &min, &ino) != 5) {
# 1428|   			pr_perror("Unable to parse: %s", buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def185]
criu-4.2/criu/cr-check.c:1431:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/cr-check.c:1415:16: acquire_resource: opened here
criu-4.2/criu/cr-check.c:1416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1416:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:1421:16: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1426:21: branch_true: ...to here
criu-4.2/criu/cr-check.c:1426:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1431:21: branch_false: ...to here
criu-4.2/criu/cr-check.c:1431:21: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/0)
# 1429|   			return -1;
# 1430|   		}
# 1431|-> 		if (start == (unsigned long)addr) {
# 1432|   			stx->stx_dev_major = maj;
# 1433|   			stx->stx_dev_minor = min;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
criu-4.2/criu/cr-check.c:1431:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/cr-check.c:1415:16: acquire_memory: allocated here
criu-4.2/criu/cr-check.c:1416:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1416:12: branch_false: ...to here
criu-4.2/criu/cr-check.c:1421:16: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-check.c:1426:21: branch_true: ...to here
criu-4.2/criu/cr-check.c:1426:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1431:21: branch_false: ...to here
criu-4.2/criu/cr-check.c:1431:21: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/0)
# 1429|   			return -1;
# 1430|   		}
# 1431|-> 		if (start == (unsigned long)addr) {
# 1432|   			stx->stx_dev_major = maj;
# 1433|   			stx->stx_dev_minor = min;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
criu-4.2/criu/cr-dedup.c:29:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("parent")’
criu-4.2/criu/cr-dedup.c:20:16: acquire_memory: allocated here
criu-4.2/criu/cr-dedup.c:21:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dedup.c:21:12: branch_false: ...to here
criu-4.2/criu/cr-dedup.c:29:23: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/cr-dedup.c:29:23: danger: ‘opendir("parent")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   27|   	while (1) {
#   28|   		errno = 0;
#   29|-> 		ent = readdir(dirp);
#   30|   		if (ent == NULL) {
#   31|   			if (errno) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def188]
criu-4.2/criu/cr-dump.c:113:22: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.2/criu/cr-dump.c:1556:12: enter_function: entry to ‘dump_one_task’
criu-4.2/criu/cr-dump.c:1574:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:1580:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1582:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:1583:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1788:9: call_function: calling ‘free_mappings’ from ‘dump_one_task’
#  111|   
#  112|   	list_for_each_entry_safe(vma_area, p, &vma_area_list->h, list) {
#  113|-> 		if (!vma_area->file_borrowed)
#  114|   			free(vma_area->vmst);
#  115|   		free(vma_area);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def189]
criu-4.2/criu/cr-dump.c:114:30: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.2/criu/cr-dump.c:1556:12: enter_function: entry to ‘dump_one_task’
criu-4.2/criu/cr-dump.c:1574:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:1580:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1582:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:1583:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1788:9: call_function: calling ‘free_mappings’ from ‘dump_one_task’
#  112|   	list_for_each_entry_safe(vma_area, p, &vma_area_list->h, list) {
#  113|   		if (!vma_area->file_borrowed)
#  114|-> 			free(vma_area->vmst);
#  115|   		free(vma_area);
#  116|   	}

Error: GCC_ANALYZER_WARNING (CWE-590): [#def190]
criu-4.2/criu/cr-dump.c:115:17: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘vma_area’ which points to memory on the stack
criu-4.2/criu/cr-dump.c:1556:12: enter_function: entry to ‘dump_one_task’
criu-4.2/criu/cr-dump.c:1574:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:1580:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1582:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:1583:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1788:9: call_function: calling ‘free_mappings’ from ‘dump_one_task’
#  113|   		if (!vma_area->file_borrowed)
#  114|   			free(vma_area->vmst);
#  115|-> 		free(vma_area);
#  116|   	}
#  117|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def191]
criu-4.2/criu/cr-dump.c:220:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:730:5: enter_function: entry to ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:746:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/cr-dump.c:747:23: branch_true: ...to here
criu-4.2/criu/cr-dump.c:747:23: call_function: calling ‘dump_sched_info’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:747:23: return_function: returning to ‘dump_thread_core’ from ‘dump_sched_info’
criu-4.2/criu/cr-dump.c:748:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:749:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:749:17: call_function: calling ‘core_put_tls’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:749:17: return_function: returning to ‘dump_thread_core’ from ‘core_put_tls’
criu-4.2/criu/cr-dump.c:751:17: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:752:17: call_function: inlined call to ‘copy_sas’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:753:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:757:28: branch_false: ...to here
criu-4.2/criu/cr-dump.c:757:28: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:757:28: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:757:17: branch_false: ...to here
criu-4.2/criu/cr-dump.c:758:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:762:23: branch_false: ...to here
criu-4.2/criu/cr-dump.c:772:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:773:23: branch_true: ...to here
criu-4.2/criu/cr-dump.c:773:23: call_function: calling ‘check_thread_rseq’ from ‘dump_thread_core’
#  218|   		return 0;
#  219|   
#  220|-> 	pr_debug("%d has rseq_inited = %d\n", tid, ti_rseq->rseq_inited);
#  221|   
#  222|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
criu-4.2/criu/cr-dump.c:227:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:730:5: enter_function: entry to ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:746:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/cr-dump.c:747:23: branch_true: ...to here
criu-4.2/criu/cr-dump.c:747:23: call_function: calling ‘dump_sched_info’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:747:23: return_function: returning to ‘dump_thread_core’ from ‘dump_sched_info’
criu-4.2/criu/cr-dump.c:748:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:749:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:749:17: call_function: calling ‘core_put_tls’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:749:17: return_function: returning to ‘dump_thread_core’ from ‘core_put_tls’
criu-4.2/criu/cr-dump.c:751:17: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:752:17: call_function: inlined call to ‘copy_sas’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:753:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:757:28: branch_false: ...to here
criu-4.2/criu/cr-dump.c:757:28: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:757:28: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:757:17: branch_false: ...to here
criu-4.2/criu/cr-dump.c:758:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:762:23: branch_false: ...to here
criu-4.2/criu/cr-dump.c:772:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:773:23: branch_true: ...to here
criu-4.2/criu/cr-dump.c:773:23: call_function: calling ‘check_thread_rseq’ from ‘dump_thread_core’
#  225|   	 */
#  226|   	if (ti_rseq->rseq_inited) {
#  227|-> 		pr_err("%d has rseq but kernel lacks get_rseq_conf feature\n", tid);
#  228|   		return -1;
#  229|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
criu-4.2/criu/cr-dump.c:252:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pid, 0, "fd"))’
criu-4.2/criu/cr-dump.c:247:18: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:247:18: branch_false: ...to here
criu-4.2/criu/cr-dump.c:247:18: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:247:18: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:248:12: branch_false: ...to here
criu-4.2/criu/cr-dump.c:248:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:248:12: branch_false: ...to here
criu-4.2/criu/cr-dump.c:252:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/cr-dump.c:252:22: danger: ‘fdopendir(do_open_proc(pid, 0, "fd"))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  250|   
#  251|   	n = 0;
#  252|-> 	while ((de = readdir(fd_dir))) {
#  253|   		if (dir_dots(de))
#  254|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def194]
criu-4.2/criu/cr-dump.c:441:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-dump.c:441:9: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:441:9: branch_true: ...to here
criu-4.2/criu/cr-dump.c:441:9: danger: dereference of NULL ‘0’
#  439|   	u32 id;
#  440|   
#  441|-> 	BUG_ON(!vma_area->vmst);
#  442|   	p.stat = *vma_area->vmst;
#  443|   	p.mnt_id = vma_area->mnt_id;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
criu-4.2/criu/cr-dump.c:477:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:509:12: enter_function: entry to ‘dump_task_mm’
criu-4.2/criu/cr-dump.c:521:20: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:521:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:521:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:522:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:525:9: branch_true: following ‘true’ branch (when ‘vma_area != vma_area_list’)...
criu-4.2/criu/cr-dump.c:526:27: branch_true: ...to here
criu-4.2/criu/cr-dump.c:530:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:532:26: branch_false: ...to here
criu-4.2/criu/cr-dump.c:532:25: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:533:31: branch_true: ...to here
criu-4.2/criu/cr-dump.c:533:31: call_function: calling ‘check_sysvipc_map_dump’ from ‘dump_task_mm’
#  475|   		return 0;
#  476|   
#  477|-> 	pr_err("Task %d with SysVIPC shmem map @%" PRIx64 " doesn't live in IPC ns\n", pid, vma->start);
#  478|   	return -1;
#  479|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
criu-4.2/criu/cr-dump.c:486:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:509:12: enter_function: entry to ‘dump_task_mm’
criu-4.2/criu/cr-dump.c:521:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:521:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:522:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:525:9: branch_true: following ‘true’ branch (when ‘vma_area != vma_area_list’)...
criu-4.2/criu/cr-dump.c:526:27: branch_true: ...to here
criu-4.2/criu/cr-dump.c:543:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:544:31: branch_true: ...to here
criu-4.2/criu/cr-dump.c:545:28: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:571:29: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:571:29: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:571:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:572:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:575:13: branch_false: ...to here
criu-4.2/criu/cr-dump.c:575:13: call_function: calling ‘get_task_auxv’ from ‘dump_task_mm’
#  484|   	int fd, i, ret;
#  485|   
#  486|-> 	pr_info("Obtaining task auvx ...\n");
#  487|   
#  488|   	fd = open_proc(pid, "auxv");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
criu-4.2/criu/cr-dump.c:528:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:521:20: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:521:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:521:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:522:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:525:9: branch_true: following ‘true’ branch (when ‘vma_area != vma_area_list’)...
criu-4.2/criu/cr-dump.c:526:27: branch_true: ...to here
criu-4.2/criu/cr-dump.c:528:17: throw: if ‘pr_vma’ throws an exception...
criu-4.2/criu/cr-dump.c:528:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  526|   		VmaEntry *vma = vma_area->e;
#  527|   
#  528|-> 		pr_info_vma(vma_area);
#  529|   
#  530|   		if (!vma_entry_is(vma, VMA_AREA_REGULAR))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
criu-4.2/criu/cr-dump.c:535:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:521:20: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:521:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:521:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:522:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:525:9: branch_true: following ‘true’ branch (when ‘vma_area != vma_area_list’)...
criu-4.2/criu/cr-dump.c:526:27: branch_true: ...to here
criu-4.2/criu/cr-dump.c:530:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:532:26: branch_false: ...to here
criu-4.2/criu/cr-dump.c:532:25: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:534:26: branch_false: ...to here
criu-4.2/criu/cr-dump.c:534:25: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:535:31: branch_true: ...to here
criu-4.2/criu/cr-dump.c:535:31: throw: if ‘dump_socket_map’ throws an exception...
criu-4.2/criu/cr-dump.c:535:31: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  533|   			ret = check_sysvipc_map_dump(pid, vma);
#  534|   		else if (vma_entry_is(vma, VMA_AREA_SOCKET))
#  535|-> 			ret = dump_socket_map(vma_area);
#  536|   		else
#  537|   			ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
criu-4.2/criu/cr-dump.c:544:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:521:20: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:521:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:521:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:522:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:525:9: branch_true: following ‘true’ branch (when ‘vma_area != vma_area_list’)...
criu-4.2/criu/cr-dump.c:526:27: branch_true: ...to here
criu-4.2/criu/cr-dump.c:530:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:541:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:543:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:544:31: branch_true: ...to here
criu-4.2/criu/cr-dump.c:544:31: throw: if ‘dump_aio_ring’ throws an exception...
criu-4.2/criu/cr-dump.c:544:31: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  542|   
#  543|   		if (vma_entry_is(vma, VMA_AREA_AIORING)) {
#  544|-> 			ret = dump_aio_ring(&mme, vma_area);
#  545|   			if (ret)
#  546|   				goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
criu-4.2/criu/cr-dump.c:571:29: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:521:20: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:521:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:521:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:522:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:525:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:571:29: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/cr-dump.c:571:29: branch_true: ...to here
criu-4.2/criu/cr-dump.c:571:29: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-dump.c:571:29: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  569|   
#  570|   	mme.n_mm_saved_auxv = AT_VECTOR_SIZE;
#  571|-> 	mme.mm_saved_auxv = xmalloc(pb_repeated_size(&mme, mm_saved_auxv));
#  572|   	if (!mme.mm_saved_auxv)
#  573|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def201]
criu-4.2/criu/cr-dump.c:751:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-dump.c:730:5: enter_function: entry to ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:746:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/cr-dump.c:747:23: branch_true: ...to here
criu-4.2/criu/cr-dump.c:747:23: call_function: calling ‘dump_sched_info’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:747:23: return_function: returning to ‘dump_thread_core’ from ‘dump_sched_info’
criu-4.2/criu/cr-dump.c:748:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:749:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:749:17: call_function: calling ‘core_put_tls’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:749:17: return_function: returning to ‘dump_thread_core’ from ‘core_put_tls’
criu-4.2/criu/cr-dump.c:751:17: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:751:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:751:17: danger: dereference of NULL ‘0’
#  749|   		core_put_tls(core, ti->tls);
#  750|   		CORE_THREAD_ARCH_INFO(core)->clear_tid_addr = encode_pointer(ti->tid_addr);
#  751|-> 		BUG_ON(!tc->sas);
#  752|   		copy_sas(tc->sas, &ti->sas);
#  753|   		if (ti->pdeath_sig) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
criu-4.2/criu/cr-dump.c:762:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:730:5: enter_function: entry to ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:746:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/cr-dump.c:747:23: branch_true: ...to here
criu-4.2/criu/cr-dump.c:747:23: call_function: calling ‘dump_sched_info’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:747:23: return_function: returning to ‘dump_thread_core’ from ‘dump_sched_info’
criu-4.2/criu/cr-dump.c:748:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:749:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:749:17: call_function: calling ‘core_put_tls’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:749:17: return_function: returning to ‘dump_thread_core’ from ‘core_put_tls’
criu-4.2/criu/cr-dump.c:751:17: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:752:17: call_function: inlined call to ‘copy_sas’ from ‘dump_thread_core’
criu-4.2/criu/cr-dump.c:753:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:757:28: branch_false: ...to here
criu-4.2/criu/cr-dump.c:757:28: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:757:28: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:757:17: branch_false: ...to here
criu-4.2/criu/cr-dump.c:758:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:762:23: branch_false: ...to here
criu-4.2/criu/cr-dump.c:762:23: throw: if ‘seccomp_dump_thread’ throws an exception...
criu-4.2/criu/cr-dump.c:762:23: danger: ‘___p’ leaks here; was allocated at [(23)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/22)
#  760|   	}
#  761|   	if (!ret)
#  762|-> 		ret = seccomp_dump_thread(pid, tc);
#  763|   
#  764|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
criu-4.2/criu/cr-dump.c:1060:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:1056:17: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:1056:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1060:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1060:9: throw: if ‘signal_queue_entry__init’ throws an exception...
criu-4.2/criu/cr-dump.c:1060:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 1058|   		return -1;
# 1059|   
# 1060|-> 	signal_queue_entry__init(queue);
# 1061|   
# 1062|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
criu-4.2/criu/cr-dump.c:1106:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:1056:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1060:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1066:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1072:28: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1073:20: branch_false: following ‘false’ branch (when ‘ret != 0’)...
criu-4.2/criu/cr-dump.c:1078:20: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1078:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/cr-dump.c:1089:17: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1090:34: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1090:17: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1091:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1097:31: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1097:54: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:1100:30: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1100:30: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:1100:30: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1106:25: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1106:25: throw: if ‘siginfo_entry__init’ throws an exception...
criu-4.2/criu/cr-dump.c:1106:25: danger: ‘___p’ leaks here; was allocated at [(16)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/15)
# 1104|   			}
# 1105|   
# 1106|-> 			siginfo_entry__init(se);
# 1107|   			se->siginfo.len = sizeof(siginfo_t);
# 1108|   			se->siginfo.data = (void *)si++; /* XXX we don't free cores, but when

Error: GCC_ANALYZER_WARNING (CWE-401): [#def205]
criu-4.2/criu/cr-dump.c:1230:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-dump.c:1208:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:1211:15: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1212:12: branch_false: following ‘false’ branch (when ‘ret == 24’)...
criu-4.2/criu/cr-dump.c:1217:13: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1217:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:1223:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1226:17: acquire_memory: allocated here
criu-4.2/criu/cr-dump.c:1226:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1230:9: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1230:9: throw: if ‘rseq_entry__init’ throws an exception...
criu-4.2/criu/cr-dump.c:1230:9: danger: ‘___p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/6)
# 1228|   		return -1;
# 1229|   
# 1230|-> 	rseq_entry__init(rseqe);
# 1231|   
# 1232|   	rseqe->rseq_abi_pointer = rseqc.rseq_abi_pointer;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def206]
criu-4.2/criu/cr-dump.c:1416:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-dump.c:1395:9: branch_true: following ‘true’ branch (when ‘item’ is non-NULL)...
criu-4.2/criu/cr-dump.c:1396:21: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1410:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-dump.c:1413:29: branch_false: ...to here
criu-4.2/criu/cr-dump.c:1416:17: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-dump.c:1416:17: branch_true: ...to here
criu-4.2/criu/cr-dump.c:1416:17: danger: dereference of NULL ‘0’
# 1414|   		item->pgid = pps_buf.pgid;
# 1415|   
# 1416|-> 		BUG_ON(has_children(item));
# 1417|   
# 1418|   		if (!item->sid) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def207]
criu-4.2/criu/cr-dump.c:1815:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1813|   	}
# 1814|   	pr_err("FATAL: Unable to interrupt the current operation\n");
# 1815|-> 	BUG();
# 1816|   }
# 1817|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def208]
criu-4.2/criu/cr-restore.c:153:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  151|   	}
#  152|   
#  153|-> 	BUG();
#  154|   	return -1;
#  155|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def209]
criu-4.2/criu/cr-restore.c:173:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  171|   	}
#  172|   
#  173|-> 	BUG();
#  174|   	return -1;
#  175|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def210]
criu-4.2/criu/cr-restore.c:182:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-restore.c:182:9: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-restore.c:182:9: branch_false: ...to here
criu-4.2/criu/cr-restore.c:182:9: danger: dereference of NULL ‘0’
#  180|   	futex_t *np = &task_entries->nr_in_progress;
#  181|   
#  182|-> 	futex_wait_while_gt(np, participants);
#  183|   	ret = (int)futex_get(np);
#  184|   	if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def211]
criu-4.2/criu/cr-restore.c:391:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-restore.c:389:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:390:50: branch_true: ...to here
criu-4.2/criu/cr-restore.c:391:17: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:391:17: branch_true: ...to here
criu-4.2/criu/cr-restore.c:391:17: danger: dereference of NULL ‘0’
#  389|   	if (root_ns_mask & CLONE_NEWNS) {
#  390|   		mntns = lookup_ns_by_id(root_item->ids->mnt_ns_id, &mnt_ns_desc);
#  391|-> 		BUG_ON(!mntns);
#  392|   	}
#  393|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
criu-4.2/criu/cr-restore.c:508:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-restore.c:520:12: enter_function: entry to ‘open_cores’
criu-4.2/criu/cr-restore.c:525:17: acquire_memory: allocated here
criu-4.2/criu/cr-restore.c:525:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:526:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:529:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:530:24: branch_true: ...to here
criu-4.2/criu/cr-restore.c:534:26: call_function: calling ‘open_core’ from ‘open_cores’
#  506|   	struct cr_img *img;
#  507|   
#  508|-> 	img = open_image(CR_FD_CORE, O_RSTR, pid);
#  509|   	if (!img) {
#  510|   		pr_err("Can't open core data for %d\n", pid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
criu-4.2/criu/cr-restore.c:510:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-restore.c:520:12: enter_function: entry to ‘open_cores’
criu-4.2/criu/cr-restore.c:525:17: acquire_memory: allocated here
criu-4.2/criu/cr-restore.c:525:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:526:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:529:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:530:24: branch_true: ...to here
criu-4.2/criu/cr-restore.c:534:26: call_function: calling ‘open_core’ from ‘open_cores’
#  508|   	img = open_image(CR_FD_CORE, O_RSTR, pid);
#  509|   	if (!img) {
#  510|-> 		pr_err("Can't open core data for %d\n", pid);
#  511|   		return -1;
#  512|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
criu-4.2/criu/cr-restore.c:514:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-restore.c:520:12: enter_function: entry to ‘open_cores’
criu-4.2/criu/cr-restore.c:525:17: acquire_memory: allocated here
criu-4.2/criu/cr-restore.c:525:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:526:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:529:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:530:24: branch_true: ...to here
criu-4.2/criu/cr-restore.c:534:26: call_function: calling ‘open_core’ from ‘open_cores’
#  512|   	}
#  513|   
#  514|-> 	ret = pb_read_one(img, pcore, PB_CORE);
#  515|   	close_image(img);
#  516|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
criu-4.2/criu/cr-restore.c:515:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/cr-restore.c:520:12: enter_function: entry to ‘open_cores’
criu-4.2/criu/cr-restore.c:525:17: acquire_memory: allocated here
criu-4.2/criu/cr-restore.c:525:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:526:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/cr-restore.c:526:12: branch_false: ...to here
criu-4.2/criu/cr-restore.c:529:21: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:530:24: branch_true: ...to here
criu-4.2/criu/cr-restore.c:534:26: call_function: calling ‘open_core’ from ‘open_cores’
#  513|   
#  514|   	ret = pb_read_one(img, pcore, PB_CORE);
#  515|-> 	close_image(img);
#  516|   
#  517|   	return ret <= 0 ? -1 : 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def216]
criu-4.2/criu/cr-restore.c:1174:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-restore.c:1090:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-restore.c:1136:38: branch_false: ...to here
criu-4.2/criu/cr-restore.c:1174:9: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1174:9: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1174:9: danger: dereference of NULL ‘0’
# 1172|   	ca.clone_flags = rsti(item)->clone_flags;
# 1173|   
# 1174|-> 	BUG_ON(ca.clone_flags & CLONE_VM);
# 1175|   
# 1176|   	pr_info("Forking task with %d pid (flags 0x%lx)\n", pid, ca.clone_flags);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def217]
criu-4.2/criu/cr-restore.c:1412:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-restore.c:1381:13: enter_function: entry to ‘restore_pgid’
criu-4.2/criu/cr-restore.c:1398:12: branch_false: following ‘false’ branch (when ‘my_pgid != pgid’)...
criu-4.2/criu/cr-restore.c:1401:24: branch_false: ...to here
criu-4.2/criu/cr-restore.c:1401:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1410:17: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1411:20: branch_true: following ‘true’ branch (when ‘leader’ is non-NULL)...
criu-4.2/criu/cr-restore.c:1412:25: call_function: inlined call to ‘vpid’ from ‘restore_pgid’
criu-4.2/criu/cr-restore.c:1412:25: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1412:25: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1412:25: danger: dereference of NULL ‘0’
# 1410|   		leader = rsti(current)->pgrp_leader;
# 1411|   		if (leader) {
# 1412|-> 			BUG_ON(my_pgid != vpid(leader));
# 1413|   			futex_wait_until(&rsti(leader)->pgrp_set, 1);
# 1414|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def218]
criu-4.2/criu/cr-restore.c:1413:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-restore.c:1381:13: enter_function: entry to ‘restore_pgid’
criu-4.2/criu/cr-restore.c:1398:12: branch_false: following ‘false’ branch (when ‘my_pgid != pgid’)...
criu-4.2/criu/cr-restore.c:1401:24: branch_false: ...to here
criu-4.2/criu/cr-restore.c:1401:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1410:17: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1411:20: branch_true: following ‘true’ branch (when ‘leader’ is non-NULL)...
criu-4.2/criu/cr-restore.c:1412:25: call_function: inlined call to ‘vpid’ from ‘restore_pgid’
criu-4.2/criu/cr-restore.c:1412:25: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-restore.c:1412:25: branch_false: ...to here
criu-4.2/criu/cr-restore.c:1413:25: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-restore.c:1413:25: branch_false: ...to here
criu-4.2/criu/cr-restore.c:1413:25: danger: dereference of NULL ‘0’
# 1411|   		if (leader) {
# 1412|   			BUG_ON(my_pgid != vpid(leader));
# 1413|-> 			futex_wait_until(&rsti(leader)->pgrp_set, 1);
# 1414|   		}
# 1415|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def219]
criu-4.2/criu/cr-restore.c:1463:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/cr-restore.c:1453:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1454:28: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1454:28: acquire_resource: opened here
criu-4.2/criu/cr-restore.c:1462:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
criu-4.2/criu/cr-restore.c:1463:23: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1463:23: throw: if ‘set_proc_fd’ throws an exception...
criu-4.2/criu/cr-restore.c:1463:23: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1461|   
# 1462|   	if (fd >= 0) {
# 1463|-> 		ret = set_proc_fd(fd);
# 1464|   		close(fd);
# 1465|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def220]
criu-4.2/criu/cr-restore.c:1486:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-restore.c:1482:9: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1483:22: branch_true: ...to here
criu-4.2/criu/cr-restore.c:1486:17: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-restore.c:1486:17: danger: dereference of NULL ‘0’
# 1484|   			continue;
# 1485|   
# 1486|-> 		BUG_ON(child->born_sid != -1 && getsid(0) != child->born_sid);
# 1487|   
# 1488|   		ret = fork_with_pid(child);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def221]
criu-4.2/criu/cr-restore.c:2016:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc", 65536)’
criu-4.2/criu/cr-restore.c:2005:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-restore.c:2010:14: branch_false: ...to here
criu-4.2/criu/cr-restore.c:2010:14: acquire_resource: opened here
criu-4.2/criu/cr-restore.c:2011:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-restore.c:2016:15: branch_false: ...to here
criu-4.2/criu/cr-restore.c:2016:15: danger: ‘open("/proc", 65536)’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 2014|   	}
# 2015|   
# 2016|-> 	ret = install_service_fd(CR_PROC_FD_OFF, fd);
# 2017|   	if (ret < 0)
# 2018|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
criu-4.2/criu/cr-service.c:71:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/criu/cr-service.c:1356:5: enter_function: entry to ‘cr_service_work’
criu-4.2/criu/cr-service.c:1372:13: call_function: calling ‘recv_criu_msg’ from ‘cr_service_work’
#   69|   	}
#   70|   
#   71|-> 	len = recv(socket_fd, buf, len, MSG_TRUNC);
#   72|   	if (len == -1) {
#   73|   		pr_perror("Can't read request");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
criu-4.2/criu/cr-service.c:110:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/criu/cr-service.c:1270:12: enter_function: entry to ‘handle_wait_pid’
criu-4.2/criu/cr-service.c:1290:16: call_function: inlined call to ‘send_criu_msg’ from ‘handle_wait_pid’
#  108|   	}
#  109|   
#  110|-> 	if (criu_resp__pack(msg, buf) != len) {
#  111|   		pr_perror("Failed packing response");
#  112|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def224]
criu-4.2/criu/cr-service.c:410:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1037:12: enter_function: entry to ‘start_page_server_req’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1061:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  408|   
#  409|   	if (getsockopt(sk, SOL_SOCKET, SO_PEERCRED, &ids, &ids_len)) {
#  410|-> 		pr_perror("Can't get socket options");
#  411|   		goto err;
#  412|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def225]
criu-4.2/criu/cr-service.c:432:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1037:12: enter_function: entry to ‘start_page_server_req’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1061:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  430|   
#  431|   	if (fstat(sk, &st)) {
#  432|-> 		pr_perror("Can't get socket stat");
#  433|   		goto err;
#  434|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def226]
criu-4.2/criu/cr-service.c:436:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1037:12: enter_function: entry to ‘start_page_server_req’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1061:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  434|   	}
#  435|   
#  436|-> 	BUG_ON(st.st_ino == -1);
#  437|   	service_sk_ino = st.st_ino;
#  438|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def227]
criu-4.2/criu/cr-service.c:436:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/cr-service.c:1293:12: enter_function: entry to ‘handle_cpuinfo’
criu-4.2/criu/cr-service.c:1299:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1304:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1305:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/cr-service.c:1310:12: branch_false: ...to here
criu-4.2/criu/cr-service.c:1310:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1313:30: branch_true: ...to here
criu-4.2/criu/cr-service.c:1314:21: call_function: calling ‘setup_opts_from_req’ from ‘handle_cpuinfo’
#  434|   	}
#  435|   
#  436|-> 	BUG_ON(st.st_ino == -1);
#  437|   	service_sk_ino = st.st_ino;
#  438|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def228]
criu-4.2/criu/cr-service.c:442:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1037:12: enter_function: entry to ‘start_page_server_req’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1061:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  440|   		opts.unprivileged = req->unprivileged;
#  441|   
#  442|-> 	if (log_keep_err()) {
#  443|   		pr_perror("Can't tune log");
#  444|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def229]
criu-4.2/criu/cr-service.c:443:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1037:12: enter_function: entry to ‘start_page_server_req’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1061:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  441|   
#  442|   	if (log_keep_err()) {
#  443|-> 		pr_perror("Can't tune log");
#  444|   		goto err;
#  445|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def230]
criu-4.2/criu/cr-service.c:462:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1037:12: enter_function: entry to ‘start_page_server_req’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1061:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  460|   		opts.ext_unix_sk = req->ext_unix_sk;
#  461|   		for (i = 0; i < req->n_unix_sk_ino; i++) {
#  462|-> 			if (unix_sk_id_add((unsigned int)req->unix_sk_ino[i]->inode) < 0)
#  463|   				goto err;
#  464|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def231]
criu-4.2/criu/cr-service.c:1058:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1058:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-service.c:1058:17: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1056|   	pid = fork();
# 1057|   	if (pid == 0) {
# 1058|-> 		close(start_pipe[0]);
# 1059|   
# 1060|   		opts.mode = CR_PAGE_SERVER;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def232]
criu-4.2/criu/cr-service.c:1058:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.2/criu/cr-service.c:1046:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1051:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1051:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1056:15: branch_false: ...to here
criu-4.2/criu/cr-service.c:1057:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/cr-service.c:1058:17: branch_true: ...to here
criu-4.2/criu/cr-service.c:1058:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/cr-service.c:1058:17: danger: ‘start_pipe[1]’ leaks here
# 1056|   	pid = fork();
# 1057|   	if (pid == 0) {
# 1058|-> 		close(start_pipe[0]);
# 1059|   
# 1060|   		opts.mode = CR_PAGE_SERVER;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def233]
criu-4.2/criu/cr-service.c:1469:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1493:5: enter_function: entry to ‘cr_service’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1546:12: branch_false: following ‘false’ branch (when ‘daemon_mode == 0’)...
criu-4.2/criu/cr-service.c:1553:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1553:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1560:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1560:13: call_function: calling ‘setup_sigchld_handler’ from ‘cr_service’
# 1467|   
# 1468|   	if (sigaction(SIGCHLD, &action, NULL)) {
# 1469|-> 		pr_perror("Can't setup SIGCHLD handler");
# 1470|   		return -1;
# 1471|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def234]
criu-4.2/criu/cr-service.c:1516:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1515:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1516:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1516:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-service.c:1516:25: danger: ‘server_fd’ leaks here
# 1514|   
# 1515|   		if (opts.addr == NULL) {
# 1516|-> 			pr_warn("Binding to local dir address!\n");
# 1517|   			SET_CHAR_OPTS(addr, CR_DEFAULT_SERVICE_ADDRESS);
# 1518|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def235]
criu-4.2/criu/cr-service.c:1517:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1515:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1516:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1517:25: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/cr-service.c:1517:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1517:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-service.c:1517:25: danger: ‘server_fd’ leaks here
# 1515|   		if (opts.addr == NULL) {
# 1516|   			pr_warn("Binding to local dir address!\n");
# 1517|-> 			SET_CHAR_OPTS(addr, CR_DEFAULT_SERVICE_ADDRESS);
# 1518|   		}
# 1519|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def236]
criu-4.2/criu/cr-service.c:1541:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1541:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1541:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-service.c:1541:25: danger: ‘server_fd’ leaks here
# 1539|   
# 1540|   		if (listen(server_fd, 16) == -1) {
# 1541|-> 			pr_perror("Can't listen for socket connections");
# 1542|   			goto err;
# 1543|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def237]
criu-4.2/criu/cr-service.c:1548:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1546:12: branch_true: following ‘true’ branch (when ‘daemon_mode != 0’)...
criu-4.2/criu/cr-service.c:1547:21: branch_true: ...to here
criu-4.2/criu/cr-service.c:1547:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1548:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1548:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-service.c:1548:25: danger: ‘server_fd’ leaks here
# 1546|   	if (daemon_mode) {
# 1547|   		if (daemon(1, 0) == -1) {
# 1548|-> 			pr_perror("Can't run service server in the background");
# 1549|   			goto err;
# 1550|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def238]
criu-4.2/criu/cr-service.c:1554:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1553:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1554:35: branch_true: ...to here
criu-4.2/criu/cr-service.c:1554:21: throw: if ‘write_pidfile’ throws an exception...
criu-4.2/criu/cr-service.c:1554:21: danger: ‘server_fd’ leaks here
# 1552|   
# 1553|   	if (opts.pidfile) {
# 1554|-> 		if (write_pidfile(getpid()) == -1) {
# 1555|   			pr_perror("Can't write pidfile");
# 1556|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def239]
criu-4.2/criu/cr-service.c:1555:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1553:12: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1554:35: branch_true: ...to here
criu-4.2/criu/cr-service.c:1554:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1555:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1555:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-service.c:1555:25: danger: ‘server_fd’ leaks here
# 1553|   	if (opts.pidfile) {
# 1554|   		if (write_pidfile(getpid()) == -1) {
# 1555|-> 			pr_perror("Can't write pidfile");
# 1556|   			goto err;
# 1557|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def240]
criu-4.2/criu/cr-service.c:1563:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1493:5: enter_function: entry to ‘cr_service’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1560:13: call_function: calling ‘setup_sigchld_handler’ from ‘cr_service’
criu-4.2/criu/cr-service.c:1560:13: return_function: returning to ‘cr_service’ from ‘setup_sigchld_handler’
criu-4.2/criu/cr-service.c:1560:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1563:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1563:13: throw: if ‘status_ready’ throws an exception...
criu-4.2/criu/cr-service.c:1563:13: danger: ‘server_fd’ leaks here
# 1561|   		goto err;
# 1562|   
# 1563|-> 	if (status_ready())
# 1564|   		goto err;
# 1565|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def241]
criu-4.2/criu/cr-service.c:1569:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1493:5: enter_function: entry to ‘cr_service’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1560:13: call_function: calling ‘setup_sigchld_handler’ from ‘cr_service’
criu-4.2/criu/cr-service.c:1560:13: return_function: returning to ‘cr_service’ from ‘setup_sigchld_handler’
criu-4.2/criu/cr-service.c:1560:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1563:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1563:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1563:12: branch_false: ...to here
criu-4.2/criu/cr-service.c:1569:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/cr-service.c:1569:17: danger: ‘server_fd’ leaks here
# 1567|   		int sk;
# 1568|   
# 1569|-> 		pr_info("Waiting for connection...\n");
# 1570|   
# 1571|   		sk = accept(server_fd, (struct sockaddr *)&client_addr, &client_addr_len);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def242]
criu-4.2/criu/cr-service.c:1571:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1493:5: enter_function: entry to ‘cr_service’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1602:1: branch_false: ...to here
criu-4.2/criu/cr-service.c:1560:13: call_function: calling ‘setup_sigchld_handler’ from ‘cr_service’
criu-4.2/criu/cr-service.c:1560:13: return_function: returning to ‘cr_service’ from ‘setup_sigchld_handler’
criu-4.2/criu/cr-service.c:1560:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1563:13: branch_false: ...to here
criu-4.2/criu/cr-service.c:1563:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1563:12: branch_false: ...to here
criu-4.2/criu/cr-service.c:1571:22: throw: if ‘accept’ throws an exception...
criu-4.2/criu/cr-service.c:1571:22: danger: ‘server_fd’ leaks here
# 1569|   		pr_info("Waiting for connection...\n");
# 1570|   
# 1571|-> 		sk = accept(server_fd, (struct sockaddr *)&client_addr, &client_addr_len);
# 1572|   		if (sk == -1) {
# 1573|   			pr_perror("Can't accept connection");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def243]
criu-4.2/criu/cr-service.c:1599:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘server_fd’
criu-4.2/criu/cr-service.c:1505:29: acquire_resource: socket created here
criu-4.2/criu/cr-service.c:1506:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1511:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1527:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1532:17: branch_false: ...to here
criu-4.2/criu/cr-service.c:1535:20: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-service.c:1540:21: branch_false: ...to here
criu-4.2/criu/cr-service.c:1540:20: branch_true: following ‘true’ branch...
criu-4.2/criu/cr-service.c:1541:25: branch_true: ...to here
criu-4.2/criu/cr-service.c:1599:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/cr-service.c:1599:9: danger: ‘server_fd’ leaks here
# 1597|   
# 1598|   err:
# 1599|-> 	close_safe(&server_fd);
# 1600|   
# 1601|   	return 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def244]
criu-4.2/criu/crtools.c:140:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/crtools.c:140:9: branch_true: following ‘true’ branch...
criu-4.2/criu/crtools.c:140:9: branch_true: ...to here
criu-4.2/criu/crtools.c:140:9: danger: dereference of NULL ‘0’
#  138|   	BUILD_BUG_ON(__CTL_STR != SYSCTL_TYPE__CTL_STR);
#  139|   	/* We use it for fd overlap handling in clone_service_fd() */
#  140|-> 	BUG_ON(get_service_fd(SERVICE_FD_MIN + 1) < get_service_fd(SERVICE_FD_MAX - 1));
#  141|   
#  142|   	if (fault_injection_init()) {

Error: GCC_ANALYZER_WARNING (CWE-416): [#def245]
criu-4.2/criu/eventpoll.c:112:25: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘((struct eventpoll_dinfo)*((struct list_head *)dinfo)).e’
criu-4.2/criu/eventpoll.c:125:5: enter_function: entry to ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:133:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:165:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:166:20: branch_false: ...to here
criu-4.2/criu/eventpoll.c:169:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:172:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:172:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:172:17: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘dequeue_dinfo’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:167:25: branch_true: ...to here
criu-4.2/criu/eventpoll.c:178:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:179:17: branch_true: ...to here
criu-4.2/criu/eventpoll.c:179:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
#  110|   	ssize_t i;
#  111|   
#  112|-> 	for (i = 0; i < dinfo->e->n_tfd; i++)
#  113|   		eventpoll_tfd_entry__free_unpacked(dinfo->e->tfd[i], NULL);
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def246]
criu-4.2/criu/eventpoll.c:112:25: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘dinfo’
criu-4.2/criu/eventpoll.c:125:5: enter_function: entry to ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:133:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:165:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:166:20: branch_false: ...to here
criu-4.2/criu/eventpoll.c:169:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:172:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:172:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:172:17: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘dequeue_dinfo’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:167:25: branch_true: ...to here
criu-4.2/criu/eventpoll.c:178:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:179:17: branch_true: ...to here
criu-4.2/criu/eventpoll.c:179:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
#  110|   	ssize_t i;
#  111|   
#  112|-> 	for (i = 0; i < dinfo->e->n_tfd; i++)
#  113|   		eventpoll_tfd_entry__free_unpacked(dinfo->e->tfd[i], NULL);
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def247]
criu-4.2/criu/eventpoll.c:115:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘((struct eventpoll_dinfo)*((struct list_head *)dinfo)).fe’
criu-4.2/criu/eventpoll.c:125:5: enter_function: entry to ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:133:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:165:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:166:20: branch_false: ...to here
criu-4.2/criu/eventpoll.c:169:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:172:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:172:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:172:17: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘dequeue_dinfo’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:167:25: branch_true: ...to here
criu-4.2/criu/eventpoll.c:178:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:179:17: branch_true: ...to here
criu-4.2/criu/eventpoll.c:179:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
#  113|   		eventpoll_tfd_entry__free_unpacked(dinfo->e->tfd[i], NULL);
#  114|   
#  115|-> 	xfree(dinfo->fe);
#  116|   	xfree(dinfo->e->tfd);
#  117|   	xfree(dinfo->e);

Error: GCC_ANALYZER_WARNING (CWE-415): [#def248]
criu-4.2/criu/eventpoll.c:116:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*((struct eventpoll_dinfo)*((struct list_head *)dinfo)).e.tfd’
criu-4.2/criu/eventpoll.c:125:5: enter_function: entry to ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:133:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:165:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:166:20: branch_false: ...to here
criu-4.2/criu/eventpoll.c:169:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:172:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:172:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:172:17: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘dequeue_dinfo’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:167:25: branch_true: ...to here
criu-4.2/criu/eventpoll.c:178:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:179:17: branch_true: ...to here
criu-4.2/criu/eventpoll.c:179:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
#  114|   
#  115|   	xfree(dinfo->fe);
#  116|-> 	xfree(dinfo->e->tfd);
#  117|   	xfree(dinfo->e);
#  118|   	xfree(dinfo->toff);

Error: GCC_ANALYZER_WARNING (CWE-415): [#def249]
criu-4.2/criu/eventpoll.c:118:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘((struct eventpoll_dinfo)*((struct list_head *)dinfo)).toff’
criu-4.2/criu/eventpoll.c:125:5: enter_function: entry to ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:133:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:165:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:166:20: branch_false: ...to here
criu-4.2/criu/eventpoll.c:169:29: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:172:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:172:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:172:17: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘dequeue_dinfo’
criu-4.2/criu/eventpoll.c:130:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:131:37: branch_true: ...to here
criu-4.2/criu/eventpoll.c:166:21: call_function: calling ‘img_from_set’ from ‘flush_eventpoll_dinfo_queue’
criu-4.2/criu/eventpoll.c:166:21: return_function: returning to ‘flush_eventpoll_dinfo_queue’ from ‘img_from_set’
criu-4.2/criu/eventpoll.c:166:20: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:167:25: branch_true: ...to here
criu-4.2/criu/eventpoll.c:178:9: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:179:17: branch_true: ...to here
criu-4.2/criu/eventpoll.c:179:17: call_function: calling ‘dequeue_dinfo’ from ‘flush_eventpoll_dinfo_queue’
#  116|   	xfree(dinfo->e->tfd);
#  117|   	xfree(dinfo->e);
#  118|-> 	xfree(dinfo->toff);
#  119|   
#  120|   	list_del(&dinfo->list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def250]
criu-4.2/criu/eventpoll.c:264:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/eventpoll.c:261:13: acquire_memory: allocated here
criu-4.2/criu/eventpoll.c:261:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:261:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:262:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:264:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:264:9: throw: if ‘eventpoll_file_entry__init’ throws an exception...
criu-4.2/criu/eventpoll.c:264:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  262|   	if (!e)
#  263|   		goto out;
#  264|-> 	eventpoll_file_entry__init(e);
#  265|   
#  266|   	fe = xmalloc(sizeof(*fe));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
criu-4.2/criu/eventpoll.c:269:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/eventpoll.c:261:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:261:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:262:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:264:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:266:14: acquire_memory: allocated here
criu-4.2/criu/eventpoll.c:266:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:266:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:267:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:269:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:269:9: throw: if ‘file_entry__init’ throws an exception...
criu-4.2/criu/eventpoll.c:269:9: danger: ‘___p’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  267|   	if (!fe)
#  268|   		goto out;
#  269|-> 	file_entry__init(fe);
#  270|   
#  271|   	e->id = id;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def252]
criu-4.2/criu/eventpoll.c:297:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/eventpoll.c:261:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:261:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:262:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:264:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:266:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:266:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:267:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:269:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:275:12: branch_false: following ‘false’ branch...
criu-4.2/criu/eventpoll.c:278:9: branch_false: ...to here
criu-4.2/criu/eventpoll.c:287:12: branch_true: following ‘true’ branch...
criu-4.2/criu/eventpoll.c:288:24: branch_true: ...to here
criu-4.2/criu/eventpoll.c:288:24: acquire_memory: allocated here
criu-4.2/criu/eventpoll.c:288:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:288:17: branch_false: ...to here
criu-4.2/criu/eventpoll.c:289:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/eventpoll.c:289:20: branch_false: ...to here
criu-4.2/criu/eventpoll.c:297:17: throw: if ‘qsort’ throws an exception...
criu-4.2/criu/eventpoll.c:297:17: danger: ‘___p’ leaks here; was allocated at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
#  295|   		}
#  296|   
#  297|-> 		qsort(toff, e->n_tfd, sizeof(*toff), toff_cmp);
#  298|   
#  299|   		for (i = 1; i < e->n_tfd; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
criu-4.2/criu/external.c:22:19: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/external.c:11:5: enter_function: entry to ‘add_external’
criu-4.2/criu/external.c:15:13: call_function: inlined call to ‘strstartswith’ from ‘add_external’
criu-4.2/criu/external.c:15:12: branch_false: following ‘false’ branch...
criu-4.2/criu/external.c:18:15: branch_false: ...to here
criu-4.2/criu/external.c:18:15: acquire_memory: allocated here
criu-4.2/criu/external.c:18:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/external.c:22:19: branch_false: ...to here
criu-4.2/criu/external.c:22:19: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/external.c:22:19: branch_true: ...to here
criu-4.2/criu/external.c:22:19: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/external.c:22:19: danger: ‘___p’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   20|   		return -1;
#   21|   
#   22|-> 	ext->id = xstrdup(key);
#   23|   	if (!ext->id)
#   24|   		goto err_id;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def254]
criu-4.2/criu/file-lock.c:174:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/file-lock.c:162:12: branch_false: following ‘false’ branch...
criu-4.2/criu/file-lock.c:169:13: branch_false: ...to here
criu-4.2/criu/file-lock.c:169:12: branch_true: following ‘true’ branch...
criu-4.2/criu/file-lock.c:170:21: branch_true: ...to here
criu-4.2/criu/file-lock.c:170:20: branch_true: following ‘true’ branch...
criu-4.2/criu/file-lock.c:173:29: branch_true: ...to here
criu-4.2/criu/file-lock.c:174:25: branch_true: following ‘true’ branch...
criu-4.2/criu/file-lock.c:174:25: branch_true: ...to here
criu-4.2/criu/file-lock.c:174:25: danger: dereference of NULL ‘0’
#  172|   
#  173|   			m = lookup_mnt_id(p->mnt_id);
#  174|-> 			BUG_ON(m == NULL);
#  175|   			dev = kdev_to_odev(m->s_dev);
#  176|   		} else /* old kernel */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
criu-4.2/criu/files-reg.c:126:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files-reg.c:1758:5: enter_function: entry to ‘dump_one_reg_file’
criu-4.2/criu/files-reg.c:1777:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1785:28: branch_false: ...to here
criu-4.2/criu/files-reg.c:1795:13: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1801:13: branch_false: ...to here
criu-4.2/criu/files-reg.c:1811:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1816:12: branch_false: ...to here
criu-4.2/criu/files-reg.c:1816:12: branch_false: following ‘false’ branch (when ‘skip_for_shell_job == 0’)...
criu-4.2/criu/files-reg.c:1816:36: branch_false: ...to here
criu-4.2/criu/files-reg.c:1816:36: call_function: calling ‘check_path_remap’ from ‘dump_one_reg_file’
#  124|   		goto err;
#  125|   
#  126|-> 	rlb->path = xstrdup(path);
#  127|   	if (!rlb->path)
#  128|   		goto err2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
criu-4.2/criu/files-reg.c:1141:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files-reg.c:1758:5: enter_function: entry to ‘dump_one_reg_file’
criu-4.2/criu/files-reg.c:1777:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1785:28: branch_false: ...to here
criu-4.2/criu/files-reg.c:1795:13: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1801:13: branch_false: ...to here
criu-4.2/criu/files-reg.c:1811:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1816:12: branch_false: ...to here
criu-4.2/criu/files-reg.c:1816:12: branch_false: following ‘false’ branch (when ‘skip_for_shell_job == 0’)...
criu-4.2/criu/files-reg.c:1816:36: branch_false: ...to here
criu-4.2/criu/files-reg.c:1816:36: call_function: calling ‘check_path_remap’ from ‘dump_one_reg_file’
# 1139|   	tmp = link_name + len;
# 1140|   	while (*tmp != '/') {
# 1141|-> 		BUG_ON(tmp == link_name);
# 1142|   		tmp--;
# 1143|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def257]
criu-4.2/criu/files-reg.c:1267:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files-reg.c:1758:5: enter_function: entry to ‘dump_one_reg_file’
criu-4.2/criu/files-reg.c:1777:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1785:28: branch_false: ...to here
criu-4.2/criu/files-reg.c:1795:13: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1801:13: branch_false: ...to here
criu-4.2/criu/files-reg.c:1811:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1816:12: branch_false: ...to here
criu-4.2/criu/files-reg.c:1816:12: branch_false: following ‘false’ branch (when ‘skip_for_shell_job == 0’)...
criu-4.2/criu/files-reg.c:1816:36: branch_false: ...to here
criu-4.2/criu/files-reg.c:1816:36: call_function: calling ‘check_path_remap’ from ‘dump_one_reg_file’
# 1265|   
# 1266|   	name = strrchr(name, '/');
# 1267|-> 	BUG_ON(name == NULL); /* see check in dump_one_reg_file */
# 1268|   	name++;
# 1269|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def258]
criu-4.2/criu/files-reg.c:1835:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files-reg.c:1758:5: enter_function: entry to ‘dump_one_reg_file’
criu-4.2/criu/files-reg.c:1777:12: branch_true: following ‘true’ branch...
criu-4.2/criu/files-reg.c:1779:28: branch_true: ...to here
criu-4.2/criu/files-reg.c:1779:28: acquire_memory: allocated here
criu-4.2/criu/files-reg.c:1779:28: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files-reg.c:1779:17: branch_false: ...to here
criu-4.2/criu/files-reg.c:1834:16: call_function: calling ‘img_from_set’ from ‘dump_one_reg_file’
criu-4.2/criu/files-reg.c:1834:16: return_function: returning to ‘dump_one_reg_file’ from ‘img_from_set’
criu-4.2/criu/files-reg.c:1835:15: throw: if ‘pb_write_one’ throws an exception...
criu-4.2/criu/files-reg.c:1835:15: danger: ‘___p’ leaks here; was allocated at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
# 1833|   
# 1834|   	rimg = img_from_set(glob_imgset, CR_FD_FILES);
# 1835|-> 	ret = pb_write_one(rimg, &fe, PB_FILE);
# 1836|   
# 1837|   	if (rfe.build_id)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def259]
criu-4.2/criu/files-reg.c:1858:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files-reg.c:1858:9: branch_true: following ‘true’ branch...
criu-4.2/criu/files-reg.c:1858:9: branch_true: ...to here
criu-4.2/criu/files-reg.c:1858:9: danger: dereference of NULL ‘0’
# 1856|   	 */
# 1857|   	off = strlen(smi->ns_mountpoint + 1);
# 1858|-> 	BUG_ON(strlen(smi->root) < strlen(dmi->root));
# 1859|   
# 1860|   	/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def260]
criu-4.2/criu/files-reg.c:1967:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files-reg.c:1963:16: branch_true: following ‘true’ branch (when ‘count > 0’)...
criu-4.2/criu/files-reg.c:1964:21: branch_true: ...to here
criu-4.2/criu/files-reg.c:1965:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
criu-4.2/criu/files-reg.c:1967:25: branch_true: ...to here
criu-4.2/criu/files-reg.c:1967:25: branch_false: following ‘false’ branch (when ‘prev’ is NULL)...
criu-4.2/criu/files-reg.c:1968:25: branch_false: ...to here
criu-4.2/criu/files-reg.c:1981:20: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:1985:17: branch_false: ...to here
criu-4.2/criu/files-reg.c:1963:16: branch_true: following ‘true’ branch (when ‘count > 0’)...
criu-4.2/criu/files-reg.c:1964:21: branch_true: ...to here
criu-4.2/criu/files-reg.c:1965:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
criu-4.2/criu/files-reg.c:1967:25: branch_true: ...to here
criu-4.2/criu/files-reg.c:1967:25: danger: dereference of NULL ‘0’
# 1965|   		if (p) {
# 1966|   			/* We don't handle "//" in path */
# 1967|-> 			BUG_ON(prev && (prev - p == 1));
# 1968|   			*p = '\0';
# 1969|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def261]
criu-4.2/criu/files-reg.c:2090:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files-reg.c:2058:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2066:14: branch_false: ...to here
criu-4.2/criu/files-reg.c:2067:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2070:13: branch_false: ...to here
criu-4.2/criu/files-reg.c:2070:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2078:15: branch_false: ...to here
criu-4.2/criu/files-reg.c:2079:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2079:12: branch_false: ...to here
criu-4.2/criu/files-reg.c:2090:9: branch_true: following ‘true’ branch...
criu-4.2/criu/files-reg.c:2090:9: branch_true: ...to here
criu-4.2/criu/files-reg.c:2090:9: danger: dereference of NULL ‘0’
# 2088|   		;
# 2089|   
# 2090|-> 	BUG_ON(tmi->s_dev != rmi->s_dev);
# 2091|   	BUG_ON(tmi->s_dev != mi->s_dev);
# 2092|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def262]
criu-4.2/criu/files-reg.c:2091:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files-reg.c:2058:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2066:14: branch_false: ...to here
criu-4.2/criu/files-reg.c:2067:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2070:13: branch_false: ...to here
criu-4.2/criu/files-reg.c:2070:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2078:15: branch_false: ...to here
criu-4.2/criu/files-reg.c:2079:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2079:12: branch_false: ...to here
criu-4.2/criu/files-reg.c:2090:9: branch_false: following ‘false’ branch...
criu-4.2/criu/files-reg.c:2091:9: branch_false: ...to here
criu-4.2/criu/files-reg.c:2091:9: branch_true: following ‘true’ branch...
criu-4.2/criu/files-reg.c:2091:9: branch_true: ...to here
criu-4.2/criu/files-reg.c:2091:9: danger: dereference of NULL ‘0’
# 2089|   
# 2090|   	BUG_ON(tmi->s_dev != rmi->s_dev);
# 2091|-> 	BUG_ON(tmi->s_dev != mi->s_dev);
# 2092|   
# 2093|   	/* Calculate paths on the device (root mount) */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def263]
criu-4.2/criu/files-reg.c:2478:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 2476|   	 */
# 2477|   
# 2478|-> 	BUG_ON((vma->vmfd == NULL) || !vma->e->has_fdflags);
# 2479|   	flags = vma->e->fdflags;
# 2480|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def264]
criu-4.2/criu/files.c:205:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  203|   
#  204|   	item = pstree_item_by_virt(virt);
#  205|-> 	BUG_ON(!item);
#  206|   
#  207|   	is_set = !!test_and_set_bit_le(FDS_EVENT_BIT, &item->task_st_le_bits);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def265]
criu-4.2/criu/files.c:225:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:225:9: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:225:9: danger: dereference of NULL ‘0’
#  223|   
#  224|   	value = htole32(FDS_EVENT);
#  225|-> 	futex_wait_if_cond(f, value, &);
#  226|   	clear_fds_event();
#  227|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def266]
criu-4.2/criu/files.c:244:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  242|   	if (!fle) {
#  243|   		pr_err("Empty list on file desc id %#x(%d)\n", d->id, d->ops ? d->ops->type : -1);
#  244|-> 		BUG();
#  245|   	}
#  246|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
criu-4.2/criu/files.c:637:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files.c:633:16: acquire_memory: allocated here
criu-4.2/criu/files.c:633:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:637:16: branch_false: ...to here
criu-4.2/criu/files.c:637:16: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/files.c:637:16: branch_true: ...to here
criu-4.2/criu/files.c:637:16: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/files.c:637:16: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  635|   		goto err;
#  636|   
#  637|-> 	opts = xmalloc(nr_fds * sizeof(struct fd_opts));
#  638|   	if (!opts)
#  639|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def268]
criu-4.2/criu/files.c:641:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files.c:633:16: acquire_memory: allocated here
criu-4.2/criu/files.c:633:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:637:16: branch_false: ...to here
criu-4.2/criu/files.c:637:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:641:15: branch_false: ...to here
criu-4.2/criu/files.c:641:15: throw: if ‘open_image_at’ throws an exception...
criu-4.2/criu/files.c:641:15: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  639|   		goto err;
#  640|   
#  641|-> 	img = open_image(CR_FD_FDINFO, O_DUMP, item->ids->files_id);
#  642|   	if (!img)
#  643|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
criu-4.2/criu/files.c:650:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files.c:633:16: acquire_memory: allocated here
criu-4.2/criu/files.c:633:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:637:16: branch_false: ...to here
criu-4.2/criu/files.c:637:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:641:15: branch_false: ...to here
criu-4.2/criu/files.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:642:12: branch_false: ...to here
criu-4.2/criu/files.c:646:23: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:647:20: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:650:23: branch_false: ...to here
criu-4.2/criu/files.c:650:23: throw: if ‘parasite_drain_fds_seized’ throws an exception...
criu-4.2/criu/files.c:650:23: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  648|   			nr_fds = dfds->nr_fds - off;
#  649|   
#  650|-> 		ret = parasite_drain_fds_seized(ctl, dfds, nr_fds, off, lfds, opts);
#  651|   		if (ret)
#  652|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
criu-4.2/criu/files.c:670:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files.c:633:16: acquire_memory: allocated here
criu-4.2/criu/files.c:633:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:637:16: branch_false: ...to here
criu-4.2/criu/files.c:637:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:641:15: branch_false: ...to here
criu-4.2/criu/files.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:642:12: branch_false: ...to here
criu-4.2/criu/files.c:646:23: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/files.c:646:41: branch_true: ...to here
criu-4.2/criu/files.c:646:23: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:670:9: branch_false: ...to here
criu-4.2/criu/files.c:670:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/files.c:670:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  668|   	}
#  669|   
#  670|-> 	pr_info("----------------------------------------\n");
#  671|   err:
#  672|   	if (img)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
criu-4.2/criu/files.c:673:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files.c:633:16: acquire_memory: allocated here
criu-4.2/criu/files.c:633:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:637:16: branch_false: ...to here
criu-4.2/criu/files.c:637:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:641:15: branch_false: ...to here
criu-4.2/criu/files.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:642:12: branch_false: ...to here
criu-4.2/criu/files.c:646:23: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/files.c:646:41: branch_true: ...to here
criu-4.2/criu/files.c:646:23: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:670:9: branch_false: ...to here
criu-4.2/criu/files.c:673:17: throw: if ‘close_image’ throws an exception...
criu-4.2/criu/files.c:673:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  671|   err:
#  672|   	if (img)
#  673|-> 		close_image(img);
#  674|   	xfree(opts);
#  675|   	xfree(lfds);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
criu-4.2/criu/files.c:722:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pid, 0, "fd"))’
criu-4.2/criu/files.c:718:18: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:718:18: branch_false: ...to here
criu-4.2/criu/files.c:718:18: acquire_memory: allocated here
criu-4.2/criu/files.c:718:18: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:719:12: branch_false: ...to here
criu-4.2/criu/files.c:719:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:719:12: branch_false: ...to here
criu-4.2/criu/files.c:722:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/files.c:722:22: danger: ‘fdopendir(do_open_proc(pid, 0, "fd"))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  720|   		return -1;
#  721|   
#  722|-> 	while ((de = readdir(fd_dir))) {
#  723|   		if (dir_dots(de))
#  724|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
criu-4.2/criu/files.c:998:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:998:9: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:998:9: branch_true: ...to here
criu-4.2/criu/files.c:998:9: danger: dereference of NULL ‘0’
#  996|   static int plant_fd(struct fdinfo_list_entry *fle, int fd)
#  997|   {
#  998|-> 	BUG_ON(fle->received);
#  999|   	fle->received = 1;
# 1000|   	return reopen_fd_as(fle->fe->fd, fd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def274]
criu-4.2/criu/files.c:1072:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:1069:12: branch_false: following ‘false’ branch (when ‘dfd != fd’)...
criu-4.2/criu/files.c:1072:9: branch_false: ...to here
criu-4.2/criu/files.c:1072:9: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1072:9: branch_true: ...to here
criu-4.2/criu/files.c:1072:9: danger: dereference of NULL ‘0’
# 1070|   		return 0;
# 1071|   
# 1072|-> 	BUG_ON(dfd == get_service_fd(TRANSPORT_FD_OFF));
# 1073|   
# 1074|   	pr_info("\t\t\tGoing to dup %d into %d\n", fd, dfd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def275]
criu-4.2/criu/files.c:1075:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd,  dfd)’
criu-4.2/criu/files.c:1069:12: branch_false: following ‘false’ branch (when ‘dfd != fd’)...
criu-4.2/criu/files.c:1072:9: branch_false: ...to here
criu-4.2/criu/files.c:1072:9: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1074:9: branch_false: ...to here
criu-4.2/criu/files.c:1075:13: acquire_resource: opened here
criu-4.2/criu/files.c:1075:12: danger: ‘dup2(fd,  dfd)’ leaks here; was opened at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 1073|   
# 1074|   	pr_info("\t\t\tGoing to dup %d into %d\n", fd, dfd);
# 1075|-> 	if (dup2(fd, dfd) != dfd) {
# 1076|   		pr_perror("Can't dup local fd %d -> %d", fd, dfd);
# 1077|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def276]
criu-4.2/criu/files.c:1127:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:1119:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1122:41: branch_false: ...to here
criu-4.2/criu/files.c:1122:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1127:9: branch_false: ...to here
criu-4.2/criu/files.c:1127:9: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1127:9: branch_true: ...to here
criu-4.2/criu/files.c:1127:9: danger: dereference of NULL ‘0’
# 1125|   	}
# 1126|   
# 1127|-> 	BUG_ON(fle->stage != FLE_INITIALIZED);
# 1128|   	fle->stage = FLE_OPEN;
# 1129|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def277]
criu-4.2/criu/files.c:1143:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:1135:12: enter_function: entry to ‘open_fd’
criu-4.2/criu/files.c:1141:17: call_function: calling ‘file_master’ from ‘open_fd’
criu-4.2/criu/files.c:1141:17: return_function: returning to ‘open_fd’ from ‘file_master’
criu-4.2/criu/files.c:1142:12: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1143:17: branch_true: ...to here
criu-4.2/criu/files.c:1143:17: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1143:17: branch_true: ...to here
criu-4.2/criu/files.c:1143:17: danger: dereference of NULL ‘0’
# 1141|   	fle_m = file_master(d);
# 1142|   	if (fle != fle_m) {
# 1143|-> 		BUG_ON(fle->stage != FLE_INITIALIZED);
# 1144|   		ret = receive_fd(fle);
# 1145|   		if (ret != 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
criu-4.2/criu/files.c:1218:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:1216:17: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1217:30: branch_true: ...to here
criu-4.2/criu/files.c:1218:25: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1218:25: branch_true: ...to here
criu-4.2/criu/files.c:1218:25: danger: dereference of NULL ‘0’
# 1216|   		list_for_each_entry_safe(fle, tmp, list, ps_list) {
# 1217|   			st = fle->stage;
# 1218|-> 			BUG_ON(st == FLE_RESTORED);
# 1219|   			ret = open_fd(fle);
# 1220|   			if (ret == -1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def279]
criu-4.2/criu/files.c:1276:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(0, 0, "fd"))’
criu-4.2/criu/files.c:1272:15: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1272:15: branch_false: ...to here
criu-4.2/criu/files.c:1272:15: acquire_memory: allocated here
criu-4.2/criu/files.c:1272:15: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1273:12: branch_false: ...to here
criu-4.2/criu/files.c:1273:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1273:12: branch_false: ...to here
criu-4.2/criu/files.c:1276:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/files.c:1276:22: danger: ‘fdopendir(do_open_proc(0, 0, "fd"))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
# 1274|   		return -1;
# 1275|   
# 1276|-> 	while ((de = readdir(dir))) {
# 1277|   		if (dir_dots(de))
# 1278|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def280]
criu-4.2/criu/files.c:1323:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:1298:5: enter_function: entry to ‘prepare_fds’
criu-4.2/criu/files.c:1314:12: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1322:17: branch_true: ...to here
criu-4.2/criu/files.c:1322:17: call_function: calling ‘futex_inc_and_wake’ from ‘prepare_fds’
criu-4.2/criu/files.c:1322:17: return_function: returning to ‘prepare_fds’ from ‘futex_inc_and_wake’
criu-4.2/criu/files.c:1323:17: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1323:17: danger: dereference of NULL ‘0’
# 1321|   		 */
# 1322|   		futex_inc_and_wake(&fdt->fdt_lock);
# 1323|-> 		futex_wait_while_lt(&fdt->fdt_lock, fdt->nr);
# 1324|   
# 1325|   		if (fdt->pid != vpid(me)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def281]
criu-4.2/criu/files.c:1327:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/files.c:1298:5: enter_function: entry to ‘prepare_fds’
criu-4.2/criu/files.c:1314:12: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1322:17: branch_true: ...to here
criu-4.2/criu/files.c:1322:17: call_function: calling ‘futex_inc_and_wake’ from ‘prepare_fds’
criu-4.2/criu/files.c:1322:17: return_function: returning to ‘prepare_fds’ from ‘futex_inc_and_wake’
criu-4.2/criu/files.c:1325:20: branch_true: following ‘true’ branch...
criu-4.2/criu/files.c:1326:25: branch_true: ...to here
criu-4.2/criu/files.c:1327:25: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1327:25: danger: dereference of NULL ‘0’
# 1325|   		if (fdt->pid != vpid(me)) {
# 1326|   			pr_info("File descriptor table is shared with %d\n", fdt->pid);
# 1327|-> 			futex_wait_until(&fdt->fdt_lock, fdt->nr + 1);
# 1328|   			goto out;
# 1329|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
criu-4.2/criu/files.c:1608:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files.c:1596:12: branch_false: following ‘false’ branch...
criu-4.2/criu/files.c:1601:15: branch_false: ...to here
criu-4.2/criu/files.c:1601:15: acquire_memory: allocated here
criu-4.2/criu/files.c:1601:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files.c:1605:13: branch_false: ...to here
criu-4.2/criu/files.c:1608:23: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/files.c:1608:23: branch_true: ...to here
criu-4.2/criu/files.c:1608:23: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/files.c:1608:23: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
# 1606|   		inh_fd_max = fd;
# 1607|   
# 1608|-> 	inh->inh_id = xstrdup(key);
# 1609|   	if (inh->inh_id == NULL) {
# 1610|   		xfree(inh);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def283]
criu-4.2/criu/filesystems.c:404:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/filesystems.c:386:12: branch_false: following ‘false’ branch...
criu-4.2/criu/filesystems.c:386:12: branch_false: ...to here
criu-4.2/criu/filesystems.c:393:21: branch_true: following ‘true’ branch (when ‘ntmp_fds != 3’)...
criu-4.2/criu/filesystems.c:394:21: branch_true: ...to here
criu-4.2/criu/filesystems.c:394:20: branch_false: following ‘false’ branch...
criu-4.2/criu/filesystems.c:396:25: branch_false: ...to here
criu-4.2/criu/filesystems.c:397:22: acquire_resource: opened here
criu-4.2/criu/filesystems.c:398:20: branch_false: following ‘false’ branch...
criu-4.2/criu/filesystems.c:398:20: branch_false: ...to here
criu-4.2/criu/filesystems.c:393:21: branch_true: following ‘true’ branch (when ‘ntmp_fds != 3’)...
criu-4.2/criu/filesystems.c:394:21: branch_true: ...to here
criu-4.2/criu/filesystems.c:404:13: throw: if ‘move_fd_from’ throws an exception...
criu-4.2/criu/filesystems.c:404:13: danger: ‘fd’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  402|   	}
#  403|   
#  404|-> 	if (move_fd_from(&fd, STDIN_FILENO) < 0)
#  405|   		goto out;
#  406|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
criu-4.2/criu/filesystems.c:537:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(open_mountpoint(pm))’
criu-4.2/criu/filesystems.c:528:12: branch_false: following ‘false’ branch...
criu-4.2/criu/filesystems.c:531:16: branch_false: ...to here
criu-4.2/criu/filesystems.c:531:16: acquire_memory: allocated here
criu-4.2/criu/filesystems.c:532:12: branch_false: following ‘false’ branch...
criu-4.2/criu/filesystems.c:532:12: branch_false: ...to here
criu-4.2/criu/filesystems.c:537:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/filesystems.c:537:22: danger: ‘fdopendir(open_mountpoint(pm))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  535|   	}
#  536|   
#  537|-> 	while ((de = readdir(fdir))) {
#  538|   		int id;
#  539|   		struct mount_info *it;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
criu-4.2/criu/fsnotify.c:94:24: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_openable(s_dev,  i_ino,  f_handle)’
criu-4.2/criu/fsnotify.c:226:5: enter_function: entry to ‘check_open_handle’
criu-4.2/criu/fsnotify.c:231:12: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:245:16: branch_false: ...to here
criu-4.2/criu/fsnotify.c:245:16: call_function: calling ‘alloc_openable’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:245:16: return_function: returning to ‘check_open_handle’ from ‘alloc_openable’
criu-4.2/criu/fsnotify.c:247:14: call_function: inlined call to ‘IS_ERR_OR_NULL’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:248:17: branch_false: ...to here
criu-4.2/criu/fsnotify.c:248:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/fsnotify.c:94:24: danger: ‘alloc_openable(s_dev,  i_ino,  f_handle)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#   92|   	memzero(handle, sizeof(*handle));
#   93|   
#   94|-> 	handle->type = img->type;
#   95|   	handle->bytes = img->bytes;
#   96|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def286]
criu-4.2/criu/fsnotify.c:263:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/fsnotify.c:226:5: enter_function: entry to ‘check_open_handle’
criu-4.2/criu/fsnotify.c:231:12: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:245:16: branch_false: ...to here
criu-4.2/criu/fsnotify.c:245:16: call_function: calling ‘alloc_openable’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:245:16: return_function: returning to ‘check_open_handle’ from ‘alloc_openable’
criu-4.2/criu/fsnotify.c:247:14: call_function: inlined call to ‘IS_ERR_OR_NULL’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:250:20: call_function: inlined call to ‘IS_ERR’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:250:19: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:250:20: branch_true: ...to here
criu-4.2/criu/fsnotify.c:250:20: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:252:19: branch_false: ...to here
criu-4.2/criu/fsnotify.c:252:19: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:252:20: branch_true: ...to here
criu-4.2/criu/fsnotify.c:252:20: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:256:14: branch_false: ...to here
criu-4.2/criu/fsnotify.c:257:12: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:262:14: branch_false: ...to here
criu-4.2/criu/fsnotify.c:262:12: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:263:17: call_function: inlined call to ‘PTR_ERR’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:263:17: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/13)
#  261|   
#  262|   	if ((mi->fstype->code == FSTYPE__TMPFS) || (mi->fstype->code == FSTYPE__DEVTMPFS)) {
#  263|-> 		pr_err("Can't find suitable path for handle (dev %#x ino %#lx): %d\n", s_dev, i_ino,
#  264|   		       (int)PTR_ERR(path));
#  265|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
criu-4.2/criu/fsnotify.c:291:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/fsnotify.c:283:12: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:287:16: branch_false: ...to here
criu-4.2/criu/fsnotify.c:287:16: acquire_memory: allocated here
criu-4.2/criu/fsnotify.c:287:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/fsnotify.c:290:1: branch_false: ...to here
criu-4.2/criu/fsnotify.c:291:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/fsnotify.c:291:9: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  289|   		goto err;
#  290|   out:
#  291|-> 	pr_debug("\tDumping %s as path for handle\n", path);
#  292|   	f_handle->path = path;
#  293|   out_nopath:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def288]
criu-4.2/criu/fsnotify.c:291:9: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
criu-4.2/criu/fsnotify.c:226:5: enter_function: entry to ‘check_open_handle’
criu-4.2/criu/fsnotify.c:231:12: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:245:16: branch_false: ...to here
criu-4.2/criu/fsnotify.c:245:16: call_function: calling ‘alloc_openable’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:245:16: return_function: returning to ‘check_open_handle’ from ‘alloc_openable’
criu-4.2/criu/fsnotify.c:247:14: call_function: inlined call to ‘IS_ERR_OR_NULL’ from ‘check_open_handle’
criu-4.2/criu/fsnotify.c:248:17: branch_false: ...to here
criu-4.2/criu/fsnotify.c:291:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/fsnotify.c:291:9: danger: ‘path’ leaks here; was allocated at [(14)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/13)
#  289|   		goto err;
#  290|   out:
#  291|-> 	pr_debug("\tDumping %s as path for handle\n", path);
#  292|   	f_handle->path = path;
#  293|   out_nopath:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def289]
criu-4.2/criu/fsnotify.c:384:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/fsnotify.c:383:12: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:384:17: branch_true: ...to here
criu-4.2/criu/fsnotify.c:384:17: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:384:17: branch_true: ...to here
criu-4.2/criu/fsnotify.c:384:17: danger: dereference of NULL ‘0’
#  382|   {
#  383|   	if (fme->type == MARK_TYPE__INODE) {
#  384|-> 		BUG_ON(!fme->ie);
#  385|   
#  386|   		pr_info("mark: s_dev %#08x i_ino %#016" PRIx64 " mask %#08x\n", fme->s_dev, fme->ie->i_ino, fme->mask);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def290]
criu-4.2/criu/fsnotify.c:399:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/fsnotify.c:383:12: branch_false: following ‘false’ branch...
criu-4.2/criu/fsnotify.c:396:13: branch_false: ...to here
criu-4.2/criu/fsnotify.c:396:12: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:399:17: branch_true: ...to here
criu-4.2/criu/fsnotify.c:399:17: branch_true: following ‘true’ branch...
criu-4.2/criu/fsnotify.c:399:17: branch_true: ...to here
criu-4.2/criu/fsnotify.c:399:17: danger: dereference of NULL ‘0’
#  397|   		struct mount_info *m;
#  398|   
#  399|-> 		BUG_ON(!fme->me);
#  400|   
#  401|   		m = lookup_mnt_id(fme->me->mnt_id);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def291]
criu-4.2/criu/image.c:417:28: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  415|   		return NULL;
#  416|   
#  417|-> 	cr_imgset->_imgs = xmalloc(nr * sizeof(struct cr_img *));
#  418|   	if (cr_imgset->_imgs == NULL) {
#  419|   		xfree(cr_imgset);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def292]
criu-4.2/criu/image.c:509:23: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  507|   
#  508|   	if (dfd == -1) {
#  509|-> 		dfd = get_service_fd(IMG_FD_OFF);
#  510|   		lazy = (flags & O_CREAT);
#  511|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def293]
criu-4.2/criu/image.c:513:15: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  511|   	}
#  512|   
#  513|-> 	img = xmalloc(sizeof(*img));
#  514|   	if (!img)
#  515|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def294]
criu-4.2/criu/image.c:527:29: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_true: following ‘true’ branch (when ‘lazy != 0’)...
criu-4.2/criu/image.c:524:17: branch_true: ...to here
criu-4.2/criu/image.c:527:29: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/image.c:527:29: branch_true: ...to here
criu-4.2/criu/image.c:527:29: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/image.c:527:29: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  525|   		img->type = type;
#  526|   		img->oflags = oflags;
#  527|-> 		img->path = xstrdup(path);
#  528|   		return img;
#  529|   	} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def295]
criu-4.2/criu/image.c:527:29: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  525|   		img->type = type;
#  526|   		img->oflags = oflags;
#  527|-> 		img->path = xstrdup(path);
#  528|   		return img;
#  529|   	} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def296]
criu-4.2/criu/image.c:609:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:500:16: enter_function: entry to ‘open_image_at’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_false: following ‘false’ branch (when ‘lazy == 0’)...
criu-4.2/criu/image.c:530:17: branch_false: ...to here
criu-4.2/criu/image.c:532:13: call_function: calling ‘do_open_image’ from ‘open_image_at’
#  607|   
#  608|   	if (opts.stream && !(oflags & O_FORCE_LOCAL)) {
#  609|-> 		ret = img_streamer_open(path, flags);
#  610|   		errno = EIO; /* errno value is meaningless, only the ret value is meaningful */
#  611|   	} else if (root_ns_mask & CLONE_NEWUSER && type == CR_FD_PAGES && oflags & O_RDWR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def297]
criu-4.2/criu/image.c:609:23: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  607|   
#  608|   	if (opts.stream && !(oflags & O_FORCE_LOCAL)) {
#  609|-> 		ret = img_streamer_open(path, flags);
#  610|   		errno = EIO; /* errno value is meaningless, only the ret value is meaningful */
#  611|   	} else if (root_ns_mask & CLONE_NEWUSER && type == CR_FD_PAGES && oflags & O_RDWR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
criu-4.2/criu/image.c:623:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:500:16: enter_function: entry to ‘open_image_at’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_false: following ‘false’ branch (when ‘lazy == 0’)...
criu-4.2/criu/image.c:530:17: branch_false: ...to here
criu-4.2/criu/image.c:532:13: call_function: calling ‘do_open_image’ from ‘open_image_at’
#  621|   		};
#  622|   		snprintf(pa.path, PATH_MAX, "%s", path);
#  623|-> 		ret = userns_call(userns_openat, UNS_FDOUT, &pa, sizeof(struct openat_args), dfd);
#  624|   		if (ret < 0)
#  625|   			errno = pa.err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
criu-4.2/criu/image.c:627:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:500:16: enter_function: entry to ‘open_image_at’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_false: following ‘false’ branch (when ‘lazy == 0’)...
criu-4.2/criu/image.c:530:17: branch_false: ...to here
criu-4.2/criu/image.c:532:13: call_function: calling ‘do_open_image’ from ‘open_image_at’
#  625|   			errno = pa.err;
#  626|   	} else
#  627|-> 		ret = openat(dfd, path, flags, CR_FD_PERM);
#  628|   	if (ret < 0) {
#  629|   		if (!(flags & O_CREAT) && (errno == ENOENT || ret == -ENOENT)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
criu-4.2/criu/image.c:627:23: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  625|   			errno = pa.err;
#  626|   	} else
#  627|-> 		ret = openat(dfd, path, flags, CR_FD_PERM);
#  628|   	if (ret < 0) {
#  629|   		if (!(flags & O_CREAT) && (errno == ENOENT || ret == -ENOENT)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
criu-4.2/criu/image.c:630:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:500:16: enter_function: entry to ‘open_image_at’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_false: following ‘false’ branch (when ‘lazy == 0’)...
criu-4.2/criu/image.c:530:17: branch_false: ...to here
criu-4.2/criu/image.c:532:13: call_function: calling ‘do_open_image’ from ‘open_image_at’
#  628|   	if (ret < 0) {
#  629|   		if (!(flags & O_CREAT) && (errno == ENOENT || ret == -ENOENT)) {
#  630|-> 			pr_info("No %s image\n", path);
#  631|   			img->_x.fd = EMPTY_IMG_FD;
#  632|   			goto skip_magic;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
criu-4.2/criu/image.c:630:25: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  628|   	if (ret < 0) {
#  629|   		if (!(flags & O_CREAT) && (errno == ENOENT || ret == -ENOENT)) {
#  630|-> 			pr_info("No %s image\n", path);
#  631|   			img->_x.fd = EMPTY_IMG_FD;
#  632|   			goto skip_magic;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def303]
criu-4.2/criu/image.c:635:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:500:16: enter_function: entry to ‘open_image_at’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_false: following ‘false’ branch (when ‘lazy == 0’)...
criu-4.2/criu/image.c:530:17: branch_false: ...to here
criu-4.2/criu/image.c:532:13: call_function: calling ‘do_open_image’ from ‘open_image_at’
#  633|   		}
#  634|   
#  635|-> 		pr_perror("Unable to open %s", path);
#  636|   		goto err;
#  637|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def304]
criu-4.2/criu/image.c:635:17: warning[-Wanalyzer-malloc-leak]: leak of ‘imgset’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  633|   		}
#  634|   
#  635|-> 		pr_perror("Unable to open %s", path);
#  636|   		goto err;
#  637|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def305]
criu-4.2/criu/image.c:644:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:500:16: enter_function: entry to ‘open_image_at’
criu-4.2/criu/image.c:513:15: acquire_memory: allocated here
criu-4.2/criu/image.c:513:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:517:26: branch_false: ...to here
criu-4.2/criu/image.c:523:12: branch_false: following ‘false’ branch (when ‘lazy == 0’)...
criu-4.2/criu/image.c:530:17: branch_false: ...to here
criu-4.2/criu/image.c:532:13: call_function: calling ‘do_open_image’ from ‘open_image_at’
#  642|   	else {
#  643|   		if (flags == O_RDONLY)
#  644|-> 			ret = bfdopenr(&img->_x);
#  645|   		else
#  646|   			ret = bfdopenw(&img->_x);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def306]
criu-4.2/criu/image.c:646:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:493:19: enter_function: entry to ‘cr_glob_imgset_open’
criu-4.2/criu/image.c:495:16: call_function: calling ‘cr_imgset_open_range’ from ‘cr_glob_imgset_open’
#  644|   			ret = bfdopenr(&img->_x);
#  645|   		else
#  646|-> 			ret = bfdopenw(&img->_x);
#  647|   
#  648|   		if (ret)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def307]
criu-4.2/criu/image.c:730:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dir, 0)’
criu-4.2/criu/image.c:724:14: acquire_resource: opened here
criu-4.2/criu/image.c:725:12: branch_false: following ‘false’ branch...
criu-4.2/criu/image.c:730:15: branch_false: ...to here
criu-4.2/criu/image.c:730:15: danger: ‘open(dir, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  728|   	}
#  729|   
#  730|-> 	ret = install_service_fd(IMG_FD_OFF, fd);
#  731|   	if (ret < 0) {
#  732|   		pr_err("install_service_fd failed.\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def308]
criu-4.2/criu/image.c:803:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/image.c:803:9: branch_true: following ‘true’ branch...
criu-4.2/criu/image.c:803:9: branch_true: ...to here
criu-4.2/criu/image.c:803:9: danger: dereference of NULL ‘0’
#  801|   	 */
#  802|   
#  803|-> 	BUG_ON(page_ids != 1);
#  804|   	page_ids += 0x10000;
#  805|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def309]
criu-4.2/criu/image.c:862:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/image.c:899:5: enter_function: entry to ‘read_img_str’
criu-4.2/criu/image.c:904:15: acquire_memory: allocated here
criu-4.2/criu/image.c:904:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/image.c:908:15: branch_false: ...to here
criu-4.2/criu/image.c:908:15: call_function: calling ‘read_img_buf’ from ‘read_img_str’
#  860|   	int ret;
#  861|   
#  862|-> 	ret = bread(&img->_x, ptr, size);
#  863|   	if (ret == size)
#  864|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def310]
criu-4.2/criu/img-streamer.c:41:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’
criu-4.2/criu/img-streamer.c:50:5: enter_function: entry to ‘img_streamer_init’
criu-4.2/criu/img-streamer.c:59:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:64:18: branch_false: ...to here
criu-4.2/criu/img-streamer.c:64:18: acquire_resource: stream socket created here
criu-4.2/criu/img-streamer.c:65:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)...
criu-4.2/criu/img-streamer.c:70:9: branch_false: ...to here
criu-4.2/criu/img-streamer.c:72:9: call_function: calling ‘socket_name_for_mode’ from ‘img_streamer_init’
#   39|   		return IMG_STREAMER_SERVE_SOCKET_NAME;
#   40|   	default:
#   41|-> 		BUG();
#   42|   		return NULL;
#   43|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def311]
criu-4.2/criu/img-streamer.c:41:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#   39|   		return IMG_STREAMER_SERVE_SOCKET_NAME;
#   40|   	default:
#   41|-> 		BUG();
#   42|   		return NULL;
#   43|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def312]
criu-4.2/criu/img-streamer.c:74:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’
criu-4.2/criu/img-streamer.c:59:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:64:18: branch_false: ...to here
criu-4.2/criu/img-streamer.c:64:18: acquire_resource: stream socket created here
criu-4.2/criu/img-streamer.c:65:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)...
criu-4.2/criu/img-streamer.c:70:9: branch_false: ...to here
criu-4.2/criu/img-streamer.c:74:13: throw: if ‘connect’ throws an exception...
criu-4.2/criu/img-streamer.c:74:13: danger: ‘sockfd’ leaks here
#   72|   	snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s", image_dir, socket_name_for_mode(mode));
#   73|   
#   74|-> 	if (connect(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
#   75|   		pr_perror("Unable to connect to image streamer socket: %s", addr.sun_path);
#   76|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def313]
criu-4.2/criu/img-streamer.c:183:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:183:24: danger: ‘fds[0]’ leaks here
#  181|   	if (pipe(fds) < 0) {
#  182|   		pr_perror("Unable to create pipe");
#  183|-> 		return -1;
#  184|   	}
#  185|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def314]
criu-4.2/criu/img-streamer.c:183:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:183:24: danger: ‘fds[1]’ leaks here
#  181|   	if (pipe(fds) < 0) {
#  182|   		pr_perror("Unable to create pipe");
#  183|-> 		return -1;
#  184|   	}
#  185|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def315]
criu-4.2/criu/img-streamer.c:186:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:186:13: throw: if ‘get_service_fd’ throws an exception...
criu-4.2/criu/img-streamer.c:186:13: danger: ‘fds[0]’ leaks here
#  184|   	}
#  185|   
#  186|-> 	if (send_fd(get_service_fd(IMG_STREAMER_FD_OFF), NULL, 0, fds[streamer_pipe_direction]) < 0)
#  187|   		close(fds[criu_pipe_direction]);
#  188|   	else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def316]
criu-4.2/criu/img-streamer.c:186:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:186:13: throw: if ‘get_service_fd’ throws an exception...
criu-4.2/criu/img-streamer.c:186:13: danger: ‘fds[1]’ leaks here
#  184|   	}
#  185|   
#  186|-> 	if (send_fd(get_service_fd(IMG_STREAMER_FD_OFF), NULL, 0, fds[streamer_pipe_direction]) < 0)
#  187|   		close(fds[criu_pipe_direction]);
#  188|   	else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def317]
criu-4.2/criu/img-streamer.c:187:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:186:12: branch_true: following ‘true’ branch...
criu-4.2/criu/img-streamer.c:187:17: branch_true: ...to here
criu-4.2/criu/img-streamer.c:187:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/img-streamer.c:187:17: danger: ‘fds[0]’ leaks here
#  185|   
#  186|   	if (send_fd(get_service_fd(IMG_STREAMER_FD_OFF), NULL, 0, fds[streamer_pipe_direction]) < 0)
#  187|-> 		close(fds[criu_pipe_direction]);
#  188|   	else
#  189|   		ret = fds[criu_pipe_direction];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def318]
criu-4.2/criu/img-streamer.c:187:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:186:12: branch_true: following ‘true’ branch...
criu-4.2/criu/img-streamer.c:187:17: branch_true: ...to here
criu-4.2/criu/img-streamer.c:187:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/img-streamer.c:187:17: danger: ‘fds[1]’ leaks here
#  185|   
#  186|   	if (send_fd(get_service_fd(IMG_STREAMER_FD_OFF), NULL, 0, fds[streamer_pipe_direction]) < 0)
#  187|-> 		close(fds[criu_pipe_direction]);
#  188|   	else
#  189|   		ret = fds[criu_pipe_direction];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def319]
criu-4.2/criu/img-streamer.c:191:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:191:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/img-streamer.c:191:9: danger: ‘fds[0]’ leaks here
#  189|   		ret = fds[criu_pipe_direction];
#  190|   
#  191|-> 	close(fds[streamer_pipe_direction]);
#  192|   
#  193|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def320]
criu-4.2/criu/img-streamer.c:191:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:191:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/img-streamer.c:191:9: danger: ‘fds[1]’ leaks here
#  189|   		ret = fds[criu_pipe_direction];
#  190|   
#  191|-> 	close(fds[streamer_pipe_direction]);
#  192|   
#  193|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def321]
criu-4.2/criu/img-streamer.c:234:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/img-streamer.c:234:9: branch_true: following ‘true’ branch...
criu-4.2/criu/img-streamer.c:234:9: branch_true: ...to here
criu-4.2/criu/img-streamer.c:234:9: danger: dereference of NULL ‘0’
#  232|   	int ret;
#  233|   
#  234|-> 	BUG_ON(flags != img_streamer_mode);
#  235|   
#  236|   	mutex_lock(img_streamer_fd_lock);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def322]
criu-4.2/criu/include/image.h:159:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[0]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:441:12: branch_false: following ‘false’ branch (when ‘bytes >= 0’)...
criu-4.2/criu/pipes.c:450:23: call_function: inlined call to ‘pipe_id’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:455:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:455:12: branch_false: ...to here
criu-4.2/criu/pipes.c:458:16: branch_true: following ‘true’ branch (when ‘bytes > 0’)...
criu-4.2/criu/pipes.c:460:25: branch_true: ...to here
criu-4.2/criu/pipes.c:460:25: call_function: calling ‘img_raw_fd’ from ‘dump_one_pipe_data’
#  157|   	if (!img)
#  158|   		return -1;
#  159|-> 	if (lazy_image(img) && open_image_lazy(img))
#  160|   		return -1;
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def323]
criu-4.2/criu/include/image.h:159:32: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2017:19: enter_function: entry to ‘dump_rule’
criu-4.2/criu/net.c:2022:15: call_function: calling ‘img_from_set’ from ‘dump_rule’
criu-4.2/criu/net.c:2022:15: return_function: returning to ‘dump_rule’ from ‘img_from_set’
criu-4.2/criu/net.c:2023:16: acquire_memory: allocated here
criu-4.2/criu/net.c:2023:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2028:13: branch_false: ...to here
criu-4.2/criu/net.c:2028:13: call_function: calling ‘img_raw_fd’ from ‘dump_rule’
#  157|   	if (!img)
#  158|   		return -1;
#  159|-> 	if (lazy_image(img) && open_image_lazy(img))
#  160|   		return -1;
#  161|   

Error: CPPCHECK_WARNING (CWE-476): [#def324]
criu-4.2/criu/include/image.h:162: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  160|   		return -1;
#  161|   
#  162|-> 	BUG_ON(bfd_buffered(&img->_x));
#  163|   	return img->_x.fd;
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def325]
criu-4.2/criu/include/image.h:162:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[0]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:441:12: branch_false: following ‘false’ branch (when ‘bytes >= 0’)...
criu-4.2/criu/pipes.c:450:23: call_function: inlined call to ‘pipe_id’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:455:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:455:12: branch_false: ...to here
criu-4.2/criu/pipes.c:458:16: branch_true: following ‘true’ branch (when ‘bytes > 0’)...
criu-4.2/criu/pipes.c:460:25: branch_true: ...to here
criu-4.2/criu/pipes.c:460:25: call_function: calling ‘img_raw_fd’ from ‘dump_one_pipe_data’
#  160|   		return -1;
#  161|   
#  162|-> 	BUG_ON(bfd_buffered(&img->_x));
#  163|   	return img->_x.fd;
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def326]
criu-4.2/criu/include/image.h:162:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2017:19: enter_function: entry to ‘dump_rule’
criu-4.2/criu/net.c:2022:15: call_function: calling ‘img_from_set’ from ‘dump_rule’
criu-4.2/criu/net.c:2022:15: return_function: returning to ‘dump_rule’ from ‘img_from_set’
criu-4.2/criu/net.c:2023:16: acquire_memory: allocated here
criu-4.2/criu/net.c:2023:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2028:13: branch_false: ...to here
criu-4.2/criu/net.c:2028:13: call_function: calling ‘img_raw_fd’ from ‘dump_rule’
#  160|   		return -1;
#  161|   
#  162|-> 	BUG_ON(bfd_buffered(&img->_x));
#  163|   	return img->_x.fd;
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def327]
criu-4.2/criu/include/image.h:162:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  160|   		return -1;
#  161|   
#  162|-> 	BUG_ON(bfd_buffered(&img->_x));
#  163|   	return img->_x.fd;
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def328]
criu-4.2/criu/include/imgset.h:20:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/files-reg.c:1758:5: enter_function: entry to ‘dump_one_reg_file’
criu-4.2/criu/files-reg.c:1777:12: branch_true: following ‘true’ branch...
criu-4.2/criu/files-reg.c:1779:28: branch_true: ...to here
criu-4.2/criu/files-reg.c:1779:28: acquire_memory: allocated here
criu-4.2/criu/files-reg.c:1779:28: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/files-reg.c:1779:17: branch_false: ...to here
criu-4.2/criu/files-reg.c:1834:16: call_function: calling ‘img_from_set’ from ‘dump_one_reg_file’
#   18|   
#   19|   	idx = type - imgset->fd_off;
#   20|-> 	BUG_ON(idx > imgset->fd_nr);
#   21|   
#   22|   	return imgset->_imgs[idx];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def329]
criu-4.2/criu/include/imgset.h:20:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/apparmor.c:643:5: enter_function: entry to ‘dump_aa_namespaces’
criu-4.2/criu/apparmor.c:648:12: branch_false: following ‘false’ branch...
criu-4.2/criu/apparmor.c:651:14: branch_false: ...to here
criu-4.2/criu/apparmor.c:651:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/apparmor.c:654:9: branch_false: ...to here
criu-4.2/criu/apparmor.c:659:15: call_function: calling ‘img_from_set’ from ‘dump_aa_namespaces’
#   18|   
#   19|   	idx = type - imgset->fd_off;
#   20|-> 	BUG_ON(idx > imgset->fd_nr);
#   21|   
#   22|   	return imgset->_imgs[idx];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
criu-4.2/criu/include/rbtree.h:91:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/kcmp-ids.c:64:26: enter_function: entry to ‘alloc_kid_entry’
criu-4.2/criu/kcmp-ids.c:68:13: acquire_memory: allocated here
criu-4.2/criu/kcmp-ids.c:68:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/kcmp-ids.c:72:20: branch_false: ...to here
criu-4.2/criu/kcmp-ids.c:76:9: branch_false: following ‘false’ branch...
criu-4.2/criu/kcmp-ids.c:78:9: branch_false: ...to here
criu-4.2/criu/kcmp-ids.c:81:9: call_function: inlined call to ‘rb_link_and_balance’ from ‘alloc_kid_entry’
#   89|   {
#   90|   	rb_link_node(node, parent, rb_link);
#   91|-> 	rb_insert_color(node, root);
#   92|   }
#   93|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def331]
criu-4.2/criu/include/util-caps.h:19:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/cr-check.c:1040:12: enter_function: entry to ‘check_tcp’
criu-4.2/criu/cr-check.c:1046:14: acquire_resource: stream socket created here
criu-4.2/criu/cr-check.c:1047:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/cr-check.c:1052:9: branch_false: ...to here
criu-4.2/criu/cr-check.c:1053:12: branch_false: following ‘false’ branch...
criu-4.2/criu/cr-check.c:1053:35: call_function: inlined call to ‘has_cap_net_admin’ from ‘check_tcp’
#   17|   
#   18|   	if (!(mask & effective)) {
#   19|-> 		pr_debug("Effective capability %d missing\n", cap);
#   20|   		return false;
#   21|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def332]
criu-4.2/criu/include/util.h:181:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  179|   static inline bool dir_dots(const struct dirent *de)
#  180|   {
#  181|-> 	return !strcmp(de->d_name, ".") || !strcmp(de->d_name, "..");
#  182|   }
#  183|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def333]
criu-4.2/criu/include/util.h:408:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘before_context’
criu-4.2/criu/mount.c:3193:12: branch_true: following ‘true’ branch (when ‘old_context’ is NULL)...
criu-4.2/criu/mount.c:3194:24: branch_true: ...to here
criu-4.2/criu/mount.c:3194:24: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:3194:24: branch_true: ...to here
criu-4.2/criu/mount.c:3194:24: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:3183:28: call_function: inlined call to ‘cleanup_freep’ from ‘mount_update_lsm_context’
#  406|   {
#  407|   	void **pp = (void **)p;
#  408|-> 	free(*pp);
#  409|   }
#  410|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def334]
criu-4.2/criu/ipc_ns.c:198:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/ipc_ns.c:182:12: branch_false: following ‘false’ branch...
criu-4.2/criu/ipc_ns.c:187:16: branch_false: ...to here
criu-4.2/criu/ipc_ns.c:188:19: acquire_memory: allocated here
criu-4.2/criu/ipc_ns.c:188:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/ipc_ns.c:189:12: branch_false: ...to here
criu-4.2/criu/ipc_ns.c:189:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/ipc_ns.c:189:12: branch_false: ...to here
criu-4.2/criu/ipc_ns.c:194:27: branch_true: following ‘true’ branch...
criu-4.2/criu/ipc_ns.c:195:24: branch_true: ...to here
criu-4.2/criu/ipc_ns.c:198:23: throw: if ‘msgrcv’ throws an exception...
criu-4.2/criu/ipc_ns.c:198:23: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  196|   		size_t rounded;
#  197|   
#  198|-> 		ret = msgrcv(msq->desc->id, message, msgmax, msg_cnt, IPC_NOWAIT | MSG_COPY);
#  199|   		if (ret < 0) {
#  200|   			pr_perror("Failed to copy IPC message");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def335]
criu-4.2/criu/ipc_ns.c:322:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/ipc_ns.c:460:12: enter_function: entry to ‘dump_ipc_var’
criu-4.2/criu/ipc_ns.c:466:24: acquire_memory: allocated here
criu-4.2/criu/ipc_ns.c:466:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/ipc_ns.c:466:9: branch_false: ...to here
criu-4.2/criu/ipc_ns.c:467:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/ipc_ns.c:469:9: branch_false: ...to here
criu-4.2/criu/ipc_ns.c:475:15: call_function: calling ‘ipc_sysctl_req’ from ‘dump_ipc_var’
#  320|   	/* Skip sysctls which can't be set or haven't existed on dump */
#  321|   	if (access("/proc/sys/fs/mqueue", X_OK))
#  322|-> 		pr_info("Mqueue sysctls are missing\n");
#  323|   	else {
#  324|   		nr += 3;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def336]
criu-4.2/criu/ipc_ns.c:555:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/ipc_ns.c:548:18: acquire_memory: allocated here
criu-4.2/criu/ipc_ns.c:548:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/ipc_ns.c:555:15: branch_false: ...to here
criu-4.2/criu/ipc_ns.c:555:15: throw: if ‘read_img_buf’ throws an exception...
criu-4.2/criu/ipc_ns.c:555:15: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  553|   	}
#  554|   
#  555|-> 	ret = read_img_buf(img, values, size);
#  556|   	if (ret < 0) {
#  557|   		pr_err("Failed to allocate memory for semaphores set values\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def337]
criu-4.2/criu/irmap.c:152:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  150|   
#  151|   	errno = 0;
#  152|-> 	while ((de = readdir(dfd)) != NULL) {
#  153|   		struct irmap *k;
#  154|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def338]
criu-4.2/criu/irmap.c:152:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(openat(get_service_fd(8), *t.path + 1, 0))’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  150|   
#  151|   	errno = 0;
#  152|-> 	while ((de = readdir(dfd)) != NULL) {
#  153|   		struct irmap *k;
#  154|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def339]
criu-4.2/criu/irmap.c:159:21: warning[-Wanalyzer-malloc-leak]: leak of ‘k’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  157|   
#  158|   		nr++;
#  159|-> 		if (xrealloc_safe(&t->kids, nr * sizeof(struct irmap)))
#  160|   			goto out_err;
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def340]
criu-4.2/criu/irmap.c:167:27: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  165|   		k->ino = 0;	 /* for irmap_update_stat */
#  166|   		k->nr_kids = -1; /* for irmap_update_dir */
#  167|-> 		k->path = xsprintf("%s/%s", t->path, de->d_name);
#  168|   		if (!k->path)
#  169|   			goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def341]
criu-4.2/criu/irmap.c:173:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  171|   
#  172|   	if (errno) {
#  173|-> 		pr_perror("Readdir failed");
#  174|   		goto out_err;
#  175|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def342]
criu-4.2/criu/irmap.c:177:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:187:22: enter_function: entry to ‘irmap_scan’
criu-4.2/criu/irmap.c:201:21: branch_true: following ‘true’ branch...
criu-4.2/criu/irmap.c:202:33: branch_true: ...to here
criu-4.2/criu/irmap.c:202:21: call_function: calling ‘irmap_scan’ from ‘irmap_scan’
#  175|   	}
#  176|   
#  177|-> 	closedir(dfd);
#  178|   	t->nr_kids = nr;
#  179|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def343]
criu-4.2/criu/irmap.c:330:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:323:14: acquire_memory: allocated here
criu-4.2/criu/irmap.c:323:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:327:9: branch_false: ...to here
criu-4.2/criu/irmap.c:330:25: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/irmap.c:330:25: branch_true: ...to here
criu-4.2/criu/irmap.c:330:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/irmap.c:330:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  328|   	ip->ino = ino;
#  329|   	ip->fh = *fh;
#  330|-> 	ip->fh.handle = xmemdup(fh->handle, FH_ENTRY_SIZES__min_entries * sizeof(uint64_t));
#  331|   	if (!ip->fh.handle) {
#  332|   		xfree(ip);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def344]
criu-4.2/criu/irmap.c:336:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:323:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:327:9: branch_false: ...to here
criu-4.2/criu/irmap.c:330:25: acquire_memory: allocated here
criu-4.2/criu/irmap.c:330:25: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:330:25: branch_false: ...to here
criu-4.2/criu/irmap.c:331:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:336:9: branch_false: ...to here
criu-4.2/criu/irmap.c:336:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/irmap.c:336:9: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  334|   	}
#  335|   
#  336|-> 	pr_debug("Queue %x:%lx for pre-dump\n", dev, ino);
#  337|   
#  338|   	ip->next = predump_queue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def345]
criu-4.2/criu/irmap.c:408:20: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:402:14: acquire_memory: allocated here
criu-4.2/criu/irmap.c:402:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:406:19: branch_false: ...to here
criu-4.2/criu/irmap.c:408:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/irmap.c:408:20: branch_true: ...to here
criu-4.2/criu/irmap.c:408:20: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/irmap.c:408:20: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  406|   	ic->dev = ie->dev;
#  407|   	ic->ino = ie->inode;
#  408|-> 	ic->path = xstrdup(ie->path);
#  409|   	if (!ie->path) {
#  410|   		xfree(ic);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def346]
criu-4.2/criu/irmap.c:421:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:402:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:406:19: branch_false: ...to here
criu-4.2/criu/irmap.c:408:20: acquire_memory: allocated here
criu-4.2/criu/irmap.c:408:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:408:9: branch_false: ...to here
criu-4.2/criu/irmap.c:409:12: branch_false: following ‘false’ branch...
criu-4.2/criu/irmap.c:414:9: branch_false: ...to here
criu-4.2/criu/irmap.c:421:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/irmap.c:421:9: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  419|   	ic->revalidate = true;
#  420|   
#  421|-> 	pr_debug("Pre-cache %x:%lx -> %s\n", ic->dev, ic->ino, ic->path);
#  422|   
#  423|   	hv = irmap_hashfn(ic->dev, ic->ino);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def347]
criu-4.2/criu/irmap.c:497:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:493:13: acquire_memory: allocated here
criu-4.2/criu/irmap.c:493:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:497:17: branch_false: ...to here
criu-4.2/criu/irmap.c:497:17: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/irmap.c:497:17: branch_true: ...to here
criu-4.2/criu/irmap.c:497:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/irmap.c:497:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  495|   		return -1;
#  496|   
#  497|-> 	o->ir = xzalloc(sizeof(*o->ir));
#  498|   	if (!o->ir) {
#  499|   		xfree(o);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def348]
criu-4.2/criu/irmap.c:503:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/irmap.c:493:13: acquire_memory: allocated here
criu-4.2/criu/irmap.c:493:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:497:17: branch_false: ...to here
criu-4.2/criu/irmap.c:497:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:497:9: branch_false: ...to here
criu-4.2/criu/irmap.c:498:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/irmap.c:503:23: branch_false: ...to here
criu-4.2/criu/irmap.c:503:23: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/irmap.c:503:23: branch_true: ...to here
criu-4.2/criu/irmap.c:503:23: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/irmap.c:503:23: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  501|   	}
#  502|   
#  503|-> 	o->ir->path = xstrdup(path);
#  504|   	if (!o->ir->path) {
#  505|   		xfree(o->ir);

Error: CPPCHECK_WARNING (CWE-476): [#def349]
criu-4.2/criu/kcmp-ids.c:76: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   74|   
#   75|   	/* Make sure no overflow here */
#   76|-> 	BUG_ON(!e->subid);
#   77|   
#   78|   	rb_init_node(&e->node);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def350]
criu-4.2/criu/kcmp-ids.c:76:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/kcmp-ids.c:68:13: acquire_memory: allocated here
criu-4.2/criu/kcmp-ids.c:68:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/kcmp-ids.c:72:20: branch_false: ...to here
criu-4.2/criu/kcmp-ids.c:76:9: branch_true: following ‘true’ branch...
criu-4.2/criu/kcmp-ids.c:76:9: branch_true: ...to here
criu-4.2/criu/kcmp-ids.c:76:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kcmp-ids.c:76:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   74|   
#   75|   	/* Make sure no overflow here */
#   76|-> 	BUG_ON(!e->subid);
#   77|   
#   78|   	rb_init_node(&e->node);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def351]
criu-4.2/criu/kcmp-ids.c:76:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/kcmp-ids.c:68:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/kcmp-ids.c:72:20: branch_false: ...to here
criu-4.2/criu/kcmp-ids.c:76:9: branch_true: following ‘true’ branch...
criu-4.2/criu/kcmp-ids.c:76:9: branch_true: ...to here
criu-4.2/criu/kcmp-ids.c:76:9: danger: dereference of NULL ‘0’
#   74|   
#   75|   	/* Make sure no overflow here */
#   76|-> 	BUG_ON(!e->subid);
#   77|   
#   78|   	rb_init_node(&e->node);

Error: CPPCHECK_WARNING (CWE-476): [#def352]
criu-4.2/criu/kcmp-ids.c:94: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   92|   	struct rb_node *parent = NULL;
#   93|   
#   94|-> 	BUG_ON(!node);
#   95|   
#   96|   	while (node) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def353]
criu-4.2/criu/kcmp-ids.c:94:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/kcmp-ids.c:94:9: branch_true: following ‘true’ branch (when ‘node’ is NULL)...
criu-4.2/criu/kcmp-ids.c:94:9: branch_true: ...to here
criu-4.2/criu/kcmp-ids.c:94:9: danger: dereference of NULL ‘0’
#   92|   	struct rb_node *parent = NULL;
#   93|   
#   94|-> 	BUG_ON(!node);
#   95|   
#   96|   	while (node) {

Error: CPPCHECK_WARNING (CWE-476): [#def354]
criu-4.2/criu/kcmp-ids.c:158: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  156|   	struct rb_node **new = &e->subtree_root.rb_node;
#  157|   
#  158|-> 	BUG_ON(!node);
#  159|   
#  160|   	while (node) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def355]
criu-4.2/criu/kcmp-ids.c:158:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/kcmp-ids.c:158:9: branch_true: following ‘true’ branch (when ‘node’ is NULL)...
criu-4.2/criu/kcmp-ids.c:158:9: branch_true: ...to here
criu-4.2/criu/kcmp-ids.c:158:9: danger: dereference of NULL ‘0’
#  156|   	struct rb_node **new = &e->subtree_root.rb_node;
#  157|   
#  158|-> 	BUG_ON(!node);
#  159|   
#  160|   	while (node) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def356]
criu-4.2/criu/kerndat.c:400:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/kerndat.c:370:12: branch_false: following ‘false’ branch (when ‘which <= 2’)...
criu-4.2/criu/kerndat.c:375:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:375:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:379:21: branch_true: ...to here
criu-4.2/criu/kerndat.c:379:20: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:390:21: branch_false: ...to here
criu-4.2/criu/kerndat.c:390:20: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:395:26: branch_false: ...to here
criu-4.2/criu/kerndat.c:395:20: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:400:17: branch_false: ...to here
criu-4.2/criu/kerndat.c:400:17: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:400:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:400:17: danger: dereference of NULL ‘0’
#  398|   		}
#  399|   
#  400|-> 		BUG_ON(st.st_dev == 0);
#  401|   		kstat[which].fs_dev = st.st_dev;
#  402|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def357]
criu-4.2/criu/kerndat.c:494:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/kerndat.c:482:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:487:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:488:12: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:493:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:493:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:494:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:494:17: danger: dereference of NULL ‘0’
#  492|   
#  493|   	if (*((int *)addr) != 0) {
#  494|-> 		BUG();
#  495|   		return -1;
#  496|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def358]
criu-4.2/criu/kerndat.c:663:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/kerndat.c:656:14: acquire_resource: opened here
criu-4.2/criu/kerndat.c:657:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:662:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:663:13: throw: if ‘cr_system’ throws an exception...
criu-4.2/criu/kerndat.c:663:13: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  661|   
#  662|   	kdat.has_xtlocks = 1;
#  663|-> 	if (cr_system(fd, fd, fd, "sh", argv, CRS_CAN_FAIL) == -1)
#  664|   		kdat.has_xtlocks = 0;
#  665|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def359]
criu-4.2/criu/kerndat.c:721:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:721:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:721:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:721:17: danger: ‘sock’ leaks here
#  719|   
#  720|   	if (listen(sock, 1)) {
#  721|-> 		pr_perror("Unable to listen a socket");
#  722|   		goto err;
#  723|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def360]
criu-4.2/criu/kerndat.c:727:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:725:23: branch_false: ...to here
criu-4.2/criu/kerndat.c:726:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:727:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:727:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:727:17: danger: ‘sock’ leaks here
#  725|   	clnt = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
#  726|   	if (clnt < 0) {
#  727|-> 		pr_perror("Unable to create a socket");
#  728|   		goto err;
#  729|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def361]
criu-4.2/criu/kerndat.c:731:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘clnt’
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:725:23: branch_false: ...to here
criu-4.2/criu/kerndat.c:725:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:726:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:731:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:731:13: throw: if ‘connect’ throws an exception...
criu-4.2/criu/kerndat.c:731:13: danger: ‘clnt’ leaks here
#  729|   	}
#  730|   
#  731|-> 	if (connect(clnt, (const struct sockaddr *)&listener_addr, addrlen)) {
#  732|   		pr_perror("Unable to connect a socket");
#  733|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def362]
criu-4.2/criu/kerndat.c:731:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:725:23: branch_false: ...to here
criu-4.2/criu/kerndat.c:726:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:731:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:731:13: throw: if ‘connect’ throws an exception...
criu-4.2/criu/kerndat.c:731:13: danger: ‘sock’ leaks here
#  729|   	}
#  730|   
#  731|-> 	if (connect(clnt, (const struct sockaddr *)&listener_addr, addrlen)) {
#  732|   		pr_perror("Unable to connect a socket");
#  733|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def363]
criu-4.2/criu/kerndat.c:732:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:725:23: branch_false: ...to here
criu-4.2/criu/kerndat.c:726:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:731:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:731:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:732:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:732:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:732:17: danger: ‘sock’ leaks here
#  730|   
#  731|   	if (connect(clnt, (const struct sockaddr *)&listener_addr, addrlen)) {
#  732|-> 		pr_perror("Unable to connect a socket");
#  733|   		goto err;
#  734|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def364]
criu-4.2/criu/kerndat.c:737:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:725:23: branch_false: ...to here
criu-4.2/criu/kerndat.c:726:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:731:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:731:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:736:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:736:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:737:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:737:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:737:17: danger: ‘sock’ leaks here
#  735|   
#  736|   	if (shutdown(clnt, SHUT_WR)) {
#  737|-> 		pr_perror("Unable to shutdown a socket");
#  738|   		goto err;
#  739|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def365]
criu-4.2/criu/kerndat.c:743:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:725:23: branch_false: ...to here
criu-4.2/criu/kerndat.c:726:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:731:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:731:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:736:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:736:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:741:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:741:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:742:21: branch_true: ...to here
criu-4.2/criu/kerndat.c:742:20: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:743:25: branch_true: ...to here
criu-4.2/criu/kerndat.c:743:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:743:25: danger: ‘sock’ leaks here
#  741|   	if (setsockopt(clnt, SOL_TCP, TCP_REPAIR, &yes, sizeof(yes))) {
#  742|   		if (errno != EPERM) {
#  743|-> 			pr_perror("Unable to set TCP_REPAIR with setsockopt");
#  744|   			goto err;
#  745|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def366]
criu-4.2/criu/kerndat.c:752:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:721:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:752:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/kerndat.c:752:9: danger: ‘sock’ leaks here
#  750|   	exit_code = 0;
#  751|   err:
#  752|-> 	close_safe(&clnt);
#  753|   	close(sock);
#  754|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def367]
criu-4.2/criu/kerndat.c:753:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
criu-4.2/criu/kerndat.c:698:16: acquire_resource: stream socket created here
criu-4.2/criu/kerndat.c:699:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)...
criu-4.2/criu/kerndat.c:709:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:709:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:714:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:720:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:720:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:721:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:753:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/kerndat.c:753:9: danger: ‘sock’ leaks here
#  751|   err:
#  752|   	close_safe(&clnt);
#  753|-> 	close(sock);
#  754|   
#  755|   	return exit_code;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def368]
criu-4.2/criu/kerndat.c:770:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/kerndat.c:764:14: acquire_resource: socket created here
criu-4.2/criu/kerndat.c:765:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/kerndat.c:770:30: branch_false: ...to here
criu-4.2/criu/kerndat.c:770:13: throw: if ‘net_get_nsid’ throws an exception...
criu-4.2/criu/kerndat.c:770:13: danger: ‘sk’ leaks here
#  768|   	}
#  769|   
#  770|-> 	if (net_get_nsid(sk, getpid(), &nsid) < 0) {
#  771|   		pr_warn("NSID is not supported\n");
#  772|   		close(sk);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def369]
criu-4.2/criu/kerndat.c:831:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/kerndat.c:808:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:812:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:816:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:821:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:821:16: acquire_resource: opened here
criu-4.2/criu/kerndat.c:822:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:822:12: branch_false: ...to here
criu-4.2/criu/kerndat.c:828:16: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:829:23: branch_true: ...to here
criu-4.2/criu/kerndat.c:831:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:831:25: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
#  829|   		num = sscanf(buf, "%lx-%lx %c%c%c%c", &start, &end, &r, &w, &x, &s);
#  830|   		if (num < 6) {
#  831|-> 			pr_err("Can't parse: %s\n", buf);
#  832|   			goto err;
#  833|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def370]
criu-4.2/criu/kerndat.c:831:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/kerndat.c:808:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:812:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:816:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:821:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:821:16: acquire_memory: allocated here
criu-4.2/criu/kerndat.c:822:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:822:12: branch_false: ...to here
criu-4.2/criu/kerndat.c:828:16: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:829:23: branch_true: ...to here
criu-4.2/criu/kerndat.c:831:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:831:25: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  829|   		num = sscanf(buf, "%lx-%lx %c%c%c%c", &start, &end, &r, &w, &x, &s);
#  830|   		if (num < 6) {
#  831|-> 			pr_err("Can't parse: %s\n", buf);
#  832|   			goto err;
#  833|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def371]
criu-4.2/criu/kerndat.c:846:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/kerndat.c:808:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:812:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:816:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:821:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:821:16: acquire_resource: opened here
criu-4.2/criu/kerndat.c:822:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:822:12: branch_false: ...to here
criu-4.2/criu/kerndat.c:828:16: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:829:23: branch_true: ...to here
criu-4.2/criu/kerndat.c:830:20: branch_false: following ‘false’ branch (when ‘num > 5’)...
criu-4.2/criu/kerndat.c:846:21: branch_false: ...to here
criu-4.2/criu/kerndat.c:846:20: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:850:37: branch_false: ...to here
criu-4.2/criu/kerndat.c:851:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:846:21: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
#  844|   		 * of PAGE_SIZE the 1M gap is cut off.
#  845|   		 */
#  846|-> 		if (start == (unsigned long)mem) {
#  847|   			kdat.stack_guard_gap_hidden = false;
#  848|   			detected = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def372]
criu-4.2/criu/kerndat.c:846:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
criu-4.2/criu/kerndat.c:808:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:812:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:816:12: branch_false: following ‘false’ branch (when ‘mem != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:821:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:821:16: acquire_memory: allocated here
criu-4.2/criu/kerndat.c:822:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:822:12: branch_false: ...to here
criu-4.2/criu/kerndat.c:828:16: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:829:23: branch_true: ...to here
criu-4.2/criu/kerndat.c:830:20: branch_false: following ‘false’ branch (when ‘num > 5’)...
criu-4.2/criu/kerndat.c:846:21: branch_false: ...to here
criu-4.2/criu/kerndat.c:846:20: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:850:37: branch_false: ...to here
criu-4.2/criu/kerndat.c:851:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:846:21: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
#  844|   		 * of PAGE_SIZE the 1M gap is cut off.
#  845|   		 */
#  846|-> 		if (start == (unsigned long)mem) {
#  847|   			kdat.stack_guard_gap_hidden = false;
#  848|   			detected = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def373]
criu-4.2/criu/kerndat.c:933:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/kerndat.c:917:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/kerndat.c:922:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:931:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:932:12: branch_true: following ‘true’ branch...
criu-4.2/criu/kerndat.c:933:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:933:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:933:17: danger: ‘pipefd[1]’ leaks here
#  931|   	tfd = pipefd[0];
#  932|   	if (epoll_ctl(efd, EPOLL_CTL_ADD, tfd, &ev)) {
#  933|-> 		pr_perror("Can't add event");
#  934|   		goto out;
#  935|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def374]
criu-4.2/criu/kerndat.c:947:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/kerndat.c:917:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/kerndat.c:922:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:931:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:947:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/kerndat.c:947:9: danger: ‘pipefd[1]’ leaks here
#  945|   
#  946|   out:
#  947|-> 	close(pipefd[0]);
#  948|   	close(pipefd[1]);
#  949|   	close(efd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def375]
criu-4.2/criu/kerndat.c:948:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/kerndat.c:917:12: branch_false: following ‘false’ branch (when ‘efd >= 0’)...
criu-4.2/criu/kerndat.c:922:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:931:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:948:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/kerndat.c:948:9: danger: ‘pipefd[1]’ leaks here
#  946|   out:
#  947|   	close(pipefd[0]);
#  948|-> 	close(pipefd[1]);
#  949|   	close(efd);
#  950|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def376]
criu-4.2/criu/kerndat.c:1242:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
criu-4.2/criu/kerndat.c:1228:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1231:14: branch_false: ...to here
criu-4.2/criu/kerndat.c:1231:14: acquire_resource: opened here
criu-4.2/criu/kerndat.c:1232:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1240:15: branch_false: ...to here
criu-4.2/criu/kerndat.c:1241:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/kerndat.c:1242:17: branch_true: ...to here
criu-4.2/criu/kerndat.c:1242:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/kerndat.c:1242:17: danger: ‘open(kdat_file, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
# 1240|   	ret = read(fd, &kdat, sizeof(kdat));
# 1241|   	if (ret < 0) {
# 1242|-> 		pr_perror("Can't read kdat cache");
# 1243|   		close(fd);
# 1244|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def377]
criu-4.2/criu/kerndat.c:1247:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
criu-4.2/criu/kerndat.c:1228:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1231:14: branch_false: ...to here
criu-4.2/criu/kerndat.c:1231:14: acquire_resource: opened here
criu-4.2/criu/kerndat.c:1232:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1240:15: branch_false: ...to here
criu-4.2/criu/kerndat.c:1241:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/kerndat.c:1247:9: branch_false: ...to here
criu-4.2/criu/kerndat.c:1247:9: danger: ‘open(kdat_file, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
# 1245|   	}
# 1246|   
# 1247|-> 	close(fd);
# 1248|   
# 1249|   	if (ret != sizeof(kdat) || kdat.magic1 != KDAT_MAGIC || kdat.magic2 != KDAT_MAGIC_2) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def378]
criu-4.2/criu/kerndat.c:1398:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘f.fd’
criu-4.2/criu/kerndat.c:1373:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1382:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:1383:12: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/kerndat.c:1388:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:1388:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1393:16: branch_false: ...to here
criu-4.2/criu/kerndat.c:1393:16: acquire_resource: opened here
criu-4.2/criu/kerndat.c:1394:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1398:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:1398:13: throw: if ‘bfdopenr’ throws an exception...
criu-4.2/criu/kerndat.c:1398:13: danger: ‘f.fd’ leaks here; was opened at [(7)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/6)
# 1396|   		goto out_unmap;
# 1397|   	}
# 1398|-> 	if (bfdopenr(&f))
# 1399|   		goto out_unmap;
# 1400|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def379]
criu-4.2/criu/kerndat.c:1573:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘f.fd’
criu-4.2/criu/kerndat.c:1568:16: acquire_resource: opened here
criu-4.2/criu/kerndat.c:1569:12: branch_false: following ‘false’ branch...
criu-4.2/criu/kerndat.c:1573:13: branch_false: ...to here
criu-4.2/criu/kerndat.c:1573:13: throw: if ‘bfdopenr’ throws an exception...
criu-4.2/criu/kerndat.c:1573:13: danger: ‘f.fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/0)
# 1571|   		return -1;
# 1572|   	}
# 1573|-> 	if (bfdopenr(&f))
# 1574|   		return -1;
# 1575|   	while ((str = breadline(&f)) != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def380]
criu-4.2/criu/log.c:82:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
criu-4.2/criu/log.c:401:6: enter_function: entry to ‘print_on_level’
criu-4.2/criu/log.c:405:9: acquire_resource: ‘va_start’ called here
criu-4.2/criu/log.c:406:9: call_function: calling ‘vprint_on_level’ from ‘print_on_level’
#   80|   int log_get_fd(void)
#   81|   {
#   82|-> 	int fd = get_service_fd(LOG_FD_OFF);
#   83|   
#   84|   	return fd < 0 ? DEFAULT_LOGFD : fd;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def381]
criu-4.2/criu/lsm.c:284:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  282|   #endif
#  283|   	default:
#  284|-> 		BUG();
#  285|   		ret = -1;
#  286|   		break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def382]
criu-4.2/criu/mem.c:46:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mem.c:525:12: enter_function: entry to ‘__parasite_dump_pages_seized’
criu-4.2/criu/mem.c:553:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:556:15: branch_false: ...to here
criu-4.2/criu/mem.c:564:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:567:14: branch_false: ...to here
criu-4.2/criu/mem.c:580:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:583:20: branch_false: ...to here
criu-4.2/criu/mem.c:587:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:596:9: branch_false: ...to here
criu-4.2/criu/mem.c:620:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mem.c:627:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/criu/mem.c:630:9: branch_false: ...to here
criu-4.2/criu/mem.c:636:15: call_function: calling ‘task_reset_dirty_track’ from ‘__parasite_dump_pages_seized’
#   44|   		return 0;
#   45|   
#   46|-> 	BUG_ON(!kdat.has_dirty_track);
#   47|   
#   48|   	ret = do_task_reset_dirty_track(pid);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def383]
criu-4.2/criu/mem.c:49:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mem.c:525:12: enter_function: entry to ‘__parasite_dump_pages_seized’
criu-4.2/criu/mem.c:553:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:556:15: branch_false: ...to here
criu-4.2/criu/mem.c:564:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:567:14: branch_false: ...to here
criu-4.2/criu/mem.c:580:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:583:20: branch_false: ...to here
criu-4.2/criu/mem.c:587:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:596:9: branch_false: ...to here
criu-4.2/criu/mem.c:620:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mem.c:627:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/criu/mem.c:630:9: branch_false: ...to here
criu-4.2/criu/mem.c:636:15: call_function: calling ‘task_reset_dirty_track’ from ‘__parasite_dump_pages_seized’
#   47|   
#   48|   	ret = do_task_reset_dirty_track(pid);
#   49|-> 	BUG_ON(ret == 1);
#   50|   	return ret;
#   51|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def384]
criu-4.2/criu/mem.c:1194:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mem.c:1144:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1147:52: branch_false: ...to here
criu-4.2/criu/mem.c:1181:28: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1183:34: branch_false: ...to here
criu-4.2/criu/mem.c:1183:33: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1188:30: branch_false: ...to here
criu-4.2/criu/mem.c:1188:28: branch_true: following ‘true’ branch...
criu-4.2/criu/mem.c:1189:53: branch_true: ...to here
criu-4.2/criu/mem.c:1194:41: danger: dereference of NULL ‘0’
# 1192|   					pr_debug("VMA 0x%" PRIx64 ":0x%" PRIx64 " RO %#lx:%lu IO\n", vma->e->start,
# 1193|   						 vma->e->end, va, nr_pages);
# 1194|-> 					BUG();
# 1195|   				}
# 1196|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def385]
criu-4.2/criu/mem.c:1588:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mem.c:1562:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mem.c:1567:22: branch_true: ...to here
criu-4.2/criu/mem.c:1567:22: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1571:16: branch_false: ...to here
criu-4.2/criu/mem.c:1571:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mem.c:1574:20: branch_false: ...to here
criu-4.2/criu/mem.c:1580:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1580:20: branch_false: ...to here
criu-4.2/criu/mem.c:1588:25: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1590:31: branch_false: ...to here
criu-4.2/criu/mem.c:1591:28: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1594:25: branch_false: ...to here
criu-4.2/criu/mem.c:1601:18: branch_true: following ‘true’ branch...
criu-4.2/criu/mem.c:1601:18: branch_true: ...to here
criu-4.2/criu/mem.c:1580:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mem.c:1580:20: branch_false: ...to here
criu-4.2/criu/mem.c:1588:25: danger: dereference of NULL ‘0’
# 1586|   			struct vma_area *vma;
# 1587|   
# 1588|-> 			BUG_ON(!(regs[i].categories & PAGE_IS_GUARD));
# 1589|   
# 1590|   			vma = alloc_vma_area();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def386]
criu-4.2/criu/mount-v2.c:291:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*mi.plain_mountpoint, 2097152)’
criu-4.2/criu/mount-v2.c:252:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:252:12: branch_false: ...to here
criu-4.2/criu/mount-v2.c:261:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:262:24: branch_true: ...to here
criu-4.2/criu/mount-v2.c:264:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:275:25: branch_false: ...to here
criu-4.2/criu/mount-v2.c:275:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:280:13: branch_false: ...to here
criu-4.2/criu/mount-v2.c:280:13: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:283:12: branch_false: ...to here
criu-4.2/criu/mount-v2.c:283:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:286:27: branch_true: ...to here
criu-4.2/criu/mount-v2.c:286:22: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:287:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:291:24: branch_false: ...to here
criu-4.2/criu/mount-v2.c:292:21: throw: if ‘__userns_call’ throws an exception...
criu-4.2/criu/mount-v2.c:291:24: danger: ‘open(*mi.plain_mountpoint, 2097152)’ leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  289|   			return -1;
#  290|   		}
#  291|-> 		sflags |= MS_RDONLY | MS_REMOUNT;
#  292|   		if (userns_call(apply_sb_flags, 0, &sflags, sizeof(sflags), fd)) {
#  293|   			pr_perror("Unable to apply mount flags %d for %s", mi->sb_flags, mi->plain_mountpoint);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def387]
criu-4.2/criu/mount-v2.c:457:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*mi.plain_mountpoint, 2097152)’
criu-4.2/criu/mount-v2.c:450:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:451:27: branch_true: ...to here
criu-4.2/criu/mount-v2.c:451:22: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:452:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:457:21: branch_false: ...to here
criu-4.2/criu/mount-v2.c:457:21: throw: if ‘__userns_call’ throws an exception...
criu-4.2/criu/mount-v2.c:457:21: danger: ‘open(*mi.plain_mountpoint, 2097152)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  455|   		}
#  456|   
#  457|-> 		if (userns_call(mount_root, 0, &flags, sizeof(flags), fd)) {
#  458|   			pr_err("Unable to mount %s\n", mi->plain_mountpoint);
#  459|   			close(fd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def388]
criu-4.2/criu/mount-v2.c:497:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount-v2.c:497:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:497:9: branch_true: ...to here
criu-4.2/criu/mount-v2.c:497:9: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:497:9: branch_false: ...to here
criu-4.2/criu/mount-v2.c:497:9: danger: dereference of NULL ‘0’
#  495|   
#  496|   	/* Parent should be mounted already, that's how mnt_tree_for_each works */
#  497|-> 	BUG_ON(mi->parent && !mi->parent->mounted);
#  498|   
#  499|   	/* Root mounts can be mounted at any moment */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def389]
criu-4.2/criu/mount-v2.c:649:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount-v2.c:649:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:649:9: branch_true: ...to here
criu-4.2/criu/mount-v2.c:649:9: danger: dereference of NULL ‘0’
#  647|   static int create_plain_mountpoint(struct mount_info *mi)
#  648|   {
#  649|-> 	BUG_ON(mi->is_dir == -1);
#  650|   
#  651|   	pr_debug("Create plain mountpoint %s for %d\n", mi->plain_mountpoint, mi->mnt_id);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def390]
criu-4.2/criu/mount-v2.c:665:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘creat(*mi.plain_mountpoint, 384)’
criu-4.2/criu/mount-v2.c:649:9: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:651:9: branch_false: ...to here
criu-4.2/criu/mount-v2.c:652:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:660:28: branch_false: ...to here
criu-4.2/criu/mount-v2.c:660:22: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:661:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:665:17: branch_false: ...to here
criu-4.2/criu/mount-v2.c:665:17: danger: ‘creat(*mi.plain_mountpoint, 384)’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  663|   			return -1;
#  664|   		}
#  665|-> 		close(fd);
#  666|   	}
#  667|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def391]
criu-4.2/criu/mount-v2.c:799:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*mi.mountpoint, 2097152)’
criu-4.2/criu/mount-v2.c:793:14: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:794:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:799:24: branch_false: ...to here
criu-4.2/criu/mount-v2.c:799:24: throw: if ‘fdstore_add’ throws an exception...
criu-4.2/criu/mount-v2.c:799:24: danger: ‘open(*mi.mountpoint, 2097152)’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  797|   	}
#  798|   
#  799|-> 	mi->mp_fd_id = fdstore_add(fd);
#  800|   	close(fd);
#  801|   	if (mi->mp_fd_id < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def392]
criu-4.2/criu/mount-v2.c:818:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*mi.mountpoint, 2097152)’
criu-4.2/criu/mount-v2.c:794:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:799:24: branch_false: ...to here
criu-4.2/criu/mount-v2.c:801:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:806:9: branch_false: ...to here
criu-4.2/criu/mount-v2.c:807:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:812:19: branch_false: ...to here
criu-4.2/criu/mount-v2.c:812:14: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:813:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:818:25: branch_false: ...to here
criu-4.2/criu/mount-v2.c:818:25: throw: if ‘fdstore_add’ throws an exception...
criu-4.2/criu/mount-v2.c:818:25: danger: ‘open(*mi.mountpoint, 2097152)’ leaks here; was opened at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  816|   	}
#  817|   
#  818|-> 	mi->mnt_fd_id = fdstore_add(fd);
#  819|   	close(fd);
#  820|   	if (mi->mnt_fd_id < 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def393]
criu-4.2/criu/mount-v2.c:867:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount-v2.c:865:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:866:26: branch_true: ...to here
criu-4.2/criu/mount-v2.c:867:17: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:867:17: branch_true: ...to here
criu-4.2/criu/mount-v2.c:867:17: danger: dereference of NULL ‘0’
#  865|   	if (sga->src_id != -1) {
#  866|   		src_fd = fdstore_get(sga->src_id);
#  867|-> 		BUG_ON(src_fd < 0);
#  868|   	} else {
#  869|   		char *source_mp;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def394]
criu-4.2/criu/mount-v2.c:871:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount-v2.c:865:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:871:17: branch_false: ...to here
criu-4.2/criu/mount-v2.c:871:17: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:871:17: branch_true: ...to here
criu-4.2/criu/mount-v2.c:871:17: danger: dereference of NULL ‘0’
#  869|   		char *source_mp;
#  870|   
#  871|-> 		BUG_ON(sga->source[0] == '\0');
#  872|   		/*
#  873|   		 * Source path should not always be a mountpoint as we

Error: GCC_ANALYZER_WARNING (CWE-775): [#def395]
criu-4.2/criu/mount-v2.c:891:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘src_fd’
criu-4.2/criu/mount-v2.c:865:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:871:17: branch_false: ...to here
criu-4.2/criu/mount-v2.c:871:17: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:876:48: branch_false: ...to here
criu-4.2/criu/mount-v2.c:877:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:882:26: branch_false: ...to here
criu-4.2/criu/mount-v2.c:882:26: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:883:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:888:17: branch_false: ...to here
criu-4.2/criu/mount-v2.c:891:18: throw: if ‘fdstore_get’ throws an exception...
criu-4.2/criu/mount-v2.c:891:18: danger: ‘src_fd’ leaks here; was opened at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  889|   	}
#  890|   
#  891|-> 	dst_fd = fdstore_get(sga->dst_id);
#  892|   	BUG_ON(dst_fd < 0);
#  893|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def396]
criu-4.2/criu/mount-v2.c:892:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘src_fd’
criu-4.2/criu/mount-v2.c:865:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:871:17: branch_false: ...to here
criu-4.2/criu/mount-v2.c:871:17: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:876:48: branch_false: ...to here
criu-4.2/criu/mount-v2.c:877:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:882:26: branch_false: ...to here
criu-4.2/criu/mount-v2.c:882:26: acquire_resource: opened here
criu-4.2/criu/mount-v2.c:883:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:888:17: branch_false: ...to here
criu-4.2/criu/mount-v2.c:892:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:892:9: branch_true: ...to here
criu-4.2/criu/mount-v2.c:892:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount-v2.c:892:9: danger: ‘src_fd’ leaks here; was opened at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  890|   
#  891|   	dst_fd = fdstore_get(sga->dst_id);
#  892|-> 	BUG_ON(dst_fd < 0);
#  893|   
#  894|   	/* Copy shared_id of the source */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def397]
criu-4.2/criu/mount-v2.c:892:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount-v2.c:865:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:866:26: branch_true: ...to here
criu-4.2/criu/mount-v2.c:867:17: branch_false: following ‘false’ branch...
criu-4.2/criu/mount-v2.c:891:18: branch_false: ...to here
criu-4.2/criu/mount-v2.c:892:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:892:9: branch_true: ...to here
criu-4.2/criu/mount-v2.c:892:9: danger: dereference of NULL ‘0’
#  890|   
#  891|   	dst_fd = fdstore_get(sga->dst_id);
#  892|-> 	BUG_ON(dst_fd < 0);
#  893|   
#  894|   	/* Copy shared_id of the source */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def398]
criu-4.2/criu/mount-v2.c:944:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount-v2.c:944:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount-v2.c:944:9: branch_true: ...to here
criu-4.2/criu/mount-v2.c:944:9: danger: dereference of NULL ‘0’
#  942|   
#  943|   	target_fd = fdstore_get(target->mnt_fd_id);
#  944|-> 	BUG_ON(target_fd < 0);
#  945|   	snprintf(target_path, sizeof(target_path), "/proc/self/fd/%d", target_fd);
#  946|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def399]
criu-4.2/criu/mount-v2.c:1092:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1090|   	char *cut_root, path[PATH_MAX], *root;
# 1091|   
# 1092|-> 	BUG_ON(!mi->deleted || !mi->bind);
# 1093|   
# 1094|   	cut_root = get_relative_path(mi->root, mi->bind->root);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def400]
criu-4.2/criu/mount.c:48:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1690:40: return_function: returning to ‘add_cr_time_mount’ from ‘get_plain_mountpoint’
criu-4.2/criu/mount.c:1691:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1699:9: branch_false: ...to here
criu-4.2/criu/mount.c:1700:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1700:9: branch_false: ...to here
criu-4.2/criu/mount.c:1701:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1709:17: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:1710:67: branch_true: ...to here
criu-4.2/criu/mount.c:1710:67: call_function: calling ‘service_mountpoint’ from ‘add_cr_time_mount’
#   46|   {
#   47|   	if (!opts.mntns_compat_mode && opts.mode == CR_RESTORE) {
#   48|-> 		BUG_ON(!mi->plain_mountpoint);
#   49|   		return mi->plain_mountpoint;
#   50|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def401]
criu-4.2/criu/mount.c:48:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1684:17: branch_false: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1699:9: branch_false: ...to here
criu-4.2/criu/mount.c:1700:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1700:9: branch_false: ...to here
criu-4.2/criu/mount.c:1701:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1709:17: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:1710:67: branch_true: ...to here
criu-4.2/criu/mount.c:1710:67: call_function: calling ‘service_mountpoint’ from ‘add_cr_time_mount’
#   46|   {
#   47|   	if (!opts.mntns_compat_mode && opts.mode == CR_RESTORE) {
#   48|-> 		BUG_ON(!mi->plain_mountpoint);
#   49|   		return mi->plain_mountpoint;
#   50|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def402]
criu-4.2/criu/mount.c:48:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#   46|   {
#   47|   	if (!opts.mntns_compat_mode && opts.mode == CR_RESTORE) {
#   48|-> 		BUG_ON(!mi->plain_mountpoint);
#   49|   		return mi->plain_mountpoint;
#   50|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def403]
criu-4.2/criu/mount.c:520:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:3981:5: enter_function: entry to ‘collect_mnt_namespaces’
criu-4.2/criu/mount.c:3990:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3993:9: branch_false: ...to here
criu-4.2/criu/mount.c:4018:15: call_function: calling ‘resolve_external_mounts’ from ‘collect_mnt_namespaces’
#  518|   			snprintf(source, len, "dev[%s]", val);
#  519|   			info->fstype = fstype_auto();
#  520|-> 			BUG_ON(info->fstype->code != FSTYPE__AUTO);
#  521|   			info->source = source;
#  522|   			return 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def404]
criu-4.2/criu/mount.c:929:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2563:13: enter_function: entry to ‘can_mount_now’
criu-4.2/criu/mount.c:2641:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2643:17: branch_true: ...to here
criu-4.2/criu/mount.c:2647:17: branch_true: following ‘true’ branch (when ‘s != mi’)...
criu-4.2/criu/mount.c:2648:25: branch_true: ...to here
criu-4.2/criu/mount.c:2652:39: call_function: calling ‘root_path_from_parent’ from ‘can_mount_now’
#  927|   		return -1;
#  928|   
#  929|-> 	BUG_ON(len <= 0);
#  930|   	if (buf[len - 1] == '/')
#  931|   		tail_slash = true;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def405]
criu-4.2/criu/mount.c:937:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2563:13: enter_function: entry to ‘can_mount_now’
criu-4.2/criu/mount.c:2641:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2643:17: branch_true: ...to here
criu-4.2/criu/mount.c:2647:17: branch_true: following ‘true’ branch (when ‘s != mi’)...
criu-4.2/criu/mount.c:2648:25: branch_true: ...to here
criu-4.2/criu/mount.c:2652:39: call_function: calling ‘root_path_from_parent’ from ‘can_mount_now’
#  935|   
#  936|   	len = m_len - p_len;
#  937|-> 	BUG_ON(len < 0);
#  938|   	if (len) {
#  939|   		if (m->ns_mountpoint[p_len] == '/')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def406]
criu-4.2/criu/mount.c:1024:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:1779:12: enter_function: entry to ‘dump_one_fs’
criu-4.2/criu/mount.c:1785:13: call_function: inlined call to ‘mnt_is_root_bind’ from ‘dump_one_fs’
# 1022|   	struct mount_info *bind;
# 1023|   
# 1024|-> 	BUG_ON(!mi);
# 1025|   
# 1026|   	if (pick(mi, mi))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def407]
criu-4.2/criu/mount.c:1032:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:1779:12: enter_function: entry to ‘dump_one_fs’
criu-4.2/criu/mount.c:1785:13: call_function: inlined call to ‘mnt_is_root_bind’ from ‘dump_one_fs’
# 1030|   	 * Shouldn't use mnt_bind list before it was populated in search_bindmounts
# 1031|   	 */
# 1032|-> 	BUG_ON(!mi->mnt_bind_is_populated);
# 1033|   
# 1034|   	list_for_each_entry(bind, &mi->mnt_bind, mnt_bind)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def408]
criu-4.2/criu/mount.c:1659:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
# 1657|   		return NULL;
# 1658|   
# 1659|-> 	return xstrdup(tmp);
# 1660|   }
# 1661|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def409]
criu-4.2/criu/mount.c:1697:20: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1690:40: return_function: returning to ‘add_cr_time_mount’ from ‘get_plain_mountpoint’
criu-4.2/criu/mount.c:1691:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1697:20: branch_true: ...to here
criu-4.2/criu/mount.c:1697:20: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1697:20: danger: ‘<unknown>’ leaks here; was allocated at [(31)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/30)
# 1695|   	mi->is_dir = true;
# 1696|   	mi->flags = mi->sb_flags = 0;
# 1697|-> 	mi->root = xstrdup("/");
# 1698|   	mi->fsname = xstrdup(fsname);
# 1699|   	mi->source = xstrdup(fsname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def410]
criu-4.2/criu/mount.c:1697:20: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1684:17: branch_false: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1697:20: branch_true: ...to here
criu-4.2/criu/mount.c:1697:20: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1697:20: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
# 1695|   	mi->is_dir = true;
# 1696|   	mi->flags = mi->sb_flags = 0;
# 1697|-> 	mi->root = xstrdup("/");
# 1698|   	mi->fsname = xstrdup(fsname);
# 1699|   	mi->source = xstrdup(fsname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def411]
criu-4.2/criu/mount.c:1698:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1690:40: return_function: returning to ‘add_cr_time_mount’ from ‘get_plain_mountpoint’
criu-4.2/criu/mount.c:1691:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1698:22: branch_true: ...to here
criu-4.2/criu/mount.c:1698:22: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1698:22: danger: ‘<unknown>’ leaks here; was allocated at [(31)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/30)
# 1696|   	mi->flags = mi->sb_flags = 0;
# 1697|   	mi->root = xstrdup("/");
# 1698|-> 	mi->fsname = xstrdup(fsname);
# 1699|   	mi->source = xstrdup(fsname);
# 1700|   	mi->options = xstrdup("");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def412]
criu-4.2/criu/mount.c:1698:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1684:17: branch_false: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1697:20: branch_true: ...to here
criu-4.2/criu/mount.c:1698:22: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1698:22: branch_true: ...to here
criu-4.2/criu/mount.c:1698:22: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1698:22: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/10)
# 1696|   	mi->flags = mi->sb_flags = 0;
# 1697|   	mi->root = xstrdup("/");
# 1698|-> 	mi->fsname = xstrdup(fsname);
# 1699|   	mi->source = xstrdup(fsname);
# 1700|   	mi->options = xstrdup("");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def413]
criu-4.2/criu/mount.c:1699:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1690:40: return_function: returning to ‘add_cr_time_mount’ from ‘get_plain_mountpoint’
criu-4.2/criu/mount.c:1691:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1699:22: branch_true: ...to here
criu-4.2/criu/mount.c:1699:22: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1699:22: danger: ‘<unknown>’ leaks here; was allocated at [(31)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/30)
# 1697|   	mi->root = xstrdup("/");
# 1698|   	mi->fsname = xstrdup(fsname);
# 1699|-> 	mi->source = xstrdup(fsname);
# 1700|   	mi->options = xstrdup("");
# 1701|   	if (!mi->root || !mi->fsname || !mi->source || !mi->options)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def414]
criu-4.2/criu/mount.c:1699:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1684:17: branch_false: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1697:20: branch_true: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1699:22: branch_true: ...to here
criu-4.2/criu/mount.c:1699:22: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1699:22: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/10)
# 1697|   	mi->root = xstrdup("/");
# 1698|   	mi->fsname = xstrdup(fsname);
# 1699|-> 	mi->source = xstrdup(fsname);
# 1700|   	mi->options = xstrdup("");
# 1701|   	if (!mi->root || !mi->fsname || !mi->source || !mi->options)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def415]
criu-4.2/criu/mount.c:1700:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1690:40: return_function: returning to ‘add_cr_time_mount’ from ‘get_plain_mountpoint’
criu-4.2/criu/mount.c:1691:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1699:9: branch_false: ...to here
criu-4.2/criu/mount.c:1700:23: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1700:23: branch_true: ...to here
criu-4.2/criu/mount.c:1700:23: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1700:23: danger: ‘<unknown>’ leaks here; was allocated at [(31)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/30)
# 1698|   	mi->fsname = xstrdup(fsname);
# 1699|   	mi->source = xstrdup(fsname);
# 1700|-> 	mi->options = xstrdup("");
# 1701|   	if (!mi->root || !mi->fsname || !mi->source || !mi->options)
# 1702|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def416]
criu-4.2/criu/mount.c:1700:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1684:17: branch_false: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1697:20: branch_true: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1699:9: branch_false: ...to here
criu-4.2/criu/mount.c:1700:23: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1700:23: branch_true: ...to here
criu-4.2/criu/mount.c:1700:23: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:1700:23: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/10)
# 1698|   	mi->fsname = xstrdup(fsname);
# 1699|   	mi->source = xstrdup(fsname);
# 1700|-> 	mi->options = xstrdup("");
# 1701|   	if (!mi->root || !mi->fsname || !mi->source || !mi->options)
# 1702|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def417]
criu-4.2/criu/mount.c:1703:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1685:12: branch_true: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:1690:40: branch_true: ...to here
criu-4.2/criu/mount.c:1690:40: call_function: calling ‘get_plain_mountpoint’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1690:40: return_function: returning to ‘add_cr_time_mount’ from ‘get_plain_mountpoint’
criu-4.2/criu/mount.c:1691:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1699:9: branch_false: ...to here
criu-4.2/criu/mount.c:1700:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1700:9: branch_false: ...to here
criu-4.2/criu/mount.c:1701:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1703:22: throw: if ‘find_fstype_by_name’ throws an exception...
criu-4.2/criu/mount.c:1703:22: danger: ‘<unknown>’ leaks here; was allocated at [(31)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/30)
# 1701|   	if (!mi->root || !mi->fsname || !mi->source || !mi->options)
# 1702|   		goto err;
# 1703|-> 	mi->fstype = find_fstype_by_name(fsname);
# 1704|   
# 1705|   	mi->s_dev = mi->s_dev_rt = s_dev;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def418]
criu-4.2/criu/mount.c:1703:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: acquire_memory: allocated here
criu-4.2/criu/mount.c:1680:26: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1680:9: branch_false: ...to here
criu-4.2/criu/mount.c:1681:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1683:12: branch_false: ...to here
criu-4.2/criu/mount.c:1683:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1684:17: branch_false: ...to here
criu-4.2/criu/mount.c:1685:12: branch_false: following ‘false’ branch (when ‘add_slash == 0’)...
criu-4.2/criu/mount.c:1686:17: branch_false: ...to here
criu-4.2/criu/mount.c:1689:12: branch_false: following ‘false’ branch (when ‘rst == 0’)...
criu-4.2/criu/mount.c:1694:9: branch_false: ...to here
criu-4.2/criu/mount.c:1697:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1697:9: branch_false: ...to here
criu-4.2/criu/mount.c:1698:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1698:9: branch_false: ...to here
criu-4.2/criu/mount.c:1699:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1699:9: branch_false: ...to here
criu-4.2/criu/mount.c:1700:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:1700:9: branch_false: ...to here
criu-4.2/criu/mount.c:1701:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1703:22: throw: if ‘find_fstype_by_name’ throws an exception...
criu-4.2/criu/mount.c:1703:22: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/10)
# 1701|   	if (!mi->root || !mi->fsname || !mi->source || !mi->options)
# 1702|   		goto err;
# 1703|-> 	mi->fstype = find_fstype_by_name(fsname);
# 1704|   
# 1705|   	mi->s_dev = mi->s_dev_rt = s_dev;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def419]
criu-4.2/criu/mount.c:2102:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2102:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2102:9: branch_true: ...to here
criu-4.2/criu/mount.c:2102:9: danger: dereference of NULL ‘0’
# 2100|   	char *mpath, buf[PATH_MAX];
# 2101|   
# 2102|-> 	BUG_ON(mi->parent == root_yard_mp);
# 2103|   
# 2104|   	list_for_each_entry(t, &mi->parent->mnt_slave_list, mnt_slave) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def420]
criu-4.2/criu/mount.c:2316:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(service_mountpoint(mi), 2097152)’
criu-4.2/criu/mount.c:2288:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2288:12: branch_false: ...to here
criu-4.2/criu/mount.c:2297:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2298:24: branch_true: ...to here
criu-4.2/criu/mount.c:2300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2305:13: branch_false: ...to here
criu-4.2/criu/mount.c:2305:13: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2308:12: branch_false: ...to here
criu-4.2/criu/mount.c:2308:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2311:27: branch_true: ...to here
criu-4.2/criu/mount.c:2311:22: acquire_resource: opened here
criu-4.2/criu/mount.c:2312:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2316:24: branch_false: ...to here
criu-4.2/criu/mount.c:2317:21: throw: if ‘__userns_call’ throws an exception...
criu-4.2/criu/mount.c:2316:24: danger: ‘open(service_mountpoint(mi), 2097152)’ leaks here; was opened at [(11)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/10)
# 2314|   			return -1;
# 2315|   		}
# 2316|-> 		sflags |= MS_RDONLY | MS_REMOUNT;
# 2317|   		if (userns_call(apply_sb_flags, 0, &sflags, sizeof(sflags), fd)) {
# 2318|   			pr_err("Unable to apply mount flags %d for %s\n", mi->sb_flags, service_mountpoint(mi));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def421]
criu-4.2/criu/mount.c:2334:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2288:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2288:12: branch_false: ...to here
criu-4.2/criu/mount.c:2300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2305:13: branch_false: ...to here
criu-4.2/criu/mount.c:2308:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2325:12: branch_false: ...to here
criu-4.2/criu/mount.c:2334:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2334:9: branch_true: ...to here
criu-4.2/criu/mount.c:2334:9: danger: dereference of NULL ‘0’
# 2332|   	 * Look at can_mount_now() for details.
# 2333|   	 */
# 2334|-> 	BUG_ON(mi->master_id);
# 2335|   	if (restore_shared_options(mi, !mi->shared_id, mi->shared_id, 0))
# 2336|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def422]
criu-4.2/criu/mount.c:2573:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2573:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2573:9: branch_true: ...to here
criu-4.2/criu/mount.c:2573:9: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2573:9: branch_false: ...to here
criu-4.2/criu/mount.c:2573:9: danger: dereference of NULL ‘0’
# 2571|   
# 2572|   	/* Parent should be mounted already, that's how mnt_tree_for_each works */
# 2573|-> 	BUG_ON(mi->parent && !mi->parent->mounted);
# 2574|   
# 2575|   	if (mnt_is_nodev_external(mi))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def423]
criu-4.2/criu/mount.c:2628:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2624:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2627:17: branch_true: ...to here
criu-4.2/criu/mount.c:2627:17: branch_true: following ‘true’ branch (when ‘p != mi’)...
criu-4.2/criu/mount.c:2628:25: branch_true: ...to here
criu-4.2/criu/mount.c:2628:25: danger: dereference of NULL ‘0’
# 2626|   
# 2627|   		list_for_each_entry(p, &mi->mnt_propagate, mnt_propagate) {
# 2628|-> 			BUG_ON(!p->parent);
# 2629|   			if (!p->parent->mounted) {
# 2630|   				pr_debug("%s: false as %d has unmounted parent %d of its propagation group\n", __func__,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def424]
criu-4.2/criu/mount.c:2653:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:2641:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2643:17: branch_true: ...to here
criu-4.2/criu/mount.c:2647:17: branch_true: following ‘true’ branch (when ‘s != mi’)...
criu-4.2/criu/mount.c:2648:25: branch_true: ...to here
criu-4.2/criu/mount.c:2653:33: danger: dereference of NULL ‘0’
# 2651|   
# 2652|   				ret = root_path_from_parent(c, root_path, PATH_MAX);
# 2653|-> 				BUG_ON(ret);
# 2654|   
# 2655|   				/* Mount is out of our root */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def425]
criu-4.2/criu/mount.c:2765:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(service_mountpoint(mi), 2097152)’
criu-4.2/criu/mount.c:2726:12: enter_function: entry to ‘do_mount_one’
criu-4.2/criu/mount.c:2752:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2758:21: branch_false: ...to here
criu-4.2/criu/mount.c:2758:20: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:2759:35: branch_true: ...to here
criu-4.2/criu/mount.c:2759:30: acquire_resource: opened here
criu-4.2/criu/mount.c:2760:28: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:2765:29: branch_false: ...to here
criu-4.2/criu/mount.c:2765:29: throw: if ‘__userns_call’ throws an exception...
criu-4.2/criu/mount.c:2765:29: danger: ‘open(service_mountpoint(mi), 2097152)’ leaks here; was opened at [(9)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/8)
# 2763|   			}
# 2764|   
# 2765|-> 			if (userns_call(mount_root, 0, &flags, sizeof(flags), fd)) {
# 2766|   				pr_err("Unable to mount %s\n", service_mountpoint(mi));
# 2767|   				close(fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def426]
criu-4.2/criu/mount.c:3015:36: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/mount.c:3012:15: acquire_memory: allocated here
criu-4.2/criu/mount.c:3012:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/mount.c:3014:20: branch_false: ...to here
criu-4.2/criu/mount.c:3014:20: branch_true: following ‘true’ branch (when ‘rst != 0’)...
criu-4.2/criu/mount.c:3015:36: branch_true: ...to here
criu-4.2/criu/mount.c:3015:36: throw: if ‘shmalloc’ throws an exception...
criu-4.2/criu/mount.c:3015:36: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
# 3013|   	if (new) {
# 3014|   		if (rst) {
# 3015|-> 			new->rmi = shmalloc(sizeof(struct rst_mount_info));
# 3016|   			if (!new->rmi) {
# 3017|   				xfree(new);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def427]
criu-4.2/criu/mount.c:3027:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_entry_alloc(rst)’
criu-4.2/criu/mount.c:1662:35: enter_function: entry to ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: call_function: calling ‘mnt_entry_alloc’ from ‘add_cr_time_mount’
criu-4.2/criu/mount.c:1669:14: return_function: returning to ‘add_cr_time_mount’ from ‘mnt_entry_alloc’
criu-4.2/criu/mount.c:1670:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:1673:22: branch_false: ...to here
criu-4.2/criu/mount.c:1680:26: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/mount.c:1680:26: branch_true: ...to here
criu-4.2/criu/mount.c:1680:26: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:3027:17: danger: ‘mnt_entry_alloc(rst)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/3)
# 3025|   		new->fd = -1;
# 3026|   		new->is_overmounted = -1;
# 3027|-> 		INIT_LIST_HEAD(&new->children);
# 3028|   		INIT_LIST_HEAD(&new->siblings);
# 3029|   		INIT_LIST_HEAD(&new->mnt_slave_list);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def428]
criu-4.2/criu/mount.c:3091:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:3091:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3091:9: danger: dereference of NULL ‘0’
# 3089|   	char *ext = NULL;
# 3090|   
# 3091|-> 	BUG_ON(me->ext_mount && me->ext_key);
# 3092|   
# 3093|   	/* Forward compatibility fixup */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def429]
criu-4.2/criu/mount.c:3297:30: warning[-Wanalyzer-malloc-leak]: leak of ‘head’
criu-4.2/criu/mount.c:3378:5: enter_function: entry to ‘read_mnt_ns_img’
criu-4.2/criu/mount.c:3383:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3388:14: branch_false: ...to here
criu-4.2/criu/mount.c:3388:29: branch_true: following ‘true’ branch (when ‘nsid’ is non-NULL)...
criu-4.2/criu/mount.c:3389:36: branch_true: ...to here
criu-4.2/criu/mount.c:3394:21: call_function: calling ‘collect_mnt_from_image’ from ‘read_mnt_ns_img’
# 3295|   			pm->internal_sharing = me->internal_sharing;
# 3296|   
# 3297|-> 		pm->source = xstrdup(me->source);
# 3298|   		if (!pm->source)
# 3299|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def430]
criu-4.2/criu/mount.c:3297:30: warning[-Wanalyzer-malloc-leak]: leak of ‘tail’
criu-4.2/criu/mount.c:3378:5: enter_function: entry to ‘read_mnt_ns_img’
criu-4.2/criu/mount.c:3383:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3388:14: branch_false: ...to here
criu-4.2/criu/mount.c:3388:29: branch_true: following ‘true’ branch (when ‘nsid’ is non-NULL)...
criu-4.2/criu/mount.c:3389:36: branch_true: ...to here
criu-4.2/criu/mount.c:3394:21: call_function: calling ‘collect_mnt_from_image’ from ‘read_mnt_ns_img’
# 3295|   			pm->internal_sharing = me->internal_sharing;
# 3296|   
# 3297|-> 		pm->source = xstrdup(me->source);
# 3298|   		if (!pm->source)
# 3299|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def431]
criu-4.2/criu/mount.c:3494:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:3469:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3472:13: branch_false: ...to here
criu-4.2/criu/mount.c:3472:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3485:20: branch_false: following ‘false’ branch (when ‘parent’ is NULL)...
criu-4.2/criu/mount.c:3488:24: branch_false: ...to here
criu-4.2/criu/mount.c:3489:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3494:17: branch_false: ...to here
criu-4.2/criu/mount.c:3494:17: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3494:17: branch_true: ...to here
criu-4.2/criu/mount.c:3494:17: danger: dereference of NULL ‘0’
# 3492|   		}
# 3493|   
# 3494|-> 		BUG_ON(nsid->type == NS_CRIU);
# 3495|   
# 3496|   		if (do_restore_task_mnt_ns(nsid))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def432]
criu-4.2/criu/mount.c:3616:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".", 2097152)’
criu-4.2/criu/mount.c:3642:5: enter_function: entry to ‘depopulate_roots_yard’
criu-4.2/criu/mount.c:3646:12: branch_false: following ‘false’ branch (when ‘mntns_fd >= 0’)...
criu-4.2/criu/mount.c:3652:9: branch_false: ...to here
criu-4.2/criu/mount.c:3654:19: acquire_resource: opened here
criu-4.2/criu/mount.c:3655:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3660:18: branch_false: ...to here
criu-4.2/criu/mount.c:3660:18: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3666:13: branch_false: ...to here
criu-4.2/criu/mount.c:3666:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3673:13: branch_false: ...to here
criu-4.2/criu/mount.c:3676:13: call_function: calling ‘__depopulate_roots_yard’ from ‘depopulate_roots_yard’
# 3614|   	int ret = 0;
# 3615|   
# 3616|-> 	if (mnt_roots == NULL)
# 3617|   		return 0;
# 3618|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def433]
criu-4.2/criu/mount.c:3660:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".", 2097152)’
criu-4.2/criu/mount.c:3646:12: branch_false: following ‘false’ branch (when ‘mntns_fd >= 0’)...
criu-4.2/criu/mount.c:3652:9: branch_false: ...to here
criu-4.2/criu/mount.c:3654:19: acquire_resource: opened here
criu-4.2/criu/mount.c:3655:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3660:18: branch_false: ...to here
criu-4.2/criu/mount.c:3660:18: throw: if ‘do_open_proc’ throws an exception...
criu-4.2/criu/mount.c:3660:18: danger: ‘open(".", 2097152)’ leaks here; was opened at [(3)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/2)
# 3658|   	}
# 3659|   
# 3660|-> 	old_ns = open_proc(PROC_SELF, "ns/mnt");
# 3661|   	if (old_ns < 0) {
# 3662|   		pr_perror("`- Can't keep old ns");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def434]
criu-4.2/criu/mount.c:3667:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".", 2097152)’
criu-4.2/criu/mount.c:3646:12: branch_false: following ‘false’ branch (when ‘mntns_fd >= 0’)...
criu-4.2/criu/mount.c:3652:9: branch_false: ...to here
criu-4.2/criu/mount.c:3654:19: acquire_resource: opened here
criu-4.2/criu/mount.c:3655:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3660:18: branch_false: ...to here
criu-4.2/criu/mount.c:3660:18: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3666:13: branch_false: ...to here
criu-4.2/criu/mount.c:3666:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3667:17: branch_true: ...to here
criu-4.2/criu/mount.c:3667:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/mount.c:3667:17: danger: ‘open(".", 2097152)’ leaks here; was opened at [(3)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/2)
# 3665|   	}
# 3666|   	if (setns(mntns_fd, CLONE_NEWNS) < 0) {
# 3667|-> 		pr_perror("`- Can't switch");
# 3668|   		close(old_ns);
# 3669|   		close(old_cwd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def435]
criu-4.2/criu/mount.c:3673:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".", 2097152)’
criu-4.2/criu/mount.c:3646:12: branch_false: following ‘false’ branch (when ‘mntns_fd >= 0’)...
criu-4.2/criu/mount.c:3652:9: branch_false: ...to here
criu-4.2/criu/mount.c:3654:19: acquire_resource: opened here
criu-4.2/criu/mount.c:3655:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3660:18: branch_false: ...to here
criu-4.2/criu/mount.c:3660:18: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3666:13: branch_false: ...to here
criu-4.2/criu/mount.c:3666:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3673:13: branch_false: ...to here
criu-4.2/criu/mount.c:3673:13: throw: if ‘try_clean_remaps’ throws an exception...
criu-4.2/criu/mount.c:3673:13: danger: ‘open(".", 2097152)’ leaks here; was opened at [(3)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/2)
# 3671|   	}
# 3672|   
# 3673|-> 	if (try_clean_remaps(only_ghosts))
# 3674|   		ret = -1;
# 3675|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def436]
criu-4.2/criu/mount.c:3828:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/mount.c:3835:5: enter_function: entry to ‘__mntns_get_root_fd’
criu-4.2/criu/mount.c:3841:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3844:14: branch_false: ...to here
criu-4.2/criu/mount.c:3844:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3852:22: branch_true: ...to here
criu-4.2/criu/mount.c:3852:22: acquire_resource: opened here
criu-4.2/criu/mount.c:3853:20: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:3858:17: branch_false: ...to here
criu-4.2/criu/mount.c:3888:16: call_function: inlined call to ‘mntns_set_root_fd’ from ‘__mntns_get_root_fd’
# 3826|   	int ret;
# 3827|   
# 3828|-> 	ret = install_service_fd(ROOT_FD_OFF, fd);
# 3829|   	if (ret >= 0)
# 3830|   		mntns_root_pid = pid;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def437]
criu-4.2/criu/mount.c:3953:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:3951:12: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3952:25: branch_true: ...to here
criu-4.2/criu/mount.c:3953:17: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:3953:17: branch_true: ...to here
criu-4.2/criu/mount.c:3953:17: danger: dereference of NULL ‘0’
# 3951|   	if (root_ns_mask & CLONE_NEWNS) {
# 3952|   		mntns = lookup_nsid_by_mnt_id(mnt_id);
# 3953|-> 		BUG_ON(mntns == NULL);
# 3954|   	}
# 3955|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def438]
criu-4.2/criu/mount.c:4152:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/mount.c:4145:12: branch_false: following ‘false’ branch...
criu-4.2/criu/mount.c:4148:12: branch_false: ...to here
criu-4.2/criu/mount.c:4152:9: branch_true: following ‘true’ branch...
criu-4.2/criu/mount.c:4152:9: branch_true: ...to here
criu-4.2/criu/mount.c:4152:9: danger: dereference of NULL ‘0’
# 4150|   
# 4151|   	/* All mounts in mntinfo list should have it on restore */
# 4152|-> 	BUG_ON(mi->rmi == NULL);
# 4153|   
# 4154|   	if (mi->flags & MS_RDONLY && !(mi->rmi->remounted_rw & remounted)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def439]
criu-4.2/criu/namespaces.c:150:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/namespaces.c:143:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:146:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:146:14: acquire_memory: allocated here
criu-4.2/criu/namespaces.c:146:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:150:23: branch_false: ...to here
criu-4.2/criu/namespaces.c:150:23: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/namespaces.c:150:23: branch_true: ...to here
criu-4.2/criu/namespaces.c:150:23: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/namespaces.c:150:23: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  148|   		return -1;
#  149|   
#  150|-> 	jn->ns_file = xstrdup(ns_file);
#  151|   	if (!jn->ns_file) {
#  152|   		xfree(jn);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def440]
criu-4.2/criu/namespaces.c:169:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/namespaces.c:143:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:146:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:146:14: acquire_memory: allocated here
criu-4.2/criu/namespaces.c:146:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:150:23: branch_false: ...to here
criu-4.2/criu/namespaces.c:150:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:150:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:151:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:156:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:156:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:159:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:159:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:162:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:162:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:165:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:165:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:168:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:168:19: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:169:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:169:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/namespaces.c:169:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  167|   		join_ns_flags |= CLONE_NEWIPC;
#  168|   	} else if (!strncmp(type, "pid", 4)) {
#  169|-> 		pr_err("join-ns pid namespace not supported\n");
#  170|   		goto err;
#  171|   	} else if (!strncmp(type, "user", 5)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def441]
criu-4.2/criu/namespaces.c:182:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/namespaces.c:143:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:146:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:146:14: acquire_memory: allocated here
criu-4.2/criu/namespaces.c:146:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:150:23: branch_false: ...to here
criu-4.2/criu/namespaces.c:150:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:150:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:151:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:156:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:156:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:159:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:159:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:162:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:162:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:165:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:165:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:168:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:168:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:171:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:171:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:178:21: branch_false: ...to here
criu-4.2/criu/namespaces.c:178:19: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:182:17: branch_false: ...to here
criu-4.2/criu/namespaces.c:182:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/namespaces.c:182:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  180|   		join_ns_flags |= CLONE_NEWNS;
#  181|   	} else {
#  182|-> 		pr_err("invalid namespace type %s\n", type);
#  183|   		goto err;
#  184|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def442]
criu-4.2/criu/namespaces.c:204:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:200:12: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:201:25: branch_true: ...to here
criu-4.2/criu/namespaces.c:201:20: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:203:28: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:204:33: branch_true: following ‘true’ branch (when ‘kid > 4294967295’)...
criu-4.2/criu/namespaces.c:204:33: branch_true: ...to here
criu-4.2/criu/namespaces.c:204:33: danger: dereference of NULL ‘0’
#  202|   			kid = strtoul(&link[d->len + 2], &end, 10);
#  203|   			if (end && *end == ']')
#  204|-> 				BUG_ON(kid > UINT_MAX);
#  205|   			else
#  206|   				kid = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def443]
criu-4.2/criu/namespaces.c:235:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".", 2097152)’
criu-4.2/criu/namespaces.c:285:5: enter_function: entry to ‘switch_mnt_ns’
criu-4.2/criu/namespaces.c:289:12: branch_false: following ‘false’ branch (when ‘cwd_fd’ is non-NULL)...
criu-4.2/criu/namespaces.c:292:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:292:14: acquire_resource: opened here
criu-4.2/criu/namespaces.c:293:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:298:13: branch_false: ...to here
criu-4.2/criu/namespaces.c:298:13: call_function: calling ‘switch_ns’ from ‘switch_mnt_ns’
#  233|   	int ret;
#  234|   
#  235|-> 	nsfd = open_proc(pid, "ns/%s", nd->str);
#  236|   	if (nsfd < 0)
#  237|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def444]
criu-4.2/criu/namespaces.c:455:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:449:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:452:20: branch_false: ...to here
criu-4.2/criu/namespaces.c:452:12: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:454:37: branch_true: ...to here
criu-4.2/criu/namespaces.c:454:20: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:455:25: branch_true: ...to here
criu-4.2/criu/namespaces.c:455:25: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:455:25: branch_true: ...to here
criu-4.2/criu/namespaces.c:455:25: danger: dereference of NULL ‘0’
#  453|   		type = NS_OTHER;
#  454|   		if (pid == root_item->pid->real) {
#  455|-> 			BUG_ON(root_ns_mask & nd->cflag);
#  456|   			pr_info("Will take %s namespace in the image\n", nd->str);
#  457|   			root_ns_mask |= nd->cflag;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def445]
criu-4.2/criu/namespaces.c:509:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:494:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:497:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:499:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:508:15: branch_false: ...to here
criu-4.2/criu/namespaces.c:509:9: branch_true: following ‘true’ branch (when ‘kid == 0’)...
criu-4.2/criu/namespaces.c:509:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:509:9: danger: dereference of NULL ‘0’
#  507|   	}
#  508|   	kid = st.st_ino;
#  509|-> 	BUG_ON(!kid);
#  510|   
#  511|   out:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def446]
criu-4.2/criu/namespaces.c:842:29: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/namespaces.c:830:13: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:830:13: branch_false: ...to here
criu-4.2/criu/namespaces.c:830:13: acquire_memory: allocated here
criu-4.2/criu/namespaces.c:830:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/namespaces.c:831:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:831:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/namespaces.c:831:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:838:20: branch_true: following ‘true’ branch (when ‘len == size’)...
criu-4.2/criu/namespaces.c:841:32: branch_true: ...to here
criu-4.2/criu/namespaces.c:842:29: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/namespaces.c:842:29: branch_true: ...to here
criu-4.2/criu/namespaces.c:842:29: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/namespaces.c:842:29: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  840|   
#  841|   			size = size * 2 + 1;
#  842|-> 			t = xrealloc(extents, size * sizeof(UidGidExtent));
#  843|   			if (t == NULL)
#  844|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def447]
criu-4.2/criu/namespaces.c:850:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/namespaces.c:830:13: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:831:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/namespaces.c:831:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:838:20: branch_true: following ‘true’ branch (when ‘len == size’)...
criu-4.2/criu/namespaces.c:841:32: branch_true: ...to here
criu-4.2/criu/namespaces.c:842:29: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:848:31: branch_false: ...to here
criu-4.2/criu/namespaces.c:850:17: throw: if ‘uid_gid_extent__init’ throws an exception...
criu-4.2/criu/namespaces.c:850:17: danger: ‘___p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/6)
#  848|   		ext = &extents[len];
#  849|   
#  850|-> 		uid_gid_extent__init(ext);
#  851|   		ret = fscanf(f, "%d %d %d", &ext->first, &ext->lower_first, &ext->count);
#  852|   		if (ret != 3) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def448]
criu-4.2/criu/namespaces.c:850:17: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/namespaces.c:830:13: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:830:13: branch_false: ...to here
criu-4.2/criu/namespaces.c:830:13: acquire_memory: allocated here
criu-4.2/criu/namespaces.c:830:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/namespaces.c:831:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:831:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/namespaces.c:831:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:838:20: branch_true: following ‘true’ branch (when ‘len == size’)...
criu-4.2/criu/namespaces.c:841:32: branch_true: ...to here
criu-4.2/criu/namespaces.c:842:29: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/namespaces.c:848:31: branch_false: ...to here
criu-4.2/criu/namespaces.c:850:17: throw: if ‘uid_gid_extent__init’ throws an exception...
criu-4.2/criu/namespaces.c:850:17: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  848|   		ext = &extents[len];
#  849|   
#  850|-> 		uid_gid_extent__init(ext);
#  851|   		ret = fscanf(f, "%d %d %d", &ext->first, &ext->lower_first, &ext->count);
#  852|   		if (ret != 3) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def449]
criu-4.2/criu/namespaces.c:1262:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1260|   		m->h.msg_controllen += CMSG_SPACE(sizeof(int));
# 1261|   		ch = CMSG_NXTHDR(&m->h, ch);
# 1262|-> 		BUG_ON(!ch);
# 1263|   		ch->cmsg_len = CMSG_LEN(sizeof(int));
# 1264|   		ch->cmsg_level = SOL_SOCKET;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def450]
criu-4.2/criu/namespaces.c:1276:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1274|   
# 1275|   	ch = CMSG_FIRSTHDR(&um->h);
# 1276|-> 	BUG_ON(!ch);
# 1277|   	BUG_ON(ch->cmsg_len != CMSG_LEN(sizeof(struct ucred)));
# 1278|   	BUG_ON(ch->cmsg_level != SOL_SOCKET);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def451]
criu-4.2/criu/namespaces.c:1277:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:1275:14: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1275:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1276:9: branch_false: following ‘false’ branch (when ‘ch’ is non-NULL)...
criu-4.2/criu/namespaces.c:1277:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1277:9: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1277:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1277:9: danger: dereference of NULL ‘0’
# 1275|   	ch = CMSG_FIRSTHDR(&um->h);
# 1276|   	BUG_ON(!ch);
# 1277|-> 	BUG_ON(ch->cmsg_len != CMSG_LEN(sizeof(struct ucred)));
# 1278|   	BUG_ON(ch->cmsg_level != SOL_SOCKET);
# 1279|   	BUG_ON(ch->cmsg_type != SCM_CREDENTIALS);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def452]
criu-4.2/criu/namespaces.c:1278:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:1275:14: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1275:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1276:9: branch_false: following ‘false’ branch (when ‘ch’ is non-NULL)...
criu-4.2/criu/namespaces.c:1277:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1277:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1278:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1278:9: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1278:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1278:9: danger: dereference of NULL ‘0’
# 1276|   	BUG_ON(!ch);
# 1277|   	BUG_ON(ch->cmsg_len != CMSG_LEN(sizeof(struct ucred)));
# 1278|-> 	BUG_ON(ch->cmsg_level != SOL_SOCKET);
# 1279|   	BUG_ON(ch->cmsg_type != SCM_CREDENTIALS);
# 1280|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def453]
criu-4.2/criu/namespaces.c:1279:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:1275:14: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1275:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1276:9: branch_false: following ‘false’ branch (when ‘ch’ is non-NULL)...
criu-4.2/criu/namespaces.c:1277:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1277:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1278:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1278:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1279:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1279:9: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1279:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1279:9: danger: dereference of NULL ‘0’
# 1277|   	BUG_ON(ch->cmsg_len != CMSG_LEN(sizeof(struct ucred)));
# 1278|   	BUG_ON(ch->cmsg_level != SOL_SOCKET);
# 1279|-> 	BUG_ON(ch->cmsg_type != SCM_CREDENTIALS);
# 1280|   
# 1281|   	if (pid) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def454]
criu-4.2/criu/namespaces.c:1289:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:1270:6: enter_function: entry to ‘unsc_msg_pid_fd’
criu-4.2/criu/namespaces.c:1275:14: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1275:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1276:9: branch_false: following ‘false’ branch (when ‘ch’ is non-NULL)...
criu-4.2/criu/namespaces.c:1277:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1277:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1278:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1278:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1279:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1279:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1281:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:1286:14: call_function: inlined call to ‘__cmsg_nxthdr’ from ‘unsc_msg_pid_fd’
criu-4.2/criu/namespaces.c:1288:13: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1289:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:1289:17: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1289:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:1289:17: danger: dereference of NULL ‘0’
# 1287|   
# 1288|   	if (ch && ch->cmsg_len == CMSG_LEN(sizeof(int))) {
# 1289|-> 		BUG_ON(ch->cmsg_level != SOL_SOCKET);
# 1290|   		BUG_ON(ch->cmsg_type != SCM_RIGHTS);
# 1291|   		*fd = *((int *)CMSG_DATA(ch));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def455]
criu-4.2/criu/namespaces.c:1290:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:1270:6: enter_function: entry to ‘unsc_msg_pid_fd’
criu-4.2/criu/namespaces.c:1275:14: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1275:9: branch_true: ...to here
criu-4.2/criu/namespaces.c:1276:9: branch_false: following ‘false’ branch (when ‘ch’ is non-NULL)...
criu-4.2/criu/namespaces.c:1277:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1277:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1278:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1278:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1279:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1279:9: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1281:12: branch_false: ...to here
criu-4.2/criu/namespaces.c:1286:14: call_function: inlined call to ‘__cmsg_nxthdr’ from ‘unsc_msg_pid_fd’
criu-4.2/criu/namespaces.c:1288:13: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1289:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:1289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1290:17: branch_false: ...to here
criu-4.2/criu/namespaces.c:1290:17: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1290:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:1290:17: danger: dereference of NULL ‘0’
# 1288|   	if (ch && ch->cmsg_len == CMSG_LEN(sizeof(int))) {
# 1289|   		BUG_ON(ch->cmsg_level != SOL_SOCKET);
# 1290|-> 		BUG_ON(ch->cmsg_type != SCM_RIGHTS);
# 1291|   		*fd = *((int *)CMSG_DATA(ch));
# 1292|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def456]
criu-4.2/criu/namespaces.c:1400:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/namespaces.c:1370:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1375:13: branch_false: ...to here
criu-4.2/criu/namespaces.c:1375:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1378:14: branch_false: ...to here
criu-4.2/criu/namespaces.c:1379:12: branch_false: following ‘false’ branch...
criu-4.2/criu/namespaces.c:1383:9: branch_false: ...to here
criu-4.2/criu/namespaces.c:1385:12: branch_true: following ‘true’ branch (when ‘async != 0’)...
criu-4.2/criu/namespaces.c:1400:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:1400:17: branch_true: following ‘true’ branch...
criu-4.2/criu/namespaces.c:1400:17: branch_true: ...to here
criu-4.2/criu/namespaces.c:1400:17: danger: dereference of NULL ‘0’
# 1398|   		 * we should NOT do the asynchronous call.
# 1399|   		 */
# 1400|-> 		BUG_ON(flags & UNS_FDOUT);
# 1401|   
# 1402|   	/* Send the request */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def457]
criu-4.2/criu/net.c:260:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2698:12: enter_function: entry to ‘restore_netns_conf’
criu-4.2/criu/net.c:2703:12: branch_false: following ‘false’ branch (when ‘netns’ is non-NULL)...
criu-4.2/criu/net.c:2707:13: branch_false: ...to here
criu-4.2/criu/net.c:2707:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2708:63: branch_true: ...to here
criu-4.2/criu/net.c:2708:23: call_function: calling ‘ipv4_conf_op’ from ‘restore_netns_conf’
#  258|   	for (i = 0, ri = 0; i < size; i++) {
#  259|   		if (i >= n) {
#  260|-> 			pr_warn("Skip %s/%s\n", tgt, devconfs[i]);
#  261|   			continue;
#  262|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def458]
criu-4.2/criu/net.c:968:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
#  966|   		return 0;
#  967|   
#  968|-> 	err = nlmsg_parse(nlh, sizeof(struct nfgenmsg), tb, CTA_MAX, NULL);
#  969|   	if (err < 0)
#  970|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def459]
criu-4.2/criu/net.c:975:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
#  973|   		return 0;
#  974|   
#  975|-> 	err = nla_parse_nested(tbp, CTA_PROTOINFO_MAX, tb[CTA_PROTOINFO], NULL);
#  976|   	if (err < 0)
#  977|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def460]
criu-4.2/criu/net.c:982:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
#  980|   		return 0;
#  981|   
#  982|-> 	err = nla_parse_nested(tb_tcp, CTA_PROTOINFO_TCP_MAX, tbp[CTA_PROTOINFO_TCP], NULL);
#  983|   	if (err < 0)
#  984|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def461]
criu-4.2/criu/net.c:989:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
#  987|   		struct nf_ct_tcp_flags *flags;
#  988|   
#  989|-> 		flags = nla_data(tb_tcp[CTA_PROTOINFO_TCP_FLAGS_ORIGINAL]);
#  990|   		flags->flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
#  991|   		flags->mask |= IP_CT_TCP_FLAG_BE_LIBERAL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def462]
criu-4.2/criu/net.c:997:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
#  995|   		struct nf_ct_tcp_flags *flags;
#  996|   
#  997|-> 		flags = nla_data(tb_tcp[CTA_PROTOINFO_TCP_FLAGS_REPLY]);
#  998|   		flags->flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
#  999|   		flags->mask |= IP_CT_TCP_FLAG_BE_LIBERAL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def463]
criu-4.2/criu/net.c:1025:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1023|   	}
# 1024|   
# 1025|-> 	nlh = xmalloc(sizeof(struct nlmsghdr));
# 1026|   	if (nlh == NULL)
# 1027|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def464]
criu-4.2/criu/net.c:1033:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1031|   		int ret;
# 1032|   
# 1033|-> 		ret = read_img_buf_eof(img, nlh, sizeof(struct nlmsghdr));
# 1034|   		if (ret < 0)
# 1035|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def465]
criu-4.2/criu/net.c:1033:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1031|   		int ret;
# 1032|   
# 1033|-> 		ret = read_img_buf_eof(img, nlh, sizeof(struct nlmsghdr));
# 1034|   		if (ret < 0)
# 1035|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def466]
criu-4.2/criu/net.c:1039:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1037|   			break;
# 1038|   
# 1039|-> 		p = xrealloc(nlh, nlh->nlmsg_len);
# 1040|   		if (p == NULL)
# 1041|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def467]
criu-4.2/criu/net.c:1044:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1042|   		nlh = p;
# 1043|   
# 1044|-> 		ret = read_img_buf_eof(img, nlh + 1, nlh->nlmsg_len - sizeof(struct nlmsghdr));
# 1045|   		if (ret < 0)
# 1046|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def468]
criu-4.2/criu/net.c:1044:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1042|   		nlh = p;
# 1043|   
# 1044|-> 		ret = read_img_buf_eof(img, nlh + 1, nlh->nlmsg_len - sizeof(struct nlmsghdr));
# 1045|   		if (ret < 0)
# 1046|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def469]
criu-4.2/criu/net.c:1048:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1046|   			goto out;
# 1047|   		if (ret == 0) {
# 1048|-> 			pr_err("The image file was truncated\n");
# 1049|   			goto out;
# 1050|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def470]
criu-4.2/criu/net.c:1057:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2979:12: enter_function: entry to ‘prepare_net_ns_second_stage’
criu-4.2/criu/net.c:3000:23: call_function: calling ‘restore_nf_ct’ from ‘prepare_net_ns_second_stage’
# 1055|   
# 1056|   		nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE;
# 1057|-> 		ret = do_rtnl_req(sk, nlh, nlh->nlmsg_len, NULL, NULL, NULL, NULL);
# 1058|   		if (ret)
# 1059|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def471]
criu-4.2/criu/net.c:1218:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 1216|   	}
# 1217|   
# 1218|-> 	addattr_l(&req->h, sizeof(*req), IFLA_IFNAME, nde->name, strlen(nde->name));
# 1219|   	addattr_l(&req->h, sizeof(*req), IFLA_MTU, &nde->mtu, sizeof(nde->mtu));
# 1220|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def472]
criu-4.2/criu/net.c:1219:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 1217|   
# 1218|   	addattr_l(&req->h, sizeof(*req), IFLA_IFNAME, nde->name, strlen(nde->name));
# 1219|-> 	addattr_l(&req->h, sizeof(*req), IFLA_MTU, &nde->mtu, sizeof(nde->mtu));
# 1220|   
# 1221|   	if (nde->has_address) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def473]
criu-4.2/criu/net.c:1231:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 1229|   
# 1230|   		linkinfo = NLMSG_TAIL(&req->h);
# 1231|-> 		addattr_l(&req->h, sizeof(*req), IFLA_LINKINFO, NULL, 0);
# 1232|   
# 1233|   		ret = link_info(ns, link, req);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def474]
criu-4.2/criu/net.c:1311:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 1309|   			    struct newlink_extras *extras)
# 1310|   {
# 1311|-> 	pr_info("Restoring netdev %s idx %d\n", link->nde->name, link->nde->ifindex);
# 1312|   	return do_rtm_link_req(RTM_NEWLINK, link, nlsk, ns, link_info, extras);
# 1313|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def475]
criu-4.2/criu/net.c:1512:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/net.c:1745:12: enter_function: entry to ‘__restore_link’
criu-4.2/criu/net.c:1757:24: call_function: calling ‘restore_one_link’ from ‘__restore_link’
# 1510|   	struct rtattr *venet_data;
# 1511|   
# 1512|-> 	BUG_ON(ns_fd < 0);
# 1513|   
# 1514|   	venet_data = NLMSG_TAIL(&req->h);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def476]
criu-4.2/criu/net.c:1960:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2017:19: enter_function: entry to ‘dump_rule’
criu-4.2/criu/net.c:2022:15: call_function: calling ‘img_from_set’ from ‘dump_rule’
criu-4.2/criu/net.c:2022:15: return_function: returning to ‘dump_rule’ from ‘img_from_set’
criu-4.2/criu/net.c:2023:16: acquire_memory: allocated here
criu-4.2/criu/net.c:2023:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2028:13: branch_false: ...to here
criu-4.2/criu/net.c:2028:13: call_function: calling ‘img_raw_fd’ from ‘dump_rule’
criu-4.2/criu/net.c:2028:13: return_function: returning to ‘dump_rule’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2028:13: call_function: calling ‘run_ip_tool’ from ‘dump_rule’
# 1958|   	int ret;
# 1959|   
# 1960|-> 	pr_debug("\tRunning ip %s %s %s %s\n", arg1, arg2, arg3 ?: "", arg4 ?: "");
# 1961|   
# 1962|   	ip_tool_cmd = getenv("CR_IP_TOOL");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def477]
criu-4.2/criu/net.c:1960:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
criu-4.2/criu/net.c:2392:12: enter_function: entry to ‘restore_ip_dump’
criu-4.2/criu/net.c:2400:13: call_function: inlined call to ‘empty_image’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: branch_false: ...to here
criu-4.2/criu/net.c:2404:18: call_function: calling ‘img_raw_fd’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: return_function: returning to ‘restore_ip_dump’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2405:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2409:20: branch_false: ...to here
criu-4.2/criu/net.c:2409:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2410:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2410:12: branch_false: ...to here
criu-4.2/criu/net.c:2425:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2430:12: branch_false: ...to here
criu-4.2/criu/net.c:2430:12: branch_true: following ‘true’ branch (when ‘type == 26’)...
criu-4.2/criu/net.c:2435:17: branch_true: ...to here
criu-4.2/criu/net.c:2435:17: call_function: calling ‘run_ip_tool’ from ‘restore_ip_dump’
# 1958|   	int ret;
# 1959|   
# 1960|-> 	pr_debug("\tRunning ip %s %s %s %s\n", arg1, arg2, arg3 ?: "", arg4 ?: "");
# 1961|   
# 1962|   	ip_tool_cmd = getenv("CR_IP_TOOL");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def478]
criu-4.2/criu/net.c:1966:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2017:19: enter_function: entry to ‘dump_rule’
criu-4.2/criu/net.c:2022:15: call_function: calling ‘img_from_set’ from ‘dump_rule’
criu-4.2/criu/net.c:2022:15: return_function: returning to ‘dump_rule’ from ‘img_from_set’
criu-4.2/criu/net.c:2023:16: acquire_memory: allocated here
criu-4.2/criu/net.c:2023:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2028:13: branch_false: ...to here
criu-4.2/criu/net.c:2028:13: call_function: calling ‘img_raw_fd’ from ‘dump_rule’
criu-4.2/criu/net.c:2028:13: return_function: returning to ‘dump_rule’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2028:13: call_function: calling ‘run_ip_tool’ from ‘dump_rule’
# 1964|   		ip_tool_cmd = "ip";
# 1965|   
# 1966|-> 	ret = cr_system(fdin, fdout, -1, ip_tool_cmd, (char *[]){ "ip", arg1, arg2, arg3, arg4, NULL }, flags);
# 1967|   	if (ret) {
# 1968|   		if (!(flags & CRS_CAN_FAIL))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def479]
criu-4.2/criu/net.c:1966:15: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
criu-4.2/criu/net.c:2392:12: enter_function: entry to ‘restore_ip_dump’
criu-4.2/criu/net.c:2400:13: call_function: inlined call to ‘empty_image’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: branch_false: ...to here
criu-4.2/criu/net.c:2404:18: call_function: calling ‘img_raw_fd’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: return_function: returning to ‘restore_ip_dump’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2405:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2409:20: branch_false: ...to here
criu-4.2/criu/net.c:2409:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2410:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2410:12: branch_false: ...to here
criu-4.2/criu/net.c:2425:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2430:12: branch_false: ...to here
criu-4.2/criu/net.c:2430:12: branch_true: following ‘true’ branch (when ‘type == 26’)...
criu-4.2/criu/net.c:2435:17: branch_true: ...to here
criu-4.2/criu/net.c:2435:17: call_function: calling ‘run_ip_tool’ from ‘restore_ip_dump’
# 1964|   		ip_tool_cmd = "ip";
# 1965|   
# 1966|-> 	ret = cr_system(fdin, fdout, -1, ip_tool_cmd, (char *[]){ "ip", arg1, arg2, arg3, arg4, NULL }, flags);
# 1967|   	if (ret) {
# 1968|   		if (!(flags & CRS_CAN_FAIL))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def480]
criu-4.2/criu/net.c:1968:22: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
criu-4.2/criu/net.c:2392:12: enter_function: entry to ‘restore_ip_dump’
criu-4.2/criu/net.c:2400:13: call_function: inlined call to ‘empty_image’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: branch_false: ...to here
criu-4.2/criu/net.c:2404:18: call_function: calling ‘img_raw_fd’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: return_function: returning to ‘restore_ip_dump’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2405:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2409:20: branch_false: ...to here
criu-4.2/criu/net.c:2409:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2410:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2410:12: branch_false: ...to here
criu-4.2/criu/net.c:2425:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2430:12: branch_false: ...to here
criu-4.2/criu/net.c:2430:12: branch_true: following ‘true’ branch (when ‘type == 26’)...
criu-4.2/criu/net.c:2435:17: branch_true: ...to here
criu-4.2/criu/net.c:2435:17: call_function: calling ‘run_ip_tool’ from ‘restore_ip_dump’
# 1966|   	ret = cr_system(fdin, fdout, -1, ip_tool_cmd, (char *[]){ "ip", arg1, arg2, arg3, arg4, NULL }, flags);
# 1967|   	if (ret) {
# 1968|-> 		if (!(flags & CRS_CAN_FAIL))
# 1969|   			pr_err("IP tool failed on %s %s %s %s\n", arg1, arg2, arg3 ?: "", arg4 ?: "");
# 1970|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def481]
criu-4.2/criu/net.c:2029:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2017:19: enter_function: entry to ‘dump_rule’
criu-4.2/criu/net.c:2022:15: call_function: calling ‘img_from_set’ from ‘dump_rule’
criu-4.2/criu/net.c:2022:15: return_function: returning to ‘dump_rule’ from ‘img_from_set’
criu-4.2/criu/net.c:2023:16: acquire_memory: allocated here
criu-4.2/criu/net.c:2023:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2028:13: branch_false: ...to here
criu-4.2/criu/net.c:2028:13: call_function: calling ‘img_raw_fd’ from ‘dump_rule’
criu-4.2/criu/net.c:2028:13: return_function: returning to ‘dump_rule’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2028:13: call_function: calling ‘run_ip_tool’ from ‘dump_rule’
criu-4.2/criu/net.c:2028:13: return_function: returning to ‘dump_rule’ from ‘run_ip_tool’
criu-4.2/criu/net.c:2028:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2029:17: branch_true: ...to here
criu-4.2/criu/net.c:2029:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:2029:17: danger: ‘___p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/6)
# 2027|   
# 2028|   	if (run_ip_tool("rule", "save", NULL, NULL, -1, img_raw_fd(img), CRS_CAN_FAIL)) {
# 2029|-> 		pr_warn("Check if \"ip rule save\" is supported!\n");
# 2030|   		unlinkat(get_service_fd(IMG_FD_OFF), path, 0);
# 2031|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def482]
criu-4.2/criu/net.c:2030:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2017:19: enter_function: entry to ‘dump_rule’
criu-4.2/criu/net.c:2022:15: call_function: calling ‘img_from_set’ from ‘dump_rule’
criu-4.2/criu/net.c:2022:15: return_function: returning to ‘dump_rule’ from ‘img_from_set’
criu-4.2/criu/net.c:2023:16: acquire_memory: allocated here
criu-4.2/criu/net.c:2023:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2028:13: branch_false: ...to here
criu-4.2/criu/net.c:2028:13: call_function: calling ‘img_raw_fd’ from ‘dump_rule’
criu-4.2/criu/net.c:2028:13: return_function: returning to ‘dump_rule’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2028:13: call_function: calling ‘run_ip_tool’ from ‘dump_rule’
criu-4.2/criu/net.c:2028:13: return_function: returning to ‘dump_rule’ from ‘run_ip_tool’
criu-4.2/criu/net.c:2028:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2029:17: branch_true: ...to here
criu-4.2/criu/net.c:2030:17: throw: if ‘get_service_fd’ throws an exception...
criu-4.2/criu/net.c:2030:17: danger: ‘___p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/6)
# 2028|   	if (run_ip_tool("rule", "save", NULL, NULL, -1, img_raw_fd(img), CRS_CAN_FAIL)) {
# 2029|   		pr_warn("Check if \"ip rule save\" is supported!\n");
# 2030|-> 		unlinkat(get_service_fd(IMG_FD_OFF), path, 0);
# 2031|   	}
# 2032|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def483]
criu-4.2/criu/net.c:2109:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
criu-4.2/criu/net.c:2078:19: enter_function: entry to ‘dump_nftables’
criu-4.2/criu/net.c:2087:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2090:15: branch_false: ...to here
criu-4.2/criu/net.c:2090:15: call_function: calling ‘img_from_set’ from ‘dump_nftables’
criu-4.2/criu/net.c:2090:15: return_function: returning to ‘dump_nftables’ from ‘img_from_set’
criu-4.2/criu/net.c:2091:18: call_function: calling ‘img_raw_fd’ from ‘dump_nftables’
criu-4.2/criu/net.c:2091:18: return_function: returning to ‘dump_nftables’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2092:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2096:18: branch_false: ...to here
criu-4.2/criu/net.c:2097:12: branch_false: following ‘false’ branch (when ‘img_fd >= 0’)...
criu-4.2/criu/net.c:2102:14: branch_false: ...to here
criu-4.2/criu/net.c:2102:14: acquire_memory: allocated here
criu-4.2/criu/net.c:2103:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
criu-4.2/criu/net.c:2109:9: branch_false: ...to here
criu-4.2/criu/net.c:2109:9: throw: if ‘nft_ctx_set_output’ throws an exception...
criu-4.2/criu/net.c:2109:9: danger: ‘fp’ leaks here; was allocated at [(18)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/17)
# 2107|   	}
# 2108|   
# 2109|-> 	nft_ctx_set_output(nft, fp);
# 2110|   #define DUMP_NFTABLES_CMD "list ruleset"
# 2111|   #if defined(CONFIG_HAS_NFTABLES_LIB_API_0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def484]
criu-4.2/criu/net.c:2416:27: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
criu-4.2/criu/net.c:2392:12: enter_function: entry to ‘restore_ip_dump’
criu-4.2/criu/net.c:2400:13: call_function: inlined call to ‘empty_image’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: branch_false: ...to here
criu-4.2/criu/net.c:2404:18: call_function: calling ‘img_raw_fd’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: return_function: returning to ‘restore_ip_dump’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2405:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2409:20: branch_false: ...to here
criu-4.2/criu/net.c:2409:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2410:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2410:12: branch_false: ...to here
criu-4.2/criu/net.c:2415:16: branch_true: following ‘true’ branch (when ‘n > 0’)...
criu-4.2/criu/net.c:2416:27: branch_true: ...to here
criu-4.2/criu/net.c:2418:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:2416:27: danger: ‘tmpfile()’ leaks here; was allocated at [(12)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/11)
# 2414|   
# 2415|   	while ((n = read(sockfd, buf, 1024)) > 0) {
# 2416|-> 		written = fwrite(buf, sizeof(char), n, tmp_file);
# 2417|   		if (written < n) {
# 2418|   			pr_perror("Failed to write to tmpfile "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def485]
criu-4.2/criu/net.c:2425:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
criu-4.2/criu/net.c:2392:12: enter_function: entry to ‘restore_ip_dump’
criu-4.2/criu/net.c:2400:13: call_function: inlined call to ‘empty_image’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: branch_false: ...to here
criu-4.2/criu/net.c:2404:18: call_function: calling ‘img_raw_fd’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: return_function: returning to ‘restore_ip_dump’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2405:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2409:20: branch_false: ...to here
criu-4.2/criu/net.c:2409:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2410:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2410:12: branch_false: ...to here
criu-4.2/criu/net.c:2425:13: throw: if ‘fseek’ throws an exception...
criu-4.2/criu/net.c:2425:13: danger: ‘tmpfile()’ leaks here; was allocated at [(12)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/11)
# 2423|   	}
# 2424|   
# 2425|-> 	if (fseek(tmp_file, 0, SEEK_SET)) {
# 2426|   		pr_perror("Failed to set file position to beginning of tmpfile");
# 2427|   		goto out_tmp_file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def486]
criu-4.2/criu/net.c:2426:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
criu-4.2/criu/net.c:2392:12: enter_function: entry to ‘restore_ip_dump’
criu-4.2/criu/net.c:2400:13: call_function: inlined call to ‘empty_image’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: branch_false: ...to here
criu-4.2/criu/net.c:2404:18: call_function: calling ‘img_raw_fd’ from ‘restore_ip_dump’
criu-4.2/criu/net.c:2404:18: return_function: returning to ‘restore_ip_dump’ from ‘img_raw_fd’
criu-4.2/criu/net.c:2405:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2409:20: branch_false: ...to here
criu-4.2/criu/net.c:2409:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2410:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2410:12: branch_false: ...to here
criu-4.2/criu/net.c:2425:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2426:17: branch_true: ...to here
criu-4.2/criu/net.c:2426:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:2426:17: danger: ‘tmpfile()’ leaks here; was allocated at [(12)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/11)
# 2424|   
# 2425|   	if (fseek(tmp_file, 0, SEEK_SET)) {
# 2426|-> 		pr_perror("Failed to set file position to beginning of tmpfile");
# 2427|   		goto out_tmp_file;
# 2428|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def487]
criu-4.2/criu/net.c:2483:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/run/xtables.lock", 0)’
criu-4.2/criu/net.c:2481:14: acquire_resource: opened here
criu-4.2/criu/net.c:2482:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2483:17: branch_true: ...to here
criu-4.2/criu/net.c:2483:17: danger: ‘open("/run/xtables.lock", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
# 2481|   	fd = open("/run/xtables.lock", O_RDONLY);
# 2482|   	if (fd >= 0) {
# 2483|-> 		close(fd);
# 2484|   		return 0;
# 2485|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def488]
criu-4.2/criu/net.c:2752:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/net.c:2752:9: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2752:9: branch_true: ...to here
criu-4.2/criu/net.c:2752:9: danger: dereference of NULL ‘0’
# 2750|   	char sys_mount[] = "crtools-sys.XXXXXX";
# 2751|   
# 2752|-> 	BUG_ON(ns_sysfs_fd != -1);
# 2753|   
# 2754|   	if (kdat.has_fsopen) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def489]
criu-4.2/criu/net.c:2814:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/net.c:2804:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2807:13: branch_false: ...to here
criu-4.2/criu/net.c:2807:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2810:20: branch_false: ...to here
criu-4.2/criu/net.c:2810:20: acquire_memory: allocated here
criu-4.2/criu/net.c:2810:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2814:9: branch_false: ...to here
criu-4.2/criu/net.c:2814:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:2814:9: danger: ‘___p’ leaks here; was allocated at [(5)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/4)
# 2812|   		return -1;
# 2813|   
# 2814|-> 	pr_debug("Found the %d id for %d in %d\n", nsid, ns->id, arg->ns->id);
# 2815|   	netns_id->target_ns_id = ns->id;
# 2816|   	netns_id->netnsid_value = nsid;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def490]
criu-4.2/criu/net.c:2939:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2935:21: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:2939:22: danger: ‘sk’ leaks here
# 2937|   		struct netns_id *id;
# 2938|   
# 2939|-> 		id = xmalloc(sizeof(*id));
# 2940|   		if (!id)
# 2941|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def491]
criu-4.2/criu/net.c:2946:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2935:21: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2942:36: branch_false: ...to here
criu-4.2/criu/net.c:2946:25: throw: if ‘lookup_ns_by_id’ throws an exception...
criu-4.2/criu/net.c:2946:25: danger: ‘sk’ leaks here
# 2944|   		list_add(&id->node, &ns->net.ids);
# 2945|   
# 2946|-> 		tg_ns = lookup_ns_by_id(id->target_ns_id, &net_ns_desc);
# 2947|   		if (tg_ns == NULL) {
# 2948|   			pr_err("Unknown namespace: %d\n", id->target_ns_id);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def492]
criu-4.2/criu/net.c:2948:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2935:21: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2942:36: branch_false: ...to here
criu-4.2/criu/net.c:2947:20: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2948:25: branch_true: ...to here
criu-4.2/criu/net.c:2948:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:2948:25: danger: ‘sk’ leaks here
# 2946|   		tg_ns = lookup_ns_by_id(id->target_ns_id, &net_ns_desc);
# 2947|   		if (tg_ns == NULL) {
# 2948|-> 			pr_err("Unknown namespace: %d\n", id->target_ns_id);
# 2949|   			goto out;
# 2950|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def493]
criu-4.2/criu/net.c:2958:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2958:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/net.c:2958:9: danger: ‘sk’ leaks here
# 2956|   	exit_code = 0;
# 2957|   out:
# 2958|-> 	close(sk);
# 2959|   
# 2960|   	return exit_code;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def494]
criu-4.2/criu/net.c:3155:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/net.c:3145:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3150:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3155:17: branch_false: ...to here
criu-4.2/criu/net.c:3155:17: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3155:17: branch_true: ...to here
criu-4.2/criu/net.c:3155:17: danger: dereference of NULL ‘0’
# 3153|   		}
# 3154|   
# 3155|-> 		BUG_ON(nsid->type == NS_CRIU);
# 3156|   
# 3157|   		if (do_restore_task_net_ns(nsid, current))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def495]
criu-4.2/criu/net.c:3209:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/net.c:3202:22: branch_true: following ‘true’ branch (when ‘ipv6 != 0’)...
criu-4.2/criu/net.c:3204:13: branch_true: ...to here
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:13: throw: if ‘write’ throws an exception...
criu-4.2/criu/net.c:3209:13: danger: ‘pfd[0]’ leaks here
# 3207|   	}
# 3208|   
# 3209|-> 	if (write(pfd[1], buf, size) < size) {
# 3210|   		pr_perror("Unable to write iptables configugration");
# 3211|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def496]
criu-4.2/criu/net.c:3209:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/net.c:3202:22: branch_true: following ‘true’ branch (when ‘ipv6 != 0’)...
criu-4.2/criu/net.c:3204:13: branch_true: ...to here
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:13: throw: if ‘write’ throws an exception...
criu-4.2/criu/net.c:3209:13: danger: ‘pfd[1]’ leaks here
# 3207|   	}
# 3208|   
# 3209|-> 	if (write(pfd[1], buf, size) < size) {
# 3210|   		pr_perror("Unable to write iptables configugration");
# 3211|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def497]
criu-4.2/criu/net.c:3210:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3210:17: branch_true: ...to here
criu-4.2/criu/net.c:3210:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:3210:17: danger: ‘pfd[0]’ leaks here
# 3208|   
# 3209|   	if (write(pfd[1], buf, size) < size) {
# 3210|-> 		pr_perror("Unable to write iptables configugration");
# 3211|   		goto err;
# 3212|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def498]
criu-4.2/criu/net.c:3210:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3210:17: branch_true: ...to here
criu-4.2/criu/net.c:3210:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:3210:17: danger: ‘pfd[1]’ leaks here
# 3208|   
# 3209|   	if (write(pfd[1], buf, size) < size) {
# 3210|-> 		pr_perror("Unable to write iptables configugration");
# 3211|   		goto err;
# 3212|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def499]
criu-4.2/criu/net.c:3213:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/net.c:3202:22: branch_true: following ‘true’ branch (when ‘ipv6 != 0’)...
criu-4.2/criu/net.c:3204:13: branch_true: ...to here
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3213:9: branch_false: ...to here
criu-4.2/criu/net.c:3213:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/net.c:3213:9: danger: ‘pfd[0]’ leaks here
# 3211|   		goto err;
# 3212|   	}
# 3213|-> 	close_safe(&pfd[1]);
# 3214|   
# 3215|   	ret = cr_system(pfd[0], -1, -1, cmd[0], cmd, 0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def500]
criu-4.2/criu/net.c:3213:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/net.c:3202:22: branch_true: following ‘true’ branch (when ‘ipv6 != 0’)...
criu-4.2/criu/net.c:3204:13: branch_true: ...to here
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3213:9: branch_false: ...to here
criu-4.2/criu/net.c:3213:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/net.c:3213:9: danger: ‘pfd[1]’ leaks here
# 3211|   		goto err;
# 3212|   	}
# 3213|-> 	close_safe(&pfd[1]);
# 3214|   
# 3215|   	ret = cr_system(pfd[0], -1, -1, cmd[0], cmd, 0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def501]
criu-4.2/criu/net.c:3217:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3210:17: branch_true: ...to here
criu-4.2/criu/net.c:3217:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/net.c:3217:9: danger: ‘pfd[0]’ leaks here
# 3215|   	ret = cr_system(pfd[0], -1, -1, cmd[0], cmd, 0);
# 3216|   err:
# 3217|-> 	close_safe(&pfd[1]);
# 3218|   	close_safe(&pfd[0]);
# 3219|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def502]
criu-4.2/criu/net.c:3217:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/net.c:3204:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3209:13: branch_false: ...to here
criu-4.2/criu/net.c:3209:12: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3210:17: branch_true: ...to here
criu-4.2/criu/net.c:3217:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/net.c:3217:9: danger: ‘pfd[1]’ leaks here
# 3215|   	ret = cr_system(pfd[0], -1, -1, cmd[0], cmd, 0);
# 3216|   err:
# 3217|-> 	close_safe(&pfd[1]);
# 3218|   	close_safe(&pfd[0]);
# 3219|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def503]
criu-4.2/criu/net.c:3248:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
criu-4.2/criu/net.c:3229:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
criu-4.2/criu/net.c:3234:14: branch_false: ...to here
criu-4.2/criu/net.c:3234:14: acquire_memory: allocated here
criu-4.2/criu/net.c:3235:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
criu-4.2/criu/net.c:3246:9: branch_false: ...to here
criu-4.2/criu/net.c:3248:9: throw: if ‘nft_ctx_set_output’ throws an exception...
criu-4.2/criu/net.c:3248:9: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/2)
# 3246|   	setvbuf(fp, NULL, _IONBF, 0);
# 3247|   
# 3248|-> 	nft_ctx_set_output(nft, fp);
# 3249|   	nft_ctx_set_error(nft, fp);
# 3250|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def504]
criu-4.2/criu/net.c:3405:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/net.c:3399:14: acquire_resource: opened here
criu-4.2/criu/net.c:3400:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3405:15: branch_false: ...to here
criu-4.2/criu/net.c:3405:15: throw: if ‘cr_system’ throws an exception...
criu-4.2/criu/net.c:3405:15: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
# 3403|   	}
# 3404|   
# 3405|-> 	ret = cr_system(fd, fd, fd, "sh", argv, CRS_CAN_FAIL);
# 3406|   	close_safe(&fd);
# 3407|   	return !ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def505]
criu-4.2/criu/net.c:3598:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor
criu-4.2/criu/net.c:3544:12: branch_true: following ‘true’ branch (when ‘for_dump != 0’)...
criu-4.2/criu/net.c:3545:38: branch_true: ...to here
criu-4.2/criu/net.c:3545:38: acquire_resource: socket created here
criu-4.2/criu/net.c:3546:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3582:13: branch_false: ...to here
criu-4.2/criu/net.c:3582:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3598:31: branch_false: ...to here
criu-4.2/criu/net.c:3598:15: danger: leaks here
# 3596|   #endif
# 3597|   
# 3598|-> 	ret = ns->net.seqsk = socket(PF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
# 3599|   	if (ret < 0) {
# 3600|   		pr_perror("Can't create seqsk for parasite");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def506]
criu-4.2/criu/net.c:3788:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
criu-4.2/criu/net.c:3753:12: enter_function: entry to ‘move_to_bridge’
criu-4.2/criu/net.c:3760:15: call_function: calling ‘external_val’ from ‘move_to_bridge’
criu-4.2/criu/net.c:3760:15: return_function: returning to ‘move_to_bridge’ from ‘external_val’
criu-4.2/criu/net.c:3761:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3764:14: branch_false: ...to here
criu-4.2/criu/net.c:3765:12: branch_false: following ‘false’ branch (when ‘br’ is non-NULL)...
criu-4.2/criu/net.c:3768:9: branch_false: ...to here
criu-4.2/criu/net.c:3774:20: branch_true: following ‘true’ branch (when ‘s == -1’)...
criu-4.2/criu/net.c:3775:29: branch_true: ...to here
criu-4.2/criu/net.c:3775:29: acquire_resource: socket created here
criu-4.2/criu/net.c:3776:28: branch_false: following ‘false’ branch (when ‘s >= 0’)...
criu-4.2/criu/net.c:3786:35: branch_false: ...to here
criu-4.2/criu/net.c:3787:20: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:3788:25: branch_true: ...to here
criu-4.2/criu/net.c:3788:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/net.c:3788:25: danger: ‘s’ leaks here
# 3786|   		ifr.ifr_ifindex = if_nametoindex(out);
# 3787|   		if (ifr.ifr_ifindex == 0) {
# 3788|-> 			pr_perror("Can't get index of %s", out);
# 3789|   			ret = -1;
# 3790|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def507]
criu-4.2/criu/net.c:3792:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
criu-4.2/criu/net.c:3753:12: enter_function: entry to ‘move_to_bridge’
criu-4.2/criu/net.c:3760:15: call_function: calling ‘external_val’ from ‘move_to_bridge’
criu-4.2/criu/net.c:3760:15: return_function: returning to ‘move_to_bridge’ from ‘external_val’
criu-4.2/criu/net.c:3761:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3764:14: branch_false: ...to here
criu-4.2/criu/net.c:3765:12: branch_false: following ‘false’ branch (when ‘br’ is non-NULL)...
criu-4.2/criu/net.c:3768:9: branch_false: ...to here
criu-4.2/criu/net.c:3774:20: branch_true: following ‘true’ branch (when ‘s == -1’)...
criu-4.2/criu/net.c:3775:29: branch_true: ...to here
criu-4.2/criu/net.c:3775:29: acquire_resource: socket created here
criu-4.2/criu/net.c:3776:28: branch_false: following ‘false’ branch (when ‘s >= 0’)...
criu-4.2/criu/net.c:3786:35: branch_false: ...to here
criu-4.2/criu/net.c:3787:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:3792:17: branch_false: ...to here
criu-4.2/criu/net.c:3792:17: throw: if ‘__strlcpy’ throws an exception...
criu-4.2/criu/net.c:3792:17: danger: ‘s’ leaks here
# 3790|   			goto out;
# 3791|   		}
# 3792|-> 		__strlcpy(ifr.ifr_name, br, IFNAMSIZ);
# 3793|   		ret = ioctl(s, SIOCBRADDIF, &ifr);
# 3794|   		if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def508]
criu-4.2/criu/net.c:3891:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2922:12: enter_function: entry to ‘restore_netns_ids’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2935:21: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2942:36: branch_false: ...to here
criu-4.2/criu/net.c:2947:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2952:56: branch_false: ...to here
criu-4.2/criu/net.c:2952:21: call_function: calling ‘net_set_nsid’ from ‘restore_netns_ids’
# 3889|   	req.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
# 3890|   	req.nlh.nlmsg_seq = CR_NLMSG_SEQ;
# 3891|-> 	if (addattr_l(&req.nlh, sizeof(req), NETNSA_FD, &fd, sizeof(fd)))
# 3892|   		return -1;
# 3893|   	if (addattr_l(&req.nlh, sizeof(req), NETNSA_NSID, &nsid, sizeof(nsid)))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def509]
criu-4.2/criu/net.c:3893:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2922:12: enter_function: entry to ‘restore_netns_ids’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2935:21: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2942:36: branch_false: ...to here
criu-4.2/criu/net.c:2947:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2952:56: branch_false: ...to here
criu-4.2/criu/net.c:2952:21: call_function: calling ‘net_set_nsid’ from ‘restore_netns_ids’
# 3891|   	if (addattr_l(&req.nlh, sizeof(req), NETNSA_FD, &fd, sizeof(fd)))
# 3892|   		return -1;
# 3893|-> 	if (addattr_l(&req.nlh, sizeof(req), NETNSA_NSID, &nsid, sizeof(nsid)))
# 3894|   		return -1;
# 3895|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def510]
criu-4.2/criu/net.c:3896:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:2922:12: enter_function: entry to ‘restore_netns_ids’
criu-4.2/criu/net.c:2926:12: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2929:14: branch_false: ...to here
criu-4.2/criu/net.c:2929:14: acquire_resource: socket created here
criu-4.2/criu/net.c:2930:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:2930:12: branch_false: ...to here
criu-4.2/criu/net.c:2935:21: branch_true: following ‘true’ branch...
criu-4.2/criu/net.c:2939:22: branch_true: ...to here
criu-4.2/criu/net.c:2939:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/net.c:2942:36: branch_false: ...to here
criu-4.2/criu/net.c:2947:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:2952:56: branch_false: ...to here
criu-4.2/criu/net.c:2952:21: call_function: calling ‘net_set_nsid’ from ‘restore_netns_ids’
# 3894|   		return -1;
# 3895|   
# 3896|-> 	if (do_rtnl_req(rtsk, &req, req.nlh.nlmsg_len, NULL, NULL, NULL, NULL) < 0)
# 3897|   		return -1;
# 3898|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def511]
criu-4.2/criu/net.c:3936:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 3934|   	struct ifinfomsg ifm;
# 3935|   
# 3936|-> 	addattr_l(&req->h, sizeof(*req), IFLA_INFO_KIND, "veth", 4);
# 3937|   
# 3938|   	veth_data = NLMSG_TAIL(&req->h);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def512]
criu-4.2/criu/net.c:3939:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 3937|   
# 3938|   	veth_data = NLMSG_TAIL(&req->h);
# 3939|-> 	addattr_l(&req->h, sizeof(*req), IFLA_INFO_DATA, NULL, 0);
# 3940|   	peer_data = NLMSG_TAIL(&req->h);
# 3941|   	memset(&ifm, 0, sizeof(ifm));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def513]
criu-4.2/criu/net.c:3944:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 3942|   
# 3943|   	ifm.ifi_index = nde->peer_ifindex;
# 3944|-> 	addattr_l(&req->h, sizeof(*req), VETH_INFO_PEER, &ifm, sizeof(ifm));
# 3945|   
# 3946|   	addattr_l(&req->h, sizeof(*req), IFLA_NET_NS_FD, &nde->peer_nsid, sizeof(int));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def514]
criu-4.2/criu/net.c:3946:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/net.c:3996:5: enter_function: entry to ‘kerndat_link_nsid’
criu-4.2/criu/net.c:4002:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
criu-4.2/criu/net.c:4007:12: branch_false: ...to here
criu-4.2/criu/net.c:4007:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/net.c:4009:32: branch_true: ...to here
criu-4.2/criu/net.c:4016:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4021:24: branch_false: ...to here
criu-4.2/criu/net.c:4021:24: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4025:21: branch_false: ...to here
criu-4.2/criu/net.c:4025:20: branch_false: following ‘false’ branch...
criu-4.2/criu/net.c:4030:22: branch_false: ...to here
criu-4.2/criu/net.c:4030:22: acquire_resource: socket created here
criu-4.2/criu/net.c:4031:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/net.c:4036:17: branch_false: ...to here
criu-4.2/criu/net.c:4045:23: call_function: calling ‘restore_one_link’ from ‘kerndat_link_nsid’
# 3944|   	addattr_l(&req->h, sizeof(*req), VETH_INFO_PEER, &ifm, sizeof(ifm));
# 3945|   
# 3946|-> 	addattr_l(&req->h, sizeof(*req), IFLA_NET_NS_FD, &nde->peer_nsid, sizeof(int));
# 3947|   	peer_data->rta_len = (void *)NLMSG_TAIL(&req->h) - (void *)peer_data;
# 3948|   	veth_data->rta_len = (void *)NLMSG_TAIL(&req->h) - (void *)veth_data;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def515]
criu-4.2/criu/netfilter.c:51:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/netfilter.c:46:14: acquire_resource: opened here
criu-4.2/criu/netfilter.c:47:12: branch_false: following ‘false’ branch...
criu-4.2/criu/netfilter.c:51:59: branch_false: ...to here
criu-4.2/criu/netfilter.c:51:9: throw: if ‘cr_system’ throws an exception...
criu-4.2/criu/netfilter.c:51:9: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   49|   		pr_perror("failed to open /dev/null, using log fd for net module preload");
#   50|   	}
#   51|-> 	cr_system(fd, fd, fd, iptable_cmd_ipv4, (char *[]){ iptable_cmd_ipv4, "-L", "-n", NULL }, CRS_CAN_FAIL);
#   52|   	cr_system(fd, fd, fd, iptable_cmd_ipv6, (char *[]){ iptable_cmd_ipv6, "-L", "-n", NULL }, CRS_CAN_FAIL);
#   53|   	close_safe(&fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def516]
criu-4.2/criu/page-pipe.c:36:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:98:30: enter_function: entry to ‘ppb_alloc’
criu-4.2/criu/page-pipe.c:100:38: call_function: calling ‘pp_prev_ppb’ from ‘ppb_alloc’
criu-4.2/criu/page-pipe.c:100:38: return_function: returning to ‘ppb_alloc’ from ‘pp_prev_ppb’
criu-4.2/criu/page-pipe.c:104:15: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:109:21: branch_true: ...to here
criu-4.2/criu/page-pipe.c:109:21: call_function: calling ‘ppb_resize_pipe’ from ‘ppb_alloc’
#   34|   	int ret;
#   35|   
#   36|-> 	ret = fcntl(ppb->p[0], F_SETPIPE_SZ, new_size * PAGE_SIZE);
#   37|   	if (ret < 0)
#   38|   		return -1;

Error: CPPCHECK_WARNING (CWE-476): [#def517]
criu-4.2/criu/page-pipe.c:41: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   39|   
#   40|   	ret /= PAGE_SIZE;
#   41|-> 	BUG_ON(ret < ppb->pipe_size);
#   42|   
#   43|   	pr_debug("Grow pipe %x -> %x\n", ppb->pipe_size, ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def518]
criu-4.2/criu/page-pipe.c:41:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:98:30: enter_function: entry to ‘ppb_alloc’
criu-4.2/criu/page-pipe.c:100:38: call_function: calling ‘pp_prev_ppb’ from ‘ppb_alloc’
criu-4.2/criu/page-pipe.c:100:38: return_function: returning to ‘ppb_alloc’ from ‘pp_prev_ppb’
criu-4.2/criu/page-pipe.c:104:15: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:109:21: branch_true: ...to here
criu-4.2/criu/page-pipe.c:109:21: call_function: calling ‘ppb_resize_pipe’ from ‘ppb_alloc’
#   39|   
#   40|   	ret /= PAGE_SIZE;
#   41|-> 	BUG_ON(ret < ppb->pipe_size);
#   42|   
#   43|   	pr_debug("Grow pipe %x -> %x\n", ppb->pipe_size, ret);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def519]
criu-4.2/criu/page-pipe.c:41:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/page-pipe.c:37:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:40:13: branch_false: ...to here
criu-4.2/criu/page-pipe.c:41:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:41:9: branch_true: ...to here
criu-4.2/criu/page-pipe.c:41:9: danger: dereference of NULL ‘0’
#   39|   
#   40|   	ret /= PAGE_SIZE;
#   41|-> 	BUG_ON(ret < ppb->pipe_size);
#   42|   
#   43|   	pr_debug("Grow pipe %x -> %x\n", ppb->pipe_size, ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def520]
criu-4.2/criu/page-pipe.c:43:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:98:30: enter_function: entry to ‘ppb_alloc’
criu-4.2/criu/page-pipe.c:100:38: call_function: calling ‘pp_prev_ppb’ from ‘ppb_alloc’
criu-4.2/criu/page-pipe.c:100:38: return_function: returning to ‘ppb_alloc’ from ‘pp_prev_ppb’
criu-4.2/criu/page-pipe.c:104:15: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:109:21: branch_true: ...to here
criu-4.2/criu/page-pipe.c:109:21: call_function: calling ‘ppb_resize_pipe’ from ‘ppb_alloc’
#   41|   	BUG_ON(ret < ppb->pipe_size);
#   42|   
#   43|-> 	pr_debug("Grow pipe %x -> %x\n", ppb->pipe_size, ret);
#   44|   	ppb->pipe_size = ret;
#   45|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def521]
criu-4.2/criu/page-pipe.c:104:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:187:19: enter_function: entry to ‘create_page_pipe’
criu-4.2/criu/page-pipe.c:193:14: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:193:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:197:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:202:12: branch_false: following ‘false’ branch (when ‘iovs’ is non-NULL)...
criu-4.2/criu/page-pipe.c:208:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:210:13: call_function: calling ‘page_pipe_grow’ from ‘create_page_pipe’
#  102|   	int ppb_size = 0;
#  103|   
#  104|-> 	ppb = xmalloc(sizeof(*ppb));
#  105|   	if (!ppb)
#  106|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def522]
criu-4.2/criu/page-pipe.c:107:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:187:19: enter_function: entry to ‘create_page_pipe’
criu-4.2/criu/page-pipe.c:193:14: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:193:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:197:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:202:12: branch_false: following ‘false’ branch (when ‘iovs’ is non-NULL)...
criu-4.2/criu/page-pipe.c:208:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:210:13: call_function: calling ‘page_pipe_grow’ from ‘create_page_pipe’
#  105|   	if (!ppb)
#  106|   		return NULL;
#  107|-> 	cnt_add(CNT_PAGE_PIPE_BUFS, 1);
#  108|   
#  109|   	if (prev && ppb_resize_pipe(prev) == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def523]
criu-4.2/criu/page-pipe.c:118:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:187:19: enter_function: entry to ‘create_page_pipe’
criu-4.2/criu/page-pipe.c:193:14: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:193:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:197:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:202:12: branch_false: following ‘false’ branch (when ‘iovs’ is non-NULL)...
criu-4.2/criu/page-pipe.c:208:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:210:13: call_function: calling ‘page_pipe_grow’ from ‘create_page_pipe’
#  116|   		if (pipe(ppb->p)) {
#  117|   			xfree(ppb);
#  118|-> 			pr_perror("Can't make pipe for page-pipe");
#  119|   			return NULL;
#  120|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def524]
criu-4.2/criu/page-pipe.c:121:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:116:26: branch_false: ...to here
criu-4.2/criu/page-pipe.c:116:20: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:121:17: branch_false: ...to here
criu-4.2/criu/page-pipe.c:121:17: throw: if ‘cnt_add’ throws an exception...
criu-4.2/criu/page-pipe.c:121:17: danger: leaks here
#  119|   			return NULL;
#  120|   		}
#  121|-> 		cnt_add(CNT_PAGE_PIPES, 1);
#  122|   
#  123|   		ppb->pipe_off = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def525]
criu-4.2/criu/page-pipe.c:121:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:104:15: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:116:26: branch_false: ...to here
criu-4.2/criu/page-pipe.c:116:20: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:121:17: branch_false: ...to here
criu-4.2/criu/page-pipe.c:121:17: throw: if ‘cnt_add’ throws an exception...
criu-4.2/criu/page-pipe.c:121:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  119|   			return NULL;
#  120|   		}
#  121|-> 		cnt_add(CNT_PAGE_PIPES, 1);
#  122|   
#  123|   		ppb->pipe_off = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def526]
criu-4.2/criu/page-pipe.c:124:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:116:26: branch_false: ...to here
criu-4.2/criu/page-pipe.c:116:20: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:121:17: branch_false: ...to here
criu-4.2/criu/page-pipe.c:124:28: throw: if ‘fcntl’ throws an exception...
criu-4.2/criu/page-pipe.c:124:28: danger: leaks here
#  122|   
#  123|   		ppb->pipe_off = 0;
#  124|-> 		ppb_size = fcntl(ppb->p[0], F_GETPIPE_SZ, 0);
#  125|   		if (ppb_size < 0) {
#  126|   			xfree(ppb);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def527]
criu-4.2/criu/page-pipe.c:124:28: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:104:15: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:116:26: branch_false: ...to here
criu-4.2/criu/page-pipe.c:116:20: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:121:17: branch_false: ...to here
criu-4.2/criu/page-pipe.c:124:28: throw: if ‘fcntl’ throws an exception...
criu-4.2/criu/page-pipe.c:124:28: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  122|   
#  123|   		ppb->pipe_off = 0;
#  124|-> 		ppb_size = fcntl(ppb->p[0], F_GETPIPE_SZ, 0);
#  125|   		if (ppb_size < 0) {
#  126|   			xfree(ppb);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def528]
criu-4.2/criu/page-pipe.c:126:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor
criu-4.2/criu/page-pipe.c:104:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:107:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:109:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:116:26: branch_false: ...to here
criu-4.2/criu/page-pipe.c:116:20: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:121:17: branch_false: ...to here
criu-4.2/criu/page-pipe.c:125:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:126:25: branch_true: ...to here
criu-4.2/criu/page-pipe.c:126:25: danger: leaks here
#  124|   		ppb_size = fcntl(ppb->p[0], F_GETPIPE_SZ, 0);
#  125|   		if (ppb_size < 0) {
#  126|-> 			xfree(ppb);
#  127|   			pr_perror("Can't get pipe size");
#  128|   			return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def529]
criu-4.2/criu/page-pipe.c:127:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:187:19: enter_function: entry to ‘create_page_pipe’
criu-4.2/criu/page-pipe.c:193:14: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:193:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:197:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:202:12: branch_false: following ‘false’ branch (when ‘iovs’ is non-NULL)...
criu-4.2/criu/page-pipe.c:208:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:210:13: call_function: calling ‘page_pipe_grow’ from ‘create_page_pipe’
#  125|   		if (ppb_size < 0) {
#  126|   			xfree(ppb);
#  127|-> 			pr_perror("Can't get pipe size");
#  128|   			return NULL;
#  129|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def530]
criu-4.2/criu/page-pipe.c:165:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:187:19: enter_function: entry to ‘create_page_pipe’
criu-4.2/criu/page-pipe.c:193:14: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:193:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:197:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:202:12: branch_false: following ‘false’ branch (when ‘iovs’ is non-NULL)...
criu-4.2/criu/page-pipe.c:208:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:210:13: call_function: calling ‘page_pipe_grow’ from ‘create_page_pipe’
#  163|   	struct iovec *free_iov;
#  164|   
#  165|-> 	pr_debug("Will grow page pipe (iov off is %u)\n", pp->free_iov);
#  166|   
#  167|   	if (!list_empty(&pp->free_bufs)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def531]
criu-4.2/criu/page-pipe.c:203:24: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-pipe.c:193:14: acquire_memory: allocated here
criu-4.2/criu/page-pipe.c:193:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-pipe.c:197:9: branch_false: ...to here
criu-4.2/criu/page-pipe.c:202:12: branch_true: following ‘true’ branch (when ‘iovs’ is NULL)...
criu-4.2/criu/page-pipe.c:203:24: branch_true: ...to here
criu-4.2/criu/page-pipe.c:203:24: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/page-pipe.c:203:24: branch_true: ...to here
criu-4.2/criu/page-pipe.c:203:24: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/page-pipe.c:203:24: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  201|   
#  202|   	if (!iovs) {
#  203|-> 		iovs = xmalloc(sizeof(*iovs) * nr_segs);
#  204|   		if (!iovs)
#  205|   			goto err_free_pp;

Error: CPPCHECK_WARNING (CWE-476): [#def532]
criu-4.2/criu/page-pipe.c:242: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  240|   	struct page_pipe_buf *ppb, *n;
#  241|   
#  242|-> 	BUG_ON(!(pp->flags & PP_CHUNK_MODE));
#  243|   
#  244|   	pr_debug("Clean up page pipe\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def533]
criu-4.2/criu/page-pipe.c:242:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/page-pipe.c:242:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:242:9: branch_true: ...to here
criu-4.2/criu/page-pipe.c:242:9: danger: dereference of NULL ‘0’
#  240|   	struct page_pipe_buf *ppb, *n;
#  241|   
#  242|-> 	BUG_ON(!(pp->flags & PP_CHUNK_MODE));
#  243|   
#  244|   	pr_debug("Clean up page pipe\n");

Error: CPPCHECK_WARNING (CWE-476): [#def534]
criu-4.2/criu/page-pipe.c:252: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  250|   
#  251|   	if (page_pipe_grow(pp, 0))
#  252|-> 		BUG(); /* It can't fail, because ppb is in free_bufs */
#  253|   }
#  254|   

Error: CPPCHECK_WARNING (CWE-476): [#def535]
criu-4.2/criu/page-pipe.c:270: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  268|   	iov_init(&ppb->iov[ppb->nr_segs++], addr);
#  269|   	pp->free_iov++;
#  270|-> 	BUG_ON(pp->free_iov > pp->nr_iovs);
#  271|   out:
#  272|   	ppb->pages_in++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def536]
criu-4.2/criu/page-pipe.c:270:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/page-pipe.c:258:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:261:13: branch_false: ...to here
criu-4.2/criu/page-pipe.c:261:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-pipe.c:264:13: branch_false: ...to here
criu-4.2/criu/page-pipe.c:270:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-pipe.c:270:9: branch_true: ...to here
criu-4.2/criu/page-pipe.c:270:9: danger: dereference of NULL ‘0’
#  268|   	iov_init(&ppb->iov[ppb->nr_segs++], addr);
#  269|   	pp->free_iov++;
#  270|-> 	BUG_ON(pp->free_iov > pp->nr_iovs);
#  271|   out:
#  272|   	ppb->pages_in++;

Error: CPPCHECK_WARNING (CWE-476): [#def537]
criu-4.2/criu/page-pipe.c:278: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  276|   static inline int try_add_page(struct page_pipe *pp, unsigned long addr, unsigned int flags)
#  277|   {
#  278|-> 	BUG_ON(list_empty(&pp->bufs));
#  279|   	return try_add_page_to(pp, list_entry(pp->bufs.prev, struct page_pipe_buf, l), addr, flags);
#  280|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def538]
criu-4.2/criu/page-pipe.c:278:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  276|   static inline int try_add_page(struct page_pipe *pp, unsigned long addr, unsigned int flags)
#  277|   {
#  278|-> 	BUG_ON(list_empty(&pp->bufs));
#  279|   	return try_add_page_to(pp, list_entry(pp->bufs.prev, struct page_pipe_buf, l), addr, flags);
#  280|   }

Error: CPPCHECK_WARNING (CWE-476): [#def539]
criu-4.2/criu/page-pipe.c:295: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  293|   
#  294|   	ret = try_add_page(pp, addr, flags);
#  295|-> 	BUG_ON(ret > 0);
#  296|   	return ret;
#  297|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def540]
criu-4.2/criu/page-xfer.c:77:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#   75|   		type = PS_TYPE_SHMEM;
#   76|   	else {
#   77|-> 		BUG();
#   78|   		return 0;
#   79|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def541]
criu-4.2/criu/page-xfer.c:445:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/page-xfer.c:445:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:445:9: branch_true: ...to here
criu-4.2/criu/page-xfer.c:445:9: danger: dereference of NULL ‘0’
#  443|   static int page_xfer_dump_hole(struct page_xfer *xfer, struct iovec *hole, u32 flags)
#  444|   {
#  445|-> 	BUG_ON(hole->iov_base < (void *)xfer->offset);
#  446|   	hole->iov_base -= xfer->offset;
#  447|   	pr_debug("\th %p [%u]\n", hole->iov_base, (unsigned int)(hole->iov_len / PAGE_SIZE));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def542]
criu-4.2/criu/page-xfer.c:462:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/page-xfer.c:459:12: branch_false: following ‘false’ branch (when ‘hole_flags != 1’)...
criu-4.2/criu/page-xfer.c:462:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:462:17: danger: dereference of NULL ‘0’
#  460|   		return PE_PARENT;
#  461|   	else
#  462|-> 		BUG();
#  463|   
#  464|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def543]
criu-4.2/criu/page-xfer.c:652:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  650|   		if (bytes_read == -1) {
#  651|   			/* Handling faulty page read in faulty iov */
#  652|-> 			cnt_sub(CNT_PAGES_WRITTEN, 1);
#  653|   			dummy.iov_base += PAGE_SIZE;
#  654|   			dummy.iov_len -= PAGE_SIZE;

Error: GCC_ANALYZER_WARNING (CWE-127): [#def544]
criu-4.2/criu/page-xfer.c:659:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  657|   
#  658|   		/* If aux-iov can merge and expand or new entry required */
#  659|-> 		if (aux_iov[(*aux_len) - 1].iov_base + aux_iov[(*aux_len) - 1].iov_len == dummy.iov_base)
#  660|   			aux_iov[(*aux_len) - 1].iov_len += bytes_read;
#  661|   		else {

Error: GCC_ANALYZER_WARNING (CWE-127): [#def545]
criu-4.2/criu/page-xfer.c:659:56: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  657|   
#  658|   		/* If aux-iov can merge and expand or new entry required */
#  659|-> 		if (aux_iov[(*aux_len) - 1].iov_base + aux_iov[(*aux_len) - 1].iov_len == dummy.iov_base)
#  660|   			aux_iov[(*aux_len) - 1].iov_len += bytes_read;
#  661|   		else {

Error: GCC_ANALYZER_WARNING (CWE-124): [#def546]
criu-4.2/criu/page-xfer.c:660:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  658|   		/* If aux-iov can merge and expand or new entry required */
#  659|   		if (aux_iov[(*aux_len) - 1].iov_base + aux_iov[(*aux_len) - 1].iov_len == dummy.iov_base)
#  660|-> 			aux_iov[(*aux_len) - 1].iov_len += bytes_read;
#  661|   		else {
#  662|   			aux_iov[*aux_len].iov_base = dummy.iov_base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def547]
criu-4.2/criu/page-xfer.c:738:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  736|   		if (bytes_read == -1) {
#  737|   			if (errno == ESRCH) {
#  738|-> 				pr_debug("Target process PID:%d not found\n", pid);
#  739|   				return -ESRCH;
#  740|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def548]
criu-4.2/criu/page-xfer.c:742:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  740|   			}
#  741|   			if (errno != EFAULT) {
#  742|-> 				pr_perror("process_vm_readv failed");
#  743|   				return -1;
#  744|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def549]
criu-4.2/criu/page-xfer.c:747:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:778:5: enter_function: entry to ‘page_xfer_predump_pages’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:822:30: call_function: calling ‘fill_userbuf’ from ‘page_xfer_predump_pages’
#  745|   			/* Handling Case 1*/
#  746|   			if (riov[start].iov_len == PAGE_SIZE) {
#  747|-> 				cnt_sub(CNT_PAGES_WRITTEN, 1);
#  748|   				start += 1;
#  749|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def550]
criu-4.2/criu/page-xfer.c:806:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_true: following ‘true’ branch (when ‘addr == 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:806:33: branch_true: ...to here
criu-4.2/criu/page-xfer.c:806:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/page-xfer.c:806:33: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  804|   			addr = mremap(userbuf, userbuf_len, ppb->pipe_size * PAGE_SIZE, MREMAP_MAYMOVE);
#  805|   			if (addr == MAP_FAILED) {
#  806|-> 				pr_perror("Unable to mmap a buffer");
#  807|   				goto err;
#  808|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def551]
criu-4.2/criu/page-xfer.c:811:32: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:804:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:805:28: branch_false: following ‘false’ branch (when ‘addr != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:809:39: branch_false: ...to here
criu-4.2/criu/page-xfer.c:811:32: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/page-xfer.c:811:32: branch_true: ...to here
criu-4.2/criu/page-xfer.c:811:32: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/page-xfer.c:811:32: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  809|   			userbuf_len = ppb->pipe_size * PAGE_SIZE;
#  810|   			userbuf = addr;
#  811|-> 			addr = xrealloc(aux_iov, ppb->pipe_size * sizeof(aux_iov[0]));
#  812|   			if (!addr)
#  813|   				goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def552]
criu-4.2/criu/page-xfer.c:816:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/page-xfer.c:792:12: branch_false: following ‘false’ branch (when ‘userbuf != 18446744073709551615’)...
criu-4.2/criu/page-xfer.c:796:19: branch_false: ...to here
criu-4.2/criu/page-xfer.c:796:19: acquire_memory: allocated here
criu-4.2/criu/page-xfer.c:796:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/page-xfer.c:800:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:800:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:801:21: branch_true: ...to here
criu-4.2/criu/page-xfer.c:801:20: branch_false: following ‘false’ branch...
criu-4.2/criu/page-xfer.c:816:17: branch_false: ...to here
criu-4.2/criu/page-xfer.c:816:17: throw: if ‘timing_start’ throws an exception...
criu-4.2/criu/page-xfer.c:816:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  814|   			aux_iov = addr;
#  815|   		}
#  816|-> 		timing_start(TIME_MEMDUMP);
#  817|   
#  818|   		aux_len = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def553]
criu-4.2/criu/page-xfer.c:1635:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/page-xfer.c:1629:12: branch_false: following ‘false’ branch...
criu-4.2/criu/page-xfer.c:1635:9: branch_false: ...to here
criu-4.2/criu/page-xfer.c:1635:9: branch_true: following ‘true’ branch...
criu-4.2/criu/page-xfer.c:1635:9: branch_true: ...to here
criu-4.2/criu/page-xfer.c:1635:9: danger: dereference of NULL ‘0’
# 1633|   	 * IO complete -- notify the caller and drop the request
# 1634|   	 */
# 1635|-> 	BUG_ON(ar->rb > ar->goal);
# 1636|   	return ar->complete((int)ar->pi.dst_id, (unsigned long)ar->pi.vaddr, (int)ar->pi.nr_pages, ar->priv);
# 1637|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def554]
criu-4.2/criu/page-xfer.c:1644:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1642|   	int ret;
# 1643|   
# 1644|-> 	BUG_ON(list_empty(&async_reads));
# 1645|   	ar = list_first_entry(&async_reads, struct ps_async_read, l);
# 1646|   	ret = page_server_read(ar, MSG_DONTWAIT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def555]
criu-4.2/criu/pagemap-cache.c:52:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap-cache.c:52:9: branch_true: following ‘true’ branch (when ‘vma_head’ is NULL)...
criu-4.2/criu/pagemap-cache.c:52:9: branch_true: ...to here
criu-4.2/criu/pagemap-cache.c:52:9: danger: dereference of NULL ‘0’
#   50|   	pmc_reset(pmc);
#   51|   
#   52|-> 	BUG_ON(!vma_head);
#   53|   
#   54|   	pmc->pid = pid;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def556]
criu-4.2/criu/pagemap-cache.c:143:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap-cache.c:132:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap-cache.c:132:13: branch_false: ...to here
criu-4.2/criu/pagemap-cache.c:132:13: branch_true: following ‘true’ branch...
criu-4.2/criu/pagemap-cache.c:139:17: branch_true: following ‘true’ branch...
criu-4.2/criu/pagemap-cache.c:140:29: branch_true: ...to here
criu-4.2/criu/pagemap-cache.c:140:28: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap-cache.c:143:25: danger: dereference of NULL ‘0’
#  141|   				break;
#  142|   
#  143|-> 			BUG_ON(vma->e->start < low);
#  144|   			size_cov += vma_area_len(vma);
#  145|   			nr_vmas++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def557]
criu-4.2/criu/pagemap-cache.c:174:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap-cache.c:174:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pagemap-cache.c:174:9: branch_true: ...to here
criu-4.2/criu/pagemap-cache.c:174:9: danger: dereference of NULL ‘0’
#  172|   
#  173|   	size_map = PAGEMAP_LEN(pmc->end - pmc->start);
#  174|-> 	BUG_ON(pmc->map_len < size_map);
#  175|   	BUG_ON(pmc->fd < 0);
#  176|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def558]
criu-4.2/criu/pagemap-cache.c:175:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap-cache.c:174:9: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap-cache.c:175:9: branch_false: ...to here
criu-4.2/criu/pagemap-cache.c:175:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pagemap-cache.c:175:9: branch_true: ...to here
criu-4.2/criu/pagemap-cache.c:175:9: danger: dereference of NULL ‘0’
#  173|   	size_map = PAGEMAP_LEN(pmc->end - pmc->start);
#  174|   	BUG_ON(pmc->map_len < size_map);
#  175|-> 	BUG_ON(pmc->fd < 0);
#  176|   
#  177|   	if (pmc->regs) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def559]
criu-4.2/criu/pagemap.c:175:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  173|   	if (vaddr < pe->vaddr || (vaddr - pe->vaddr) / PAGE_SIZE + nr > pe->nr_pages) {
#  174|   		pr_err("Page read err %" PRIx64 ":%" PRIx64 " vs %lx:%lx\n", pe->vaddr, pe->nr_pages, vaddr, nr);
#  175|-> 		BUG();
#  176|   	}
#  177|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def560]
criu-4.2/criu/pagemap.c:285:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:278:18: acquire_memory: allocated here
criu-4.2/criu/pagemap.c:278:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:282:24: branch_false: ...to here
criu-4.2/criu/pagemap.c:285:15: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/pagemap.c:285:15: branch_true: ...to here
criu-4.2/criu/pagemap.c:285:15: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/pagemap.c:285:15: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  283|   	pr_iov->end = pr->pi_off + len;
#  284|   
#  285|-> 	iov = xzalloc(sizeof(*iov));
#  286|   	if (!iov) {
#  287|   		xfree(pr_iov);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def561]
criu-4.2/criu/pagemap.c:421:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap.c:405:12: enter_function: entry to ‘maybe_read_page_img_streamer’
criu-4.2/criu/pagemap.c:412:14: call_function: calling ‘img_raw_fd’ from ‘maybe_read_page_img_streamer’
criu-4.2/criu/pagemap.c:412:14: return_function: returning to ‘maybe_read_page_img_streamer’ from ‘img_raw_fd’
criu-4.2/criu/pagemap.c:413:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:418:9: branch_false: ...to here
criu-4.2/criu/pagemap.c:421:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pagemap.c:421:9: branch_true: ...to here
criu-4.2/criu/pagemap.c:421:9: danger: dereference of NULL ‘0’
#  419|   
#  420|   	/* We can't seek. The requested address better match */
#  421|-> 	BUG_ON(pr->cvaddr != vaddr);
#  422|   
#  423|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def562]
criu-4.2/criu/pagemap.c:579:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap.c:556:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/pagemap.c:562:21: branch_false: ...to here
criu-4.2/criu/pagemap.c:562:20: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:565:28: branch_false: ...to here
criu-4.2/criu/pagemap.c:579:17: danger: dereference of NULL ‘0’
#  577|   		}
#  578|   
#  579|-> 		BUG_ON(pr->io_complete); /* FIXME -- implement once needed */
#  580|   
#  581|   		list_del(&piov->l);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def563]
criu-4.2/criu/pagemap.c:596:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pagemap.c:596:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pagemap.c:596:9: branch_true: ...to here
criu-4.2/criu/pagemap.c:596:9: danger: dereference of NULL ‘0’
#  594|   	int ret;
#  595|   
#  596|-> 	BUG_ON(!list_empty(&pr->async));
#  597|   
#  598|   	if (pr->bunch.iov_len > 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def564]
criu-4.2/criu/pagemap.c:642:13: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: acquire_memory: allocated here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  640|   		goto out;
#  641|   
#  642|-> 	if (open_parent(dfd, &pfd))
#  643|   		goto err;
#  644|   	if (pfd < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def565]
criu-4.2/criu/pagemap.c:647:18: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: acquire_memory: allocated here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  645|   		goto out;
#  646|   
#  647|-> 	parent = xmalloc(sizeof(*parent));
#  648|   	if (!parent)
#  649|   		goto err_cl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def566]
criu-4.2/criu/pagemap.c:668:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  666|   	xfree(parent);
#  667|   err_cl:
#  668|-> 	close(pfd);
#  669|   err:
#  670|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def567]
criu-4.2/criu/pagemap.c:785:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: acquire_memory: allocated here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  783|   		break;
#  784|   	default:
#  785|-> 		BUG();
#  786|   		return -1;
#  787|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def568]
criu-4.2/criu/pagemap.c:785:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  783|   		break;
#  784|   	default:
#  785|-> 		BUG();
#  786|   		return -1;
#  787|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def569]
criu-4.2/criu/pagemap.c:800:19: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: acquire_memory: allocated here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  798|   	pr->disable_dedup = false;
#  799|   
#  800|-> 	pr->pmi = open_image_at(dfd, i_typ, O_RSTR, img_id);
#  801|   	if (!pr->pmi)
#  802|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def570]
criu-4.2/criu/pagemap.c:805:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  803|   
#  804|   	if (empty_image(pr->pmi)) {
#  805|-> 		close_image(pr->pmi);
#  806|   		return 0;
#  807|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def571]
criu-4.2/criu/pagemap.c:810:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pagemap.c:633:12: enter_function: entry to ‘try_open_parent’
criu-4.2/criu/pagemap.c:639:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:642:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:642:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:644:13: branch_false: ...to here
criu-4.2/criu/pagemap.c:644:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pagemap.c:647:18: branch_false: ...to here
criu-4.2/criu/pagemap.c:647:18: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pagemap.c:651:15: branch_false: ...to here
criu-4.2/criu/pagemap.c:651:15: call_function: calling ‘open_page_read_at’ from ‘try_open_parent’
#  808|   
#  809|   	if (try_open_parent(dfd, img_id, pr, pr_flags)) {
#  810|-> 		close_image(pr->pmi);
#  811|   		return -1;
#  812|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def572]
criu-4.2/criu/parasite-syscall.c:108:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:108:9: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:108:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:108:9: danger: dereference of NULL ‘0’
#  106|   	BUILD_BUG_ON(sizeof(ce->cap_amb[0]) != sizeof(c->cap_amb[0]));
#  107|   
#  108|-> 	BUG_ON(ce->n_cap_inh != CR_CAP_SIZE);
#  109|   	BUG_ON(ce->n_cap_prm != CR_CAP_SIZE);
#  110|   	BUG_ON(ce->n_cap_eff != CR_CAP_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def573]
criu-4.2/criu/parasite-syscall.c:109:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:108:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:109:9: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:109:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:109:9: danger: dereference of NULL ‘0’
#  107|   
#  108|   	BUG_ON(ce->n_cap_inh != CR_CAP_SIZE);
#  109|-> 	BUG_ON(ce->n_cap_prm != CR_CAP_SIZE);
#  110|   	BUG_ON(ce->n_cap_eff != CR_CAP_SIZE);
#  111|   	BUG_ON(ce->n_cap_bnd != CR_CAP_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def574]
criu-4.2/criu/parasite-syscall.c:110:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:108:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:110:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:110:9: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:110:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:110:9: danger: dereference of NULL ‘0’
#  108|   	BUG_ON(ce->n_cap_inh != CR_CAP_SIZE);
#  109|   	BUG_ON(ce->n_cap_prm != CR_CAP_SIZE);
#  110|-> 	BUG_ON(ce->n_cap_eff != CR_CAP_SIZE);
#  111|   	BUG_ON(ce->n_cap_bnd != CR_CAP_SIZE);
#  112|   	BUG_ON(ce->n_cap_amb != CR_CAP_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def575]
criu-4.2/criu/parasite-syscall.c:111:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:108:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:110:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:110:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:111:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:111:9: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:111:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:111:9: danger: dereference of NULL ‘0’
#  109|   	BUG_ON(ce->n_cap_prm != CR_CAP_SIZE);
#  110|   	BUG_ON(ce->n_cap_eff != CR_CAP_SIZE);
#  111|-> 	BUG_ON(ce->n_cap_bnd != CR_CAP_SIZE);
#  112|   	BUG_ON(ce->n_cap_amb != CR_CAP_SIZE);
#  113|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def576]
criu-4.2/criu/parasite-syscall.c:112:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:108:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:109:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:110:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:110:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:111:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:111:9: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:112:9: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:112:9: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:112:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:112:9: danger: dereference of NULL ‘0’
#  110|   	BUG_ON(ce->n_cap_eff != CR_CAP_SIZE);
#  111|   	BUG_ON(ce->n_cap_bnd != CR_CAP_SIZE);
#  112|-> 	BUG_ON(ce->n_cap_amb != CR_CAP_SIZE);
#  113|   
#  114|   	memcpy(ce->cap_inh, c->cap_inh, sizeof(c->cap_inh[0]) * CR_CAP_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def577]
criu-4.2/criu/parasite-syscall.c:187:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:187:9: branch_true: following ‘true’ branch (when ‘id == 0’)...
criu-4.2/criu/parasite-syscall.c:187:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:187:9: danger: dereference of NULL ‘0’
#  185|   	int ret;
#  186|   
#  187|-> 	BUG_ON(id == 0); /* Leader is dumped in dump_task_core_all */
#  188|   
#  189|   	args = compel_parasite_args(ctl, struct parasite_dump_thread);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def578]
criu-4.2/criu/parasite-syscall.c:350:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/parasite-syscall.c:346:23: acquire_memory: allocated here
criu-4.2/criu/parasite-syscall.c:346:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:350:21: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/parasite-syscall.c:350:21: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:350:21: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/parasite-syscall.c:350:21: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  348|   		return -1;
#  349|   
#  350|-> 	thread_sp = xzalloc(sizeof(*thread_sp) * item->nr_threads);
#  351|   	if (!thread_sp)
#  352|   		goto free_ctls;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def579]
criu-4.2/criu/parasite-syscall.c:358:40: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/parasite-syscall.c:346:23: acquire_memory: allocated here
criu-4.2/criu/parasite-syscall.c:346:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:354:21: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:355:36: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:357:20: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:358:34: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:358:40: throw: if ‘compel_get_leader_sp’ throws an exception...
criu-4.2/criu/parasite-syscall.c:358:40: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  356|   
#  357|   		if (item->pid->real == tid->real) {
#  358|-> 			thread_sp[i] = compel_get_leader_sp(ctl);
#  359|   			continue;
#  360|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def580]
criu-4.2/criu/parasite-syscall.c:362:34: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/parasite-syscall.c:346:23: acquire_memory: allocated here
criu-4.2/criu/parasite-syscall.c:346:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:354:21: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:355:36: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:357:20: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:362:28: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:362:34: throw: if ‘compel_prepare_thread’ throws an exception...
criu-4.2/criu/parasite-syscall.c:362:34: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  360|   		}
#  361|   
#  362|-> 		thread_ctls[i] = compel_prepare_thread(ctl, tid->real);
#  363|   		if (!thread_ctls[i])
#  364|   			goto free_sp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def581]
criu-4.2/criu/parasite-syscall.c:366:32: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/parasite-syscall.c:346:23: acquire_memory: allocated here
criu-4.2/criu/parasite-syscall.c:346:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:350:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/parasite-syscall.c:351:12: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:354:21: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:355:36: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:357:20: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:362:28: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:363:20: branch_false: following ‘false’ branch...
criu-4.2/criu/parasite-syscall.c:366:26: branch_false: ...to here
criu-4.2/criu/parasite-syscall.c:366:32: throw: if ‘compel_get_thread_sp’ throws an exception...
criu-4.2/criu/parasite-syscall.c:366:32: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  364|   			goto free_sp;
#  365|   
#  366|-> 		thread_sp[i] = compel_get_thread_sp(thread_ctls[i]);
#  367|   	}
#  368|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def582]
criu-4.2/criu/parasite-syscall.c:388:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/parasite-syscall.c:388:9: branch_true: following ‘true’ branch...
criu-4.2/criu/parasite-syscall.c:388:9: branch_true: ...to here
criu-4.2/criu/parasite-syscall.c:388:9: danger: dereference of NULL ‘0’
#  386|   	int ret;
#  387|   
#  388|-> 	BUG_ON(item->threads[0].real != pid);
#  389|   
#  390|   	p = get_exec_start(vma_area_list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def583]
criu-4.2/criu/pidfd-store.c:165:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/pidfd-store.c:142:5: enter_function: entry to ‘init_pidfd_store_hash’
criu-4.2/criu/pidfd-store.c:147:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
criu-4.2/criu/pidfd-store.c:148:17: branch_true: ...to here
criu-4.2/criu/pidfd-store.c:151:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pidfd-store.c:151:12: branch_false: ...to here
criu-4.2/criu/pidfd-store.c:160:25: acquire_memory: allocated here
criu-4.2/criu/pidfd-store.c:160:25: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/pidfd-store.c:163:17: call_function: inlined call to ‘INIT_HLIST_NODE’ from ‘init_pidfd_store_hash’
criu-4.2/criu/pidfd-store.c:165:23: throw: if ‘__recv_fds’ throws an exception...
criu-4.2/criu/pidfd-store.c:165:23: danger: ‘___p’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  163|   		INIT_HLIST_NODE(&entry->hash);
#  164|   
#  165|-> 		ret = __recv_fds(pidfd_store_sk, &entry->pidfd, 1, &entry->pid, sizeof(pid_t), MSG_DONTWAIT);
#  166|   		if (ret == -EAGAIN || ret == -EWOULDBLOCK) {
#  167|   			/* No more fds to read */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def584]
criu-4.2/criu/pidfd.c:205:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pidfd.c:187:12: enter_function: entry to ‘open_one_pidfd’
criu-4.2/criu/pidfd.c:195:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pidfd.c:204:34: branch_false: ...to here
criu-4.2/criu/pidfd.c:204:16: call_function: calling ‘lookup_dead_pidfd’ from ‘open_one_pidfd’
criu-4.2/criu/pidfd.c:204:16: return_function: returning to ‘open_one_pidfd’ from ‘lookup_dead_pidfd’
criu-4.2/criu/pidfd.c:205:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pidfd.c:205:9: branch_true: ...to here
criu-4.2/criu/pidfd.c:205:9: danger: dereference of NULL ‘0’
#  203|   
#  204|   	dead = lookup_dead_pidfd(info->pidfe->ino);
#  205|-> 	BUG_ON(!dead);
#  206|   
#  207|   	if (info->dead && info->dead->creator_id != info->pidfe->id) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def585]
criu-4.2/criu/pie/parasite-vdso.c:132:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pie/parasite-vdso.c:131:12: branch_true: following ‘true’ branch...
criu-4.2/criu/pie/parasite-vdso.c:132:17: branch_true: ...to here
criu-4.2/criu/pie/parasite-vdso.c:132:17: branch_true: following ‘true’ branch (when ‘vdso_size < space’)...
criu-4.2/criu/pie/parasite-vdso.c:132:17: branch_true: ...to here
criu-4.2/criu/pie/parasite-vdso.c:132:17: danger: dereference of NULL ‘0’
#  130|   
#  131|   	if (rt->vvar_start == VVAR_BAD_ADDR) {
#  132|-> 		BUG_ON(vdso_size < space);
#  133|   		return park_at(rt, addr, 0);
#  134|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def586]
criu-4.2/criu/pie/parasite-vdso.c:136:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pie/parasite-vdso.c:131:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pie/parasite-vdso.c:136:9: branch_false: ...to here
criu-4.2/criu/pie/parasite-vdso.c:136:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pie/parasite-vdso.c:136:9: branch_true: ...to here
criu-4.2/criu/pie/parasite-vdso.c:136:9: danger: dereference of NULL ‘0’
#  134|   	}
#  135|   
#  136|-> 	BUG_ON((vdso_size + vvar_size) < space);
#  137|   
#  138|   	if (rt->sym.vdso_before_vvar)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def587]
criu-4.2/criu/pie/restorer.c:1235:59: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ts.tv_sec’
criu-4.2/criu/pie/restorer.c:1215:21: branch_true: following ‘true’ branch...
criu-4.2/criu/pie/restorer.c:1216:46: branch_true: ...to here
criu-4.2/criu/pie/restorer.c:1221:20: branch_true: following ‘true’ branch...
criu-4.2/criu/pie/restorer.c:1230:47: branch_true: ...to here
criu-4.2/criu/pie/restorer.c:1230:28: branch_false: following ‘false’ branch...
criu-4.2/criu/pie/restorer.c:1235:25: branch_false: ...to here
criu-4.2/criu/pie/restorer.c:1235:59: danger: use of uninitialized value ‘ts.tv_sec’ here
# 1233|   			}
# 1234|   
# 1235|-> 			t->val.it_value.tv_sec += (time_t)ts.tv_sec;
# 1236|   
# 1237|   			pr_debug("Adjust id %x it_value(%llu, %llu) -> it_value(%llu, %llu)\n", t->id,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def588]
criu-4.2/criu/pie/restorer.c:1468:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pie/restorer.c:1457:21: branch_true: following ‘true’ branch...
criu-4.2/criu/pie/restorer.c:1460:63: branch_true: ...to here
criu-4.2/criu/pie/restorer.c:1468:25: danger: dereference of NULL ‘0’
# 1466|   			 * and try again.
# 1467|   			 */
# 1468|-> 			futex_wait_while_eq(&task_entries_local->nr_in_progress, nr_in_progress);
# 1469|   			i--;
# 1470|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def589]
criu-4.2/criu/pie/restorer.c:2345:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 2343|   	pr_err("Restorer stack smash detected %ld\n", sys_getpid());
# 2344|   	sys_exit_group(1);
# 2345|-> 	BUG();
# 2346|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def590]
criu-4.2/criu/pipes.c:157:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  155|   
#  156|   	if (!pd) { /* no data for this pipe */
#  157|-> 		pr_info("No data for pipe %#x\n", id);
#  158|   		return 0;
#  159|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def591]
criu-4.2/criu/pipes.c:157:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  155|   
#  156|   	if (!pd) { /* no data for this pipe */
#  157|-> 		pr_info("No data for pipe %#x\n", id);
#  158|   		return 0;
#  159|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def592]
criu-4.2/criu/pipes.c:162:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  160|   
#  161|   	if (pd->pde->has_size) {
#  162|-> 		pr_info("Restoring size %#x for %#x\n", pd->pde->size, pd->pde->pipe_id);
#  163|   		ret = fcntl(pfd, F_SETPIPE_SZ, pd->pde->size);
#  164|   		if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def593]
criu-4.2/criu/pipes.c:162:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  160|   
#  161|   	if (pd->pde->has_size) {
#  162|-> 		pr_info("Restoring size %#x for %#x\n", pd->pde->size, pd->pde->pipe_id);
#  163|   		ret = fcntl(pfd, F_SETPIPE_SZ, pd->pde->size);
#  164|   		if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def594]
criu-4.2/criu/pipes.c:163:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  161|   	if (pd->pde->has_size) {
#  162|   		pr_info("Restoring size %#x for %#x\n", pd->pde->size, pd->pde->pipe_id);
#  163|-> 		ret = fcntl(pfd, F_SETPIPE_SZ, pd->pde->size);
#  164|   		if (ret < 0) {
#  165|   			pr_perror("Can't restore pipe size");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def595]
criu-4.2/criu/pipes.c:163:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  161|   	if (pd->pde->has_size) {
#  162|   		pr_info("Restoring size %#x for %#x\n", pd->pde->size, pd->pde->pipe_id);
#  163|-> 		ret = fcntl(pfd, F_SETPIPE_SZ, pd->pde->size);
#  164|   		if (ret < 0) {
#  165|   			pr_perror("Can't restore pipe size");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def596]
criu-4.2/criu/pipes.c:165:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  163|   		ret = fcntl(pfd, F_SETPIPE_SZ, pd->pde->size);
#  164|   		if (ret < 0) {
#  165|-> 			pr_perror("Can't restore pipe size");
#  166|   			return -1;
#  167|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def597]
criu-4.2/criu/pipes.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  172|   
#  173|   	if (!pd->data) {
#  174|-> 		pr_err("Double data restore occurred on %#x\n", id);
#  175|   		return -1;
#  176|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def598]
criu-4.2/criu/pipes.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  172|   
#  173|   	if (!pd->data) {
#  174|-> 		pr_err("Double data restore occurred on %#x\n", id);
#  175|   		return -1;
#  176|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def599]
criu-4.2/criu/pipes.c:182:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  180|   
#  181|   	while (iov.iov_len > 0) {
#  182|-> 		ret = vmsplice(pfd, &iov, 1, SPLICE_F_GIFT | SPLICE_F_NONBLOCK);
#  183|   		if (ret < 0) {
#  184|   			pr_perror("%#x: Error splicing data", id);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def600]
criu-4.2/criu/pipes.c:182:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/pipes.c:284:5: enter_function: entry to ‘open_pipe’
criu-4.2/criu/pipes.c:292:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:300:13: branch_false: ...to here
criu-4.2/criu/pipes.c:300:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:303:13: branch_false: ...to here
criu-4.2/criu/pipes.c:303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:308:59: branch_false: ...to here
criu-4.2/criu/pipes.c:308:15: call_function: calling ‘restore_pipe_data’ from ‘open_pipe’
#  180|   
#  181|   	while (iov.iov_len > 0) {
#  182|-> 		ret = vmsplice(pfd, &iov, 1, SPLICE_F_GIFT | SPLICE_F_NONBLOCK);
#  183|   		if (ret < 0) {
#  184|   			pr_perror("%#x: Error splicing data", id);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def601]
criu-4.2/criu/pipes.c:221:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path,  flags)’
criu-4.2/criu/pipes.c:218:15: acquire_resource: opened here
criu-4.2/criu/pipes.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:221:9: branch_false: ...to here
criu-4.2/criu/pipes.c:221:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/pipes.c:221:9: danger: ‘open(&path,  flags)’ leaks here; was opened at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  219|   	if (ret < 0)
#  220|   		pr_perror("Unable to reopen the pipe %s", path);
#  221|-> 	close(fd);
#  222|   
#  223|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def602]
criu-4.2/criu/pipes.c:240:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/pipes.c:232:15: acquire_resource: opened here
criu-4.2/criu/pipes.c:233:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:240:9: branch_false: ...to here
criu-4.2/criu/pipes.c:240:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/pipes.c:240:9: danger: ‘ret’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  238|   			pr_perror("Unable to reopen the pipe %s", path);
#  239|   	}
#  240|-> 	close(fd);
#  241|   
#  242|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def603]
criu-4.2/criu/pipes.c:435:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[(int)pde.has_size]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:13: throw: if ‘fcntl’ throws an exception...
criu-4.2/criu/pipes.c:435:13: danger: ‘steal_pipe[(int)pde.has_size]’ leaks here
#  433|   
#  434|   	/* steal_pipe has to be able to fit all data from a target pipe */
#  435|-> 	if (fcntl(steal_pipe[1], F_SETPIPE_SZ, pipe_size) < 0) {
#  436|   		pr_perror("Unable to set a pipe size");
#  437|   		goto err_close;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def604]
criu-4.2/criu/pipes.c:435:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[1]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:13: throw: if ‘fcntl’ throws an exception...
criu-4.2/criu/pipes.c:435:13: danger: ‘steal_pipe[1]’ leaks here
#  433|   
#  434|   	/* steal_pipe has to be able to fit all data from a target pipe */
#  435|-> 	if (fcntl(steal_pipe[1], F_SETPIPE_SZ, pipe_size) < 0) {
#  436|   		pr_perror("Unable to set a pipe size");
#  437|   		goto err_close;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def605]
criu-4.2/criu/pipes.c:436:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[(int)pde.has_size]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_true: following ‘true’ branch...
criu-4.2/criu/pipes.c:436:17: branch_true: ...to here
criu-4.2/criu/pipes.c:436:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/pipes.c:436:17: danger: ‘steal_pipe[(int)pde.has_size]’ leaks here
#  434|   	/* steal_pipe has to be able to fit all data from a target pipe */
#  435|   	if (fcntl(steal_pipe[1], F_SETPIPE_SZ, pipe_size) < 0) {
#  436|-> 		pr_perror("Unable to set a pipe size");
#  437|   		goto err_close;
#  438|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def606]
criu-4.2/criu/pipes.c:440:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[(int)pde.has_size]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:440:17: throw: if ‘tee’ throws an exception...
criu-4.2/criu/pipes.c:440:17: danger: ‘steal_pipe[(int)pde.has_size]’ leaks here
#  438|   	}
#  439|   
#  440|-> 	bytes = tee(lfd, steal_pipe[1], pipe_size, SPLICE_F_NONBLOCK);
#  441|   	if (bytes < 0) {
#  442|   		if (errno != EAGAIN) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def607]
criu-4.2/criu/pipes.c:443:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[(int)pde.has_size]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:441:12: branch_true: following ‘true’ branch (when ‘bytes < 0’)...
criu-4.2/criu/pipes.c:442:21: branch_true: ...to here
criu-4.2/criu/pipes.c:442:20: branch_true: following ‘true’ branch...
criu-4.2/criu/pipes.c:443:25: branch_true: ...to here
criu-4.2/criu/pipes.c:443:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/pipes.c:443:25: danger: ‘steal_pipe[(int)pde.has_size]’ leaks here
#  441|   	if (bytes < 0) {
#  442|   		if (errno != EAGAIN) {
#  443|-> 			pr_perror("Can't pick pipe data");
#  444|   			goto err_close;
#  445|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def608]
criu-4.2/criu/pipes.c:455:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[0]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:441:12: branch_false: following ‘false’ branch (when ‘bytes >= 0’)...
criu-4.2/criu/pipes.c:450:23: call_function: inlined call to ‘pipe_id’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:455:13: throw: if ‘pb_write_one’ throws an exception...
criu-4.2/criu/pipes.c:455:13: danger: ‘steal_pipe[0]’ leaks here
#  453|   	pde.size = pipe_size;
#  454|   
#  455|-> 	if (pb_write_one(img, &pde, PB_PIPE_DATA))
#  456|   		goto err_close;
#  457|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def609]
criu-4.2/criu/pipes.c:455:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[bytes]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:441:12: branch_true: following ‘true’ branch (when ‘bytes < 0’)...
criu-4.2/criu/pipes.c:442:21: branch_true: ...to here
criu-4.2/criu/pipes.c:442:20: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:450:23: call_function: inlined call to ‘pipe_id’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:455:13: throw: if ‘pb_write_one’ throws an exception...
criu-4.2/criu/pipes.c:455:13: danger: ‘steal_pipe[bytes]’ leaks here
#  453|   	pde.size = pipe_size;
#  454|   
#  455|-> 	if (pb_write_one(img, &pde, PB_PIPE_DATA))
#  456|   		goto err_close;
#  457|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def610]
criu-4.2/criu/pipes.c:460:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[0]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:441:12: branch_false: following ‘false’ branch (when ‘bytes >= 0’)...
criu-4.2/criu/pipes.c:450:23: call_function: inlined call to ‘pipe_id’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:455:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:455:12: branch_false: ...to here
criu-4.2/criu/pipes.c:458:16: branch_true: following ‘true’ branch (when ‘bytes > 0’)...
criu-4.2/criu/pipes.c:460:25: branch_true: ...to here
criu-4.2/criu/pipes.c:460:25: throw: if ‘splice’ throws an exception...
criu-4.2/criu/pipes.c:460:25: danger: ‘steal_pipe[0]’ leaks here
#  458|   	while (bytes > 0) {
#  459|   		int wrote;
#  460|-> 		wrote = splice(steal_pipe[0], NULL, img_raw_fd(img), NULL, bytes, 0);
#  461|   		if (wrote < 0) {
#  462|   			pr_perror("Can't push pipe data");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def611]
criu-4.2/criu/pipes.c:472:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[(int)pde.has_size]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:472:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/pipes.c:472:9: danger: ‘steal_pipe[(int)pde.has_size]’ leaks here
#  470|   
#  471|   err_close:
#  472|-> 	close(steal_pipe[0]);
#  473|   	close(steal_pipe[1]);
#  474|   err:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def612]
criu-4.2/criu/pipes.c:472:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘steal_pipe[0]’
criu-4.2/criu/pipes.c:396:5: enter_function: entry to ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:404:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:404:12: branch_false: ...to here
criu-4.2/criu/pipes.c:415:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:420:15: branch_false: ...to here
criu-4.2/criu/pipes.c:420:15: call_function: calling ‘img_from_set’ from ‘dump_one_pipe_data’
criu-4.2/criu/pipes.c:420:15: return_function: returning to ‘dump_one_pipe_data’ from ‘img_from_set’
criu-4.2/criu/pipes.c:424:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:429:13: branch_false: ...to here
criu-4.2/criu/pipes.c:429:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:435:13: branch_false: ...to here
criu-4.2/criu/pipes.c:435:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pipes.c:440:17: branch_false: ...to here
criu-4.2/criu/pipes.c:472:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/pipes.c:472:9: danger: ‘steal_pipe[0]’ leaks here
#  470|   
#  471|   err_close:
#  472|-> 	close(steal_pipe[0]);
#  473|   	close(steal_pipe[1]);
#  474|   err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def613]
criu-4.2/criu/plugin.c:33:19: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/plugin.c:104:12: enter_function: entry to ‘cr_lib_load’
criu-4.2/criu/plugin.c:113:12: branch_false: following ‘false’ branch (when ‘h’ is non-NULL)...
criu-4.2/criu/plugin.c:124:13: branch_false: ...to here
criu-4.2/criu/plugin.c:125:12: branch_true: following ‘true’ branch (when ‘d’ is NULL)...
criu-4.2/criu/plugin.c:126:21: branch_true: ...to here
criu-4.2/criu/plugin.c:126:21: call_function: calling ‘cr_gen_plugin_desc’ from ‘cr_lib_load’
#   31|   		return NULL;
#   32|   
#   33|-> 	d->name = xstrdup(path);
#   34|   	d->max_hooks = CR_PLUGIN_HOOK__MAX;
#   35|   	d->version = CRIU_PLUGIN_VERSION_OLD;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def614]
criu-4.2/criu/plugin.c:37:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/plugin.c:104:12: enter_function: entry to ‘cr_lib_load’
criu-4.2/criu/plugin.c:113:12: branch_false: following ‘false’ branch (when ‘h’ is non-NULL)...
criu-4.2/criu/plugin.c:124:13: branch_false: ...to here
criu-4.2/criu/plugin.c:125:12: branch_true: following ‘true’ branch (when ‘d’ is NULL)...
criu-4.2/criu/plugin.c:126:21: branch_true: ...to here
criu-4.2/criu/plugin.c:126:21: call_function: calling ‘cr_gen_plugin_desc’ from ‘cr_lib_load’
#   35|   	d->version = CRIU_PLUGIN_VERSION_OLD;
#   36|   
#   37|-> 	pr_warn("Generating dynamic descriptor for plugin `%s'."
#   38|   		"Won't work in next version of the program."
#   39|   		"Please update your plugin.\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def615]
criu-4.2/criu/plugin.c:86:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/plugin.c:203:5: enter_function: entry to ‘cr_plugin_init’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:239:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:246:30: branch_false: ...to here
criu-4.2/criu/plugin.c:251:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:256:21: branch_false: ...to here
criu-4.2/criu/plugin.c:256:21: call_function: calling ‘cr_lib_load’ from ‘cr_plugin_init’
#   84|   {
#   85|   	if (d->version > CRIU_PLUGIN_VERSION) {
#   86|-> 		pr_debug("Plugin %s has version %x while max %x supported\n", d->name, d->version, CRIU_PLUGIN_VERSION);
#   87|   		return -1;
#   88|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def616]
criu-4.2/criu/plugin.c:91:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/plugin.c:203:5: enter_function: entry to ‘cr_plugin_init’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:239:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:246:30: branch_false: ...to here
criu-4.2/criu/plugin.c:251:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:256:21: branch_false: ...to here
criu-4.2/criu/plugin.c:256:21: call_function: calling ‘cr_lib_load’ from ‘cr_plugin_init’
#   89|   
#   90|   	if (d->max_hooks > CR_PLUGIN_HOOK__MAX) {
#   91|-> 		pr_debug("Plugin %s has %u assigned while max %u supported\n", d->name, d->max_hooks,
#   92|   			 CR_PLUGIN_HOOK__MAX);
#   93|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def617]
criu-4.2/criu/plugin.c:134:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/plugin.c:203:5: enter_function: entry to ‘cr_plugin_init’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:239:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:246:30: branch_false: ...to here
criu-4.2/criu/plugin.c:251:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:256:21: branch_false: ...to here
criu-4.2/criu/plugin.c:256:21: call_function: calling ‘cr_lib_load’ from ‘cr_plugin_init’
#  132|   	}
#  133|   
#  134|-> 	this = xzalloc(sizeof(*this));
#  135|   	if (!this)
#  136|   		goto error_close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def618]
criu-4.2/criu/plugin.c:134:16: warning[-Wanalyzer-malloc-leak]: leak of ‘d’
criu-4.2/criu/plugin.c:203:5: enter_function: entry to ‘cr_plugin_init’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:239:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:246:30: branch_false: ...to here
criu-4.2/criu/plugin.c:251:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:256:21: branch_false: ...to here
criu-4.2/criu/plugin.c:256:21: call_function: calling ‘cr_lib_load’ from ‘cr_plugin_init’
#  132|   	}
#  133|   
#  134|-> 	this = xzalloc(sizeof(*this));
#  135|   	if (!this)
#  136|   		goto error_close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def619]
criu-4.2/criu/plugin.c:139:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/plugin.c:203:5: enter_function: entry to ‘cr_plugin_init’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:239:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:246:30: branch_false: ...to here
criu-4.2/criu/plugin.c:251:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:256:21: branch_false: ...to here
criu-4.2/criu/plugin.c:256:21: call_function: calling ‘cr_lib_load’ from ‘cr_plugin_init’
#  137|   
#  138|   	if (verify_plugin(d)) {
#  139|-> 		pr_err("Corrupted plugin %s\n", path);
#  140|   		goto error_free;
#  141|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def620]
criu-4.2/criu/plugin.c:176:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/plugin.c:203:5: enter_function: entry to ‘cr_plugin_init’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:239:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:246:30: branch_false: ...to here
criu-4.2/criu/plugin.c:251:20: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:256:21: branch_false: ...to here
criu-4.2/criu/plugin.c:256:21: call_function: calling ‘cr_lib_load’ from ‘cr_plugin_init’
#  174|   	dlclose(h);
#  175|   	if (allocated)
#  176|-> 		xfree(d);
#  177|   	return -1;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def621]
criu-4.2/criu/plugin.c:238:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(opts.libdir)’
criu-4.2/criu/plugin.c:211:21: branch_true: following ‘true’ branch (when ‘i != 13’)...
criu-4.2/criu/plugin.c:212:17: branch_true: ...to here
criu-4.2/criu/plugin.c:226:13: acquire_memory: allocated here
criu-4.2/criu/plugin.c:227:12: branch_false: following ‘false’ branch...
criu-4.2/criu/plugin.c:227:12: branch_false: ...to here
criu-4.2/criu/plugin.c:238:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/plugin.c:238:22: danger: ‘opendir(opts.libdir)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  236|   
#  237|   		errno = 0;
#  238|-> 		de = readdir(d);
#  239|   		if (de == NULL) {
#  240|   			if (errno == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def622]
criu-4.2/criu/proc_parse.c:279:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
criu-4.2/criu/proc_parse.c:421:12: enter_function: entry to ‘vma_get_mapfile’
criu-4.2/criu/proc_parse.c:430:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:433:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:477:12: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:478:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:478:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:482:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:482:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:506:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:506:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:506:40: branch_true: ...to here
criu-4.2/criu/proc_parse.c:506:21: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:507:32: branch_false: ...to here
criu-4.2/criu/proc_parse.c:507:32: call_function: calling ‘vma_get_mapfile_user’ from ‘vma_get_mapfile’
#  277|   static int vma_stat(struct vma_area *vma, int fd)
#  278|   {
#  279|-> 	vma->vmst = xmalloc(sizeof(struct stat));
#  280|   	if (!vma->vmst)
#  281|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def623]
criu-4.2/criu/proc_parse.c:292:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
criu-4.2/criu/proc_parse.c:421:12: enter_function: entry to ‘vma_get_mapfile’
criu-4.2/criu/proc_parse.c:430:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:433:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:477:12: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:478:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:478:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:482:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:482:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:506:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:506:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:506:40: branch_true: ...to here
criu-4.2/criu/proc_parse.c:506:21: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:507:32: branch_false: ...to here
criu-4.2/criu/proc_parse.c:507:32: call_function: calling ‘vma_get_mapfile_user’ from ‘vma_get_mapfile’
#  290|   	 * a branch and we can do fstat() below.
#  291|   	 */
#  292|-> 	if (opts.aufs) {
#  293|   		int ret;
#  294|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def624]
criu-4.2/criu/proc_parse.c:417:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
criu-4.2/criu/proc_parse.c:591:12: enter_function: entry to ‘handle_vma’
criu-4.2/criu/proc_parse.c:594:13: call_function: calling ‘vma_get_mapfile’ from ‘handle_vma’
#  415|   	pr_err("Failed to resolve mapping %lx filename\n", (unsigned long)vma->e->start);
#  416|   closefd:
#  417|-> 	close(fd);
#  418|   	return -1;
#  419|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def625]
criu-4.2/criu/proc_parse.c:838:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pid, 0, "map_files"))’
criu-4.2/criu/proc_parse.c:823:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:826:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:826:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:830:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:838:23: throw: if ‘breadline’ throws an exception...
criu-4.2/criu/proc_parse.c:838:23: danger: ‘fdopendir(do_open_proc(pid, 0, "map_files"))’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  836|   		char *str;
#  837|   
#  838|-> 		str = breadline(&f);
#  839|   		if (IS_ERR(str))
#  840|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def626]
criu-4.2/criu/proc_parse.c:845:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/proc_parse.c:823:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:826:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:826:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:839:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:843:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:843:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:843:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:843:21: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:844:30: branch_false: ...to here
criu-4.2/criu/proc_parse.c:845:33: branch_true: following ‘true’ branch (when ‘vma_area’ is NULL)...
criu-4.2/criu/proc_parse.c:845:33: branch_true: ...to here
criu-4.2/criu/proc_parse.c:845:33: danger: dereference of NULL ‘0’
#  843|   		if (!eof && !__is_vma_range_fmt(str)) {
#  844|   			if (!strncmp(str, "VmFlags: ", 9)) {
#  845|-> 				BUG_ON(!vma_area);
#  846|   				parse_vma_vmflags(&str[9], vma_area);
#  847|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def627]
criu-4.2/criu/proc_parse.c:922:9: warning[-Wanalyzer-malloc-leak]: leak of ‘__d’
criu-4.2/criu/proc_parse.c:823:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:826:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:826:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:830:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:922:9: throw: if ‘bclose’ throws an exception...
criu-4.2/criu/proc_parse.c:922:9: danger: ‘__d’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  920|   
#  921|   err:
#  922|-> 	bclose(&f);
#  923|   err_n:
#  924|   	close_safe(&vm_file_fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def628]
criu-4.2/criu/proc_parse.c:924:9: warning[-Wanalyzer-malloc-leak]: leak of ‘__d’
criu-4.2/criu/proc_parse.c:823:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:826:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:826:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:830:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:924:9: throw: if ‘close_safe’ throws an exception...
criu-4.2/criu/proc_parse.c:924:9: danger: ‘__d’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  922|   	bclose(&f);
#  923|   err_n:
#  924|-> 	close_safe(&vm_file_fd);
#  925|   	if (map_files_dir)
#  926|   		closedir(map_files_dir);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def629]
criu-4.2/criu/proc_parse.c:926:17: warning[-Wanalyzer-malloc-leak]: leak of ‘__d’
criu-4.2/criu/proc_parse.c:823:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:826:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:826:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:830:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:925:12: branch_true: following ‘true’ branch (when ‘map_files_dir’ is non-NULL)...
criu-4.2/criu/proc_parse.c:926:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:926:17: throw: if ‘closedir’ throws an exception...
criu-4.2/criu/proc_parse.c:926:17: danger: ‘__d’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  924|   	close_safe(&vm_file_fd);
#  925|   	if (map_files_dir)
#  926|-> 		closedir(map_files_dir);
#  927|   
#  928|   	xfree(vma_area);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def630]
criu-4.2/criu/proc_parse.c:1475:27: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1682:20: enter_function: entry to ‘parse_mountinfo’
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1687:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1687:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1688:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1691:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1694:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1697:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1700:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1702:23: call_function: calling ‘parse_mountinfo_ent’ from ‘parse_mountinfo’
# 1473|   	char link_path[PATH_MAX];
# 1474|   
# 1475|-> 	new->mountpoint = xmalloc(PATH_MAX);
# 1476|   	if (new->mountpoint == NULL)
# 1477|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def631]
criu-4.2/criu/proc_parse.c:1490:17: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1682:20: enter_function: entry to ‘parse_mountinfo’
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1687:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1687:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1688:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1691:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1694:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1697:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1700:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1702:23: call_function: calling ‘parse_mountinfo_ent’ from ‘parse_mountinfo’
# 1488|   	len = strlen(new->root);
# 1489|   	if (len >= PATH_MAX - 1) {
# 1490|-> 		pr_err("new root path (%s) exceeds %d\n", new->root, PATH_MAX);
# 1491|   		goto err;
# 1492|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def632]
criu-4.2/criu/proc_parse.c:1494:13: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1682:20: enter_function: entry to ‘parse_mountinfo’
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1687:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1687:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1688:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1691:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1694:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1697:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1700:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1702:23: call_function: calling ‘parse_mountinfo_ent’ from ‘parse_mountinfo’
# 1492|   	}
# 1493|   	strcpy(link_path, new->root);
# 1494|-> 	if (strip_deleted(link_path, len)) {
# 1495|   		strcpy(new->root, link_path);
# 1496|   		new->deleted = true;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def633]
criu-4.2/criu/proc_parse.c:1499:27: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1682:20: enter_function: entry to ‘parse_mountinfo’
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1687:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1687:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1688:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1691:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1694:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1697:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1700:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1702:23: call_function: calling ‘parse_mountinfo_ent’ from ‘parse_mountinfo’
# 1497|   	}
# 1498|   
# 1499|-> 	new->mountpoint = xrealloc(new->mountpoint, strlen(new->mountpoint) + 1);
# 1500|   	if (!new->mountpoint)
# 1501|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def634]
criu-4.2/criu/proc_parse.c:1606:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1596:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1596:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1596:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1596:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1597:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1597:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1597:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1601:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1605:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1606:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:1606:25: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1604|   
# 1605|   		if (sscanf(buf, "%9s %" PRId64 " %" PRId64 "\n", clockid, &sec, &nsec) != 3) {
# 1606|-> 			pr_err("Unable to parse: %s\n", buf);
# 1607|   			goto out;
# 1608|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def635]
criu-4.2/criu/proc_parse.c:1620:17: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1596:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1596:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1596:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1596:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1597:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1597:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1597:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1601:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1605:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1609:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1620:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:1620:17: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 1618|   			continue;
# 1619|   		}
# 1620|-> 		pr_err("Unknown clockid: %s\n", clockid);
# 1621|   		goto out;
# 1622|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def636]
criu-4.2/criu/proc_parse.c:1643:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1634:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1634:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1634:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1634:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1635:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1635:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1635:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1638:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1642:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1643:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:1643:25: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1641|   
# 1642|   		if (sscanf(buf, "%i %*i %u:%u", &id, &kmaj, &kmin) != 3) {
# 1643|-> 			pr_err("Failed to parse mountinfo line %s\n", buf);
# 1644|   			goto err;
# 1645|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def637]
criu-4.2/criu/proc_parse.c:1696:23: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1687:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1687:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:1687:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1688:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:1688:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1691:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:1694:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:1696:23: throw: if ‘mnt_entry_alloc’ throws an exception...
criu-4.2/criu/proc_parse.c:1696:23: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1694|   		char *fsname = NULL;
# 1695|   
# 1696|-> 		new = mnt_entry_alloc(false);
# 1697|   		if (!new)
# 1698|   			goto end;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def638]
criu-4.2/criu/proc_parse.c:2038:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:1914:12: enter_function: entry to ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1922:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1930:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1932:21: call_function: inlined call to ‘IS_ERR’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1932:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1935:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2031:28: branch_false: following ‘false’ branch (when ‘type == 7’)...
criu-4.2/criu/proc_parse.c:2034:29: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2034:29: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2034:29: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2038:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2038:25: throw: if ‘eventpoll_tfd_entry__init’ throws an exception...
criu-4.2/criu/proc_parse.c:2038:25: danger: ‘___p’ leaks here; was allocated at [(13)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/12)
# 2036|   				goto out;
# 2037|   
# 2038|-> 			eventpoll_tfd_entry__init(e);
# 2039|   
# 2040|   			ret = sscanf(str,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def639]
criu-4.2/criu/proc_parse.c:2105:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:1914:12: enter_function: entry to ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1922:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1930:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1932:21: call_function: inlined call to ‘IS_ERR’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1932:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1935:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2026:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2066:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2096:28: branch_false: following ‘false’ branch (when ‘type == 12’)...
criu-4.2/criu/proc_parse.c:2099:36: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2099:36: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2099:36: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2104:30: call_function: inlined call to ‘xptr_pull_s’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:2105:25: throw: if ‘fanotify_mark_entry__init’ throws an exception...
criu-4.2/criu/proc_parse.c:2105:25: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/14)
# 2103|   
# 2104|   			me = xptr_pull(&buf, FanotifyMarkEntry);
# 2105|-> 			fanotify_mark_entry__init(me);
# 2106|   			me->ie = xptr_pull(&buf, FanotifyInodeMarkEntry);
# 2107|   			fanotify_inode_mark_entry__init(me->ie);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def640]
criu-4.2/criu/proc_parse.c:2150:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:1914:12: enter_function: entry to ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1922:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1930:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1932:21: call_function: inlined call to ‘IS_ERR’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1932:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1935:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2026:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2066:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2090:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2136:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2142:28: branch_false: following ‘false’ branch (when ‘type == 12’)...
criu-4.2/criu/proc_parse.c:2145:36: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2145:36: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2145:36: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2149:30: call_function: inlined call to ‘xptr_pull_s’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:2150:25: throw: if ‘fanotify_mark_entry__init’ throws an exception...
criu-4.2/criu/proc_parse.c:2150:25: danger: ‘___p’ leaks here; was allocated at [(17)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/16)
# 2148|   
# 2149|   			me = xptr_pull(&buf, FanotifyMarkEntry);
# 2150|-> 			fanotify_mark_entry__init(me);
# 2151|   			me->me = xptr_pull(&buf, FanotifyMountMarkEntry);
# 2152|   			fanotify_mount_mark_entry__init(me->me);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def641]
criu-4.2/criu/proc_parse.c:2188:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:1914:12: enter_function: entry to ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1922:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1925:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:1930:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1932:21: call_function: inlined call to ‘IS_ERR’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:1932:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:1935:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2026:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2066:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2090:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2136:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2136:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2173:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2179:28: branch_false: following ‘false’ branch (when ‘type == 8’)...
criu-4.2/criu/proc_parse.c:2182:36: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2182:36: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2182:36: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2187:31: call_function: inlined call to ‘xptr_pull_s’ from ‘parse_fdinfo_pid_s’
criu-4.2/criu/proc_parse.c:2188:25: throw: if ‘inotify_wd_entry__init’ throws an exception...
criu-4.2/criu/proc_parse.c:2188:25: danger: ‘___p’ leaks here; was allocated at [(19)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/18)
# 2186|   
# 2187|   			ify = xptr_pull(&buf, InotifyWdEntry);
# 2188|-> 			inotify_wd_entry__init(ify);
# 2189|   			ify->f_handle = xptr_pull(&buf, FhEntry);
# 2190|   			fh_entry__init(ify->f_handle);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def642]
criu-4.2/criu/proc_parse.c:2313:17: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2366:5: enter_function: entry to ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2390:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2390:21: call_function: calling ‘parse_file_lock_buf’ from ‘parse_file_locks’
# 2311|   
# 2312|   	if (num < 10) {
# 2313|-> 		pr_err("Invalid file lock info (%d): %s\n", num, buf);
# 2314|   		return -1;
# 2315|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def643]
criu-4.2/criu/proc_parse.c:2342:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2366:5: enter_function: entry to ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2390:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2390:21: call_function: calling ‘parse_file_lock_buf’ from ‘parse_file_locks’
# 2340|   			fl->fl_ltype |= LOCK_WRITE;
# 2341|   		} else {
# 2342|-> 			pr_err("Unknown lock option!\n");
# 2343|   			return -1;
# 2344|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def644]
criu-4.2/criu/proc_parse.c:2353:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2366:5: enter_function: entry to ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2390:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2390:21: call_function: calling ‘parse_file_lock_buf’ from ‘parse_file_locks’
# 2351|   			fl->fl_ltype |= F_RDLCK;
# 2352|   		} else {
# 2353|-> 			pr_err("Unknown lock option!\n");
# 2354|   			return -1;
# 2355|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def645]
criu-4.2/criu/proc_parse.c:2363:16: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2366:5: enter_function: entry to ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2390:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2390:21: call_function: calling ‘parse_file_lock_buf’ from ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2390:21: return_function: returning to ‘parse_file_locks’ from ‘parse_file_lock_buf’
criu-4.2/criu/proc_parse.c:2390:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2395:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2398:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2404:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2404:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2414:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2414:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2414:51: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2414:51: call_function: inlined call to ‘pid_in_pstree’ from ‘parse_file_locks’
# 2361|   static bool pid_in_pstree(pid_t pid)
# 2362|   {
# 2363|-> 	return pstree_item_by_real(pid) != NULL;
# 2364|   }
# 2365|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def646]
criu-4.2/criu/proc_parse.c:2384:22: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2384:22: throw: if ‘alloc_file_lock’ throws an exception...
criu-4.2/criu/proc_parse.c:2384:22: danger: ‘__f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/4)
# 2382|   		is_blocked = strstr(buf, "->") != NULL;
# 2383|   
# 2384|-> 		fl = alloc_file_lock();
# 2385|   		if (!fl) {
# 2386|   			pr_perror("Alloc file lock failed!");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def647]
criu-4.2/criu/proc_parse.c:2386:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2386:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2386:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2386:25: danger: ‘__f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/4)
# 2384|   		fl = alloc_file_lock();
# 2385|   		if (!fl) {
# 2386|-> 			pr_perror("Alloc file lock failed!");
# 2387|   			goto err;
# 2388|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def648]
criu-4.2/criu/proc_parse.c:2395:17: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2366:5: enter_function: entry to ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2390:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2390:21: call_function: calling ‘parse_file_lock_buf’ from ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2390:21: return_function: returning to ‘parse_file_locks’ from ‘parse_file_lock_buf’
criu-4.2/criu/proc_parse.c:2390:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2395:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2395:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2395:17: danger: ‘__f’ leaks here; was allocated at [(6)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/5)
# 2393|   		}
# 2394|   
# 2395|-> 		pr_info("lockinfo: %lld:%d %x %d %02x:%02x:%ld %lld %s\n", fl->fl_id, fl->fl_kind, fl->fl_ltype,
# 2396|   			fl->fl_owner, fl->maj, fl->min, fl->i_no, fl->start, fl->end);
# 2397|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def649]
criu-4.2/criu/proc_parse.c:2399:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2366:5: enter_function: entry to ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2374:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2377:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2377:20: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2377:20: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2378:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2378:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2381:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2382:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2385:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2390:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2390:21: call_function: calling ‘parse_file_lock_buf’ from ‘parse_file_locks’
criu-4.2/criu/proc_parse.c:2390:21: return_function: returning to ‘parse_file_locks’ from ‘parse_file_lock_buf’
criu-4.2/criu/proc_parse.c:2390:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2395:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2398:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2399:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2399:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2399:25: danger: ‘__f’ leaks here; was allocated at [(6)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/5)
# 2397|   
# 2398|   		if (fl->fl_kind == FL_UNKNOWN) {
# 2399|-> 			pr_err("Unknown file lock: %s!\n", buf);
# 2400|   			xfree(fl);
# 2401|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def650]
criu-4.2/criu/proc_parse.c:2552:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2556:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2559:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2560:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/proc_parse.c:2552:22: danger: ‘___p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/8)
# 2550|   		return -1;
# 2551|   
# 2552|-> 	while ((de = readdir(dir))) {
# 2553|   		struct pid *tmp;
# 2554|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def651]
criu-4.2/criu/proc_parse.c:2552:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pid, 0, "task"))’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2548:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2548:15: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/proc_parse.c:2552:22: danger: ‘fdopendir(do_open_proc(pid, 0, "task"))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/2)
# 2550|   		return -1;
# 2551|   
# 2552|-> 	while ((de = readdir(dir))) {
# 2553|   		struct pid *tmp;
# 2554|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def652]
criu-4.2/criu/proc_parse.c:2560:31: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2556:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2559:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2560:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2556:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2556:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2559:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2559:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2560:31: danger: ‘t’ leaks here; was allocated at [(9)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/8)
# 2558|   
# 2559|   		if (*_t == NULL) {
# 2560|-> 			tmp = xrealloc(t, nr * sizeof(struct pid));
# 2561|   			if (!tmp) {
# 2562|   				xfree(t);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def653]
criu-4.2/criu/proc_parse.c:2574:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2556:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2559:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2560:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2574:9: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2574:9: throw: if ‘closedir’ throws an exception...
criu-4.2/criu/proc_parse.c:2574:9: danger: ‘___p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/8)
# 2572|   	}
# 2573|   
# 2574|-> 	closedir(dir);
# 2575|   
# 2576|   	if (*_t == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def654]
criu-4.2/criu/proc_parse.c:2580:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2556:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2559:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2560:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2574:9: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2576:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2580:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2580:17: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2580:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2580:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2580:17: danger: ‘___p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/8)
# 2578|   		*_n = nr - 1;
# 2579|   	} else
# 2580|-> 		BUG_ON(nr - 1 != *_n);
# 2581|   
# 2582|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def655]
criu-4.2/criu/proc_parse.c:2580:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2576:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2580:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2580:17: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2580:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2580:17: danger: dereference of NULL ‘0’
# 2578|   		*_n = nr - 1;
# 2579|   	} else
# 2580|-> 		BUG_ON(nr - 1 != *_n);
# 2581|   
# 2582|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def656]
criu-4.2/criu/proc_parse.c:2583:1: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2548:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2549:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2556:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2559:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2560:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2560:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2560:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2552:16: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2574:9: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2576:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2580:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2580:17: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2580:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2583:1: danger: ‘___p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/8)
# 2581|   
# 2582|   	return 0;
# 2583|-> }
# 2584|   
# 2585|   int parse_cgroup_file(FILE *f, struct list_head *retl, unsigned int *n)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def657]
criu-4.2/criu/proc_parse.c:2591:23: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2656:5: enter_function: entry to ‘parse_thread_cgroup’
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2665:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2665:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2669:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2669:15: call_function: calling ‘parse_cgroup_file’ from ‘parse_thread_cgroup’
# 2589|   		char *name, *path = NULL, *e;
# 2590|   
# 2591|-> 		ncc = xmalloc(sizeof(*cc));
# 2592|   		if (!ncc)
# 2593|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def658]
criu-4.2/criu/proc_parse.c:2604:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2587:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2591:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2591:23: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2591:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2602:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2603:20: branch_true: following ‘true’ branch (when ‘name’ is NULL)...
criu-4.2/criu/proc_parse.c:2604:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2604:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2604:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
# 2602|   		name = strchr(buf, ':');
# 2603|   		if (!name) {
# 2604|-> 			pr_err("Failed parsing cgroup %s\n", buf);
# 2605|   			xfree(ncc);
# 2606|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def659]
criu-4.2/criu/proc_parse.c:2604:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2656:5: enter_function: entry to ‘parse_thread_cgroup’
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2665:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2665:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2669:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2669:15: call_function: calling ‘parse_cgroup_file’ from ‘parse_thread_cgroup’
# 2602|   		name = strchr(buf, ':');
# 2603|   		if (!name) {
# 2604|-> 			pr_err("Failed parsing cgroup %s\n", buf);
# 2605|   			xfree(ncc);
# 2606|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def660]
criu-4.2/criu/proc_parse.c:2610:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2587:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2591:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2591:23: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2591:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2602:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2603:20: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2608:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2609:20: branch_true: following ‘true’ branch (when ‘path’ is NULL)...
criu-4.2/criu/proc_parse.c:2610:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2610:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2610:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
# 2608|   		path = strchr(++name, ':');
# 2609|   		if (!path) {
# 2610|-> 			pr_err("Failed parsing cgroup %s\n", buf);
# 2611|   			xfree(ncc);
# 2612|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def661]
criu-4.2/criu/proc_parse.c:2610:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2656:5: enter_function: entry to ‘parse_thread_cgroup’
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2665:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2665:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2669:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2669:15: call_function: calling ‘parse_cgroup_file’ from ‘parse_thread_cgroup’
# 2608|   		path = strchr(++name, ':');
# 2609|   		if (!path) {
# 2610|-> 			pr_err("Failed parsing cgroup %s\n", buf);
# 2611|   			xfree(ncc);
# 2612|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def662]
criu-4.2/criu/proc_parse.c:2625:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2587:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2591:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2591:23: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2591:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2602:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2603:20: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2608:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2609:20: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2614:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2616:20: branch_false: following ‘false’ branch (when ‘e’ is NULL)...
criu-4.2/criu/proc_parse.c:2625:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2625:21: throw: if ‘cgp_should_skip_controller’ throws an exception...
criu-4.2/criu/proc_parse.c:2625:21: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/2)
# 2623|   		 * sake or container specifics.
# 2624|   		 */
# 2625|-> 		if (cgp_should_skip_controller(name)) {
# 2626|   			pr_debug("cg-prop: Skipping controller %s\n", name);
# 2627|   			xfree(ncc);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def663]
criu-4.2/criu/proc_parse.c:2625:21: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2656:5: enter_function: entry to ‘parse_thread_cgroup’
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2665:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2665:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2669:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2669:15: call_function: calling ‘parse_cgroup_file’ from ‘parse_thread_cgroup’
# 2623|   		 * sake or container specifics.
# 2624|   		 */
# 2625|-> 		if (cgp_should_skip_controller(name)) {
# 2626|   			pr_debug("cg-prop: Skipping controller %s\n", name);
# 2627|   			xfree(ncc);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def664]
criu-4.2/criu/proc_parse.c:2626:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2587:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2591:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2591:23: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2591:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2602:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2603:20: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2608:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2609:20: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2614:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2616:20: branch_false: following ‘false’ branch (when ‘e’ is NULL)...
criu-4.2/criu/proc_parse.c:2625:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2625:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2626:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2626:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2626:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/2)
# 2624|   		 */
# 2625|   		if (cgp_should_skip_controller(name)) {
# 2626|-> 			pr_debug("cg-prop: Skipping controller %s\n", name);
# 2627|   			xfree(ncc);
# 2628|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def665]
criu-4.2/criu/proc_parse.c:2626:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2656:5: enter_function: entry to ‘parse_thread_cgroup’
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2665:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2665:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2669:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2669:15: call_function: calling ‘parse_cgroup_file’ from ‘parse_thread_cgroup’
# 2624|   		 */
# 2625|   		if (cgp_should_skip_controller(name)) {
# 2626|-> 			pr_debug("cg-prop: Skipping controller %s\n", name);
# 2627|   			xfree(ncc);
# 2628|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def666]
criu-4.2/criu/proc_parse.c:2631:29: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2587:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2591:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2591:23: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2591:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2602:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2603:20: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2608:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2609:20: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2614:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2616:20: branch_false: following ‘false’ branch (when ‘e’ is NULL)...
criu-4.2/criu/proc_parse.c:2625:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2631:29: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/proc_parse.c:2631:29: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2631:29: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2631:29: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/2)
# 2629|   		}
# 2630|   
# 2631|-> 		ncc->name = xstrdup(name);
# 2632|   		ncc->path = xstrdup(path);
# 2633|   		ncc->cgns_prefix = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def667]
criu-4.2/criu/proc_parse.c:2631:29: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2656:5: enter_function: entry to ‘parse_thread_cgroup’
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2665:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2665:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2665:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2669:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2669:15: call_function: calling ‘parse_cgroup_file’ from ‘parse_thread_cgroup’
# 2629|   		}
# 2630|   
# 2631|-> 		ncc->name = xstrdup(name);
# 2632|   		ncc->path = xstrdup(path);
# 2633|   		ncc->cgns_prefix = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def668]
criu-4.2/criu/proc_parse.c:2632:29: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2587:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2591:23: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2591:23: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2591:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2602:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2603:20: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2608:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2609:20: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2614:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2616:20: branch_false: following ‘false’ branch (when ‘e’ is NULL)...
criu-4.2/criu/proc_parse.c:2625:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2631:29: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2631:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2632:29: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/proc_parse.c:2632:29: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2632:29: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2632:29: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/2)
# 2630|   
# 2631|   		ncc->name = xstrdup(name);
# 2632|-> 		ncc->path = xstrdup(path);
# 2633|   		ncc->cgns_prefix = 0;
# 2634|   		if (!ncc->name || !ncc->path) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def669]
criu-4.2/criu/proc_parse.c:2769:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_true: following ‘true’ branch (when ‘controllers’ is NULL)...
criu-4.2/criu/proc_parse.c:2769:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2769:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2769:25: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/2)
# 2767|   		controllers = strchr(buf, ':');
# 2768|   		if (!controllers) {
# 2769|-> 			pr_err("Unable to parse \"%s\"\n", buf);
# 2770|   			goto err;
# 2771|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def670]
criu-4.2/criu/proc_parse.c:2776:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_false: following ‘false’ branch (when ‘controllers’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2772:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2775:20: branch_true: following ‘true’ branch (when ‘off’ is NULL)...
criu-4.2/criu/proc_parse.c:2776:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2776:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2776:25: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/2)
# 2774|   		off = strchr(controllers, ':');
# 2775|   		if (!off) {
# 2776|-> 			pr_err("Unable to parse \"%s\"\n", buf);
# 2777|   			goto err;
# 2778|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def671]
criu-4.2/criu/proc_parse.c:2781:21: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_false: following ‘false’ branch (when ‘controllers’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2772:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2775:20: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2779:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2781:21: throw: if ‘cgp_should_skip_controller’ throws an exception...
criu-4.2/criu/proc_parse.c:2781:21: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/2)
# 2779|   		*off = '\0';
# 2780|   
# 2781|-> 		if (cgp_should_skip_controller(controllers)) {
# 2782|   			pr_debug("cg-prop: Skipping controller %s\n", controllers);
# 2783|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def672]
criu-4.2/criu/proc_parse.c:2782:25: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_false: following ‘false’ branch (when ‘controllers’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2772:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2775:20: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2779:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2781:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2782:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2782:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2782:25: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/2)
# 2780|   
# 2781|   		if (cgp_should_skip_controller(controllers)) {
# 2782|-> 			pr_debug("cg-prop: Skipping controller %s\n", controllers);
# 2783|   			continue;
# 2784|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def673]
criu-4.2/criu/proc_parse.c:2795:38: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_false: following ‘false’ branch (when ‘controllers’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2772:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2775:20: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2779:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2788:28: branch_false: following ‘false’ branch (when ‘off’ is NULL)...
criu-4.2/criu/proc_parse.c:2791:30: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2791:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2794:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2794:28: branch_true: following ‘true’ branch (when ‘nc’ is NULL)...
criu-4.2/criu/proc_parse.c:2795:38: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2795:38: throw: if ‘new_controller’ throws an exception...
criu-4.2/criu/proc_parse.c:2795:38: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/2)
# 2793|   
# 2794|   			if (!nc) {
# 2795|-> 				nc = new_controller(controllers);
# 2796|   				if (!nc)
# 2797|   					goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def674]
criu-4.2/criu/proc_parse.c:2805:37: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_false: following ‘false’ branch (when ‘controllers’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2772:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2775:20: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2779:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2788:28: branch_true: following ‘true’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2789:33: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2794:28: branch_true: following ‘true’ branch (when ‘nc’ is NULL)...
criu-4.2/criu/proc_parse.c:2795:38: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2796:36: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2798:33: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2819:28: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2821:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2788:28: branch_false: following ‘false’ branch (when ‘off’ is NULL)...
criu-4.2/criu/proc_parse.c:2791:30: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2791:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2794:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2794:28: branch_false: following ‘false’ branch (when ‘nc’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2804:33: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2805:37: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/proc_parse.c:2805:37: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2805:37: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2805:37: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/2)
# 2803|   
# 2804|   				nc->n_controllers++;
# 2805|-> 				m = xrealloc(nc->controllers, sizeof(char *) * nc->n_controllers);
# 2806|   				if (!m)
# 2807|   					goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def675]
criu-4.2/criu/proc_parse.c:2811:37: warning[-Wanalyzer-malloc-leak]: leak of ‘__f’
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2759:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2759:13: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2759:13: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2760:12: branch_false: following ‘false’ branch (when ‘__f’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2760:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2763:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2767:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2768:20: branch_false: following ‘false’ branch (when ‘controllers’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2772:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2775:20: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2779:17: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2788:28: branch_true: following ‘true’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2789:33: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2794:28: branch_true: following ‘true’ branch (when ‘nc’ is NULL)...
criu-4.2/criu/proc_parse.c:2795:38: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2796:36: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2798:33: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2819:28: branch_false: following ‘false’ branch (when ‘off’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2821:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2788:28: branch_false: following ‘false’ branch (when ‘off’ is NULL)...
criu-4.2/criu/proc_parse.c:2791:30: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2791:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2794:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2794:28: branch_false: following ‘false’ branch (when ‘nc’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2804:33: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2805:37: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2809:33: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2811:37: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/proc_parse.c:2811:37: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2811:37: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2811:37: danger: ‘__f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/2)
# 2809|   				nc->controllers = m;
# 2810|   
# 2811|-> 				n = xstrdup(controllers);
# 2812|   				if (!n)
# 2813|   					goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def676]
criu-4.2/criu/proc_parse.c:2872:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2909:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2872:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/proc_parse.c:2872:22: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/14)
# 2870|   		return -1;
# 2871|   
# 2872|-> 	while ((de = readdir(dir))) {
# 2873|   		char *pos, *end;
# 2874|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def677]
criu-4.2/criu/proc_parse.c:2872:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pid, 0, "task"))’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2868:15: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2868:15: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/proc_parse.c:2872:22: danger: ‘fdopendir(do_open_proc(pid, 0, "task"))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/2)
# 2870|   		return -1;
# 2871|   
# 2872|-> 	while ((de = readdir(dir))) {
# 2873|   		char *pos, *end;
# 2874|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def678]
criu-4.2/criu/proc_parse.c:2878:24: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2909:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2875:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2878:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2878:24: throw: if ‘do_open_proc’ throws an exception...
criu-4.2/criu/proc_parse.c:2878:24: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/14)
# 2876|   			continue;
# 2877|   
# 2878|-> 		f.fd = open_proc(pid, "task/%s/children", de->d_name);
# 2879|   		if (f.fd < 0)
# 2880|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def679]
criu-4.2/criu/proc_parse.c:2882:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2909:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2875:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2878:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:21: throw: if ‘bfdopenr’ throws an exception...
criu-4.2/criu/proc_parse.c:2882:21: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/14)
# 2880|   			goto err;
# 2881|   
# 2882|-> 		if (bfdopenr(&f))
# 2883|   			goto err;
# 2884|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def680]
criu-4.2/criu/proc_parse.c:2888:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2888:31: throw: if ‘breadchr’ throws an exception...
criu-4.2/criu/proc_parse.c:2888:31: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/14)
# 2886|   			pid_t val, *tmp;
# 2887|   
# 2888|-> 			pos = breadchr(&f, ' ');
# 2889|   			if (IS_ERR(pos))
# 2890|   				goto err_close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def681]
criu-4.2/criu/proc_parse.c:2897:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2894:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2897:33: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2897:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2897:33: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/14)
# 2895|   
# 2896|   			if (*end != 0 && *end != ' ') {
# 2897|-> 				pr_err("Unable to parse %s\n", end);
# 2898|   				goto err_close;
# 2899|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def682]
criu-4.2/criu/proc_parse.c:2901:31: warning[-Wanalyzer-malloc-leak]: leak of ‘ch’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2894:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/proc_parse.c:2901:31: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2901:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/proc_parse.c:2901:31: danger: ‘ch’ leaks here; was allocated at [(15)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/14)
# 2899|   			}
# 2900|   
# 2901|-> 			tmp = xrealloc(ch, (nr + 1) * sizeof(pid_t));
# 2902|   			if (!tmp)
# 2903|   				goto err_close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def683]
criu-4.2/criu/proc_parse.c:2909:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2909:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2909:17: throw: if ‘bclose’ throws an exception...
criu-4.2/criu/proc_parse.c:2909:17: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/14)
# 2907|   			nr++;
# 2908|   		}
# 2909|-> 		bclose(&f);
# 2910|   	}
# 2911|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def684]
criu-4.2/criu/proc_parse.c:2918:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2894:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2894:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2918:9: throw: if ‘bclose’ throws an exception...
criu-4.2/criu/proc_parse.c:2918:9: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/14)
# 2916|   	return 0;
# 2917|   err_close:
# 2918|-> 	bclose(&f);
# 2919|   err:
# 2920|   	closedir(dir);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def685]
criu-4.2/criu/proc_parse.c:2920:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/proc_parse.c:2868:15: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2869:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:21: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2882:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2882:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2896:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2901:31: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2901:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/proc_parse.c:2906:27: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2889:28: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2891:28: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2891:28: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2909:17: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2872:16: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2875:21: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2875:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:2878:24: branch_false: ...to here
criu-4.2/criu/proc_parse.c:2879:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:2880:25: branch_true: ...to here
criu-4.2/criu/proc_parse.c:2920:9: throw: if ‘closedir’ throws an exception...
criu-4.2/criu/proc_parse.c:2920:9: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/14)
# 2918|   	bclose(&f);
# 2919|   err:
# 2920|-> 	closedir(dir);
# 2921|   	xfree(ch);
# 2922|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def686]
criu-4.2/criu/protobuf.c:88:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/criu/protobuf.c:57:12: branch_false: following ‘false’ branch...
criu-4.2/criu/protobuf.c:62:9: branch_false: ...to here
criu-4.2/criu/protobuf.c:68:12: branch_false: following ‘false’ branch (when ‘ret != 0’)...
criu-4.2/criu/protobuf.c:75:20: branch_false: ...to here
criu-4.2/criu/protobuf.c:75:19: branch_false: following ‘false’ branch...
criu-4.2/criu/protobuf.c:81:13: branch_false: ...to here
criu-4.2/criu/protobuf.c:81:12: branch_true: following ‘true’ branch...
criu-4.2/criu/protobuf.c:83:23: branch_true: ...to here
criu-4.2/criu/protobuf.c:83:23: acquire_memory: allocated here
criu-4.2/criu/protobuf.c:83:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/protobuf.c:88:15: branch_false: ...to here
criu-4.2/criu/protobuf.c:88:15: throw: if ‘bread’ throws an exception...
criu-4.2/criu/protobuf.c:88:15: danger: ‘buf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   86|   	}
#   87|   
#   88|-> 	ret = bread(&img->_x, buf, size);
#   89|   	if (ret < 0) {
#   90|   		pr_perror("Can't read %d bytes from file %s", size, image_name(img, img_name_buf));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def687]
criu-4.2/criu/protobuf.c:144:18: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/criu/protobuf.c:121:5: enter_function: entry to ‘pb_write_one’
criu-4.2/criu/protobuf.c:129:12: branch_false: following ‘false’ branch...
criu-4.2/criu/protobuf.c:134:13: call_function: inlined call to ‘lazy_image’ from ‘pb_write_one’
criu-4.2/criu/protobuf.c:138:12: branch_true: following ‘true’ branch...
criu-4.2/criu/protobuf.c:139:23: branch_true: ...to here
criu-4.2/criu/protobuf.c:139:23: acquire_memory: allocated here
criu-4.2/criu/protobuf.c:139:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/protobuf.c:144:18: branch_false: ...to here
criu-4.2/criu/protobuf.c:144:18: throw: if the called function throws an exception...
criu-4.2/criu/protobuf.c:144:18: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  142|   	}
#  143|   
#  144|-> 	packed = cr_pb_descs[type].pack(obj, buf);
#  145|   	if (packed != size) {
#  146|   		pr_err("Failed packing PB object %p\n", obj);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def688]
criu-4.2/criu/protobuf.c:187:13: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
criu-4.2/criu/protobuf.c:174:12: branch_false: following ‘false’ branch...
criu-4.2/criu/protobuf.c:179:13: branch_false: ...to here
criu-4.2/criu/protobuf.c:179:12: branch_true: following ‘true’ branch...
criu-4.2/criu/protobuf.c:180:23: branch_true: ...to here
criu-4.2/criu/protobuf.c:180:23: acquire_memory: allocated here
criu-4.2/criu/protobuf.c:181:20: branch_false: following ‘false’ branch...
criu-4.2/criu/protobuf.c:186:9: branch_false: ...to here
criu-4.2/criu/protobuf.c:187:13: throw: if the called function throws an exception...
criu-4.2/criu/protobuf.c:187:13: danger: ‘obj’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  185|   
#  186|   	cinfo->flags |= COLLECT_HAPPENED;
#  187|-> 	if (cinfo->collect(obj, msg, NULL) < 0) {
#  188|   		o_free(obj);
#  189|   		cr_pb_descs[cinfo->pb_type].free(msg, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def689]
criu-4.2/criu/pstree.c:238:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  236|   int init_pstree_helper(struct pstree_item *ret)
#  237|   {
#  238|-> 	BUG_ON(!ret->parent);
#  239|   	ret->pid->state = TASK_HELPER;
#  240|   	rsti(ret)->clone_flags = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def690]
criu-4.2/criu/pstree.c:494:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  492|   	if (!node)
#  493|   		return NULL;
#  494|-> 	BUG_ON(node->state == TASK_THREAD);
#  495|   
#  496|   	return node->item;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def691]
criu-4.2/criu/pstree.c:564:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pstree.c:550:12: enter_function: entry to ‘read_one_pstree_item’
criu-4.2/criu/pstree.c:557:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pstree.c:561:34: branch_false: ...to here
criu-4.2/criu/pstree.c:561:14: call_function: calling ‘lookup_create_item’ from ‘read_one_pstree_item’
criu-4.2/criu/pstree.c:561:14: return_function: returning to ‘read_one_pstree_item’ from ‘lookup_create_item’
criu-4.2/criu/pstree.c:562:12: branch_false: following ‘false’ branch...
criu-4.2/criu/pstree.c:564:9: branch_false: ...to here
criu-4.2/criu/pstree.c:564:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pstree.c:564:9: branch_true: ...to here
criu-4.2/criu/pstree.c:564:9: danger: dereference of NULL ‘0’
#  562|   	if (pi == NULL)
#  563|   		goto err;
#  564|-> 	BUG_ON(pi->pid->state != TASK_UNDEF);
#  565|   
#  566|   	/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def692]
criu-4.2/criu/pstree.c:718:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/pstree.c:693:12: enter_function: entry to ‘prepare_pstree_ids’
criu-4.2/criu/pstree.c:706:9: branch_true: following ‘true’ branch...
criu-4.2/criu/pstree.c:714:21: branch_true: ...to here
criu-4.2/criu/pstree.c:717:26: call_function: calling ‘pstree_item_by_virt’ from ‘prepare_pstree_ids’
criu-4.2/criu/pstree.c:717:26: return_function: returning to ‘prepare_pstree_ids’ from ‘pstree_item_by_virt’
criu-4.2/criu/pstree.c:718:17: branch_true: following ‘true’ branch...
criu-4.2/criu/pstree.c:718:17: branch_true: ...to here
criu-4.2/criu/pstree.c:718:17: danger: dereference of NULL ‘0’
#  716|   
#  717|   		leader = pstree_item_by_virt(item->sid);
#  718|-> 		BUG_ON(leader == NULL);
#  719|   		if (leader->pid->state != TASK_UNDEF) {
#  720|   			pid_t helper_pid;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def693]
criu-4.2/criu/pstree.c:1108:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1106|   	if (pid == NULL)
# 1107|   		return NULL;
# 1108|-> 	BUG_ON(pid->state == TASK_THREAD);
# 1109|   
# 1110|   	return pid->item;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def694]
criu-4.2/criu/rst-malloc.c:150:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  148|   {
#  149|   	struct rst_mem_type_s *t = &rst_mems[type];
#  150|-> 	BUG_ON(!t->remapable || !t->enabled);
#  151|   
#  152|   	rst_mem_align(type);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def695]
criu-4.2/criu/rst-malloc.c:160:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/rst-malloc.c:160:9: branch_false: following ‘false’ branch...
criu-4.2/criu/rst-malloc.c:160:9: branch_false: ...to here
criu-4.2/criu/rst-malloc.c:160:9: danger: dereference of NULL ‘0’
#  158|   {
#  159|   	struct rst_mem_type_s *t = &rst_mems[type];
#  160|-> 	BUG_ON(!t->remapable);
#  161|   	return t->buf + pos;
#  162|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def696]
criu-4.2/criu/rst-malloc.c:169:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/rst-malloc.c:169:9: branch_false: following ‘false’ branch...
criu-4.2/criu/rst-malloc.c:169:9: branch_false: ...to here
criu-4.2/criu/rst-malloc.c:169:9: danger: dereference of NULL ‘0’
#  167|   	void *ret;
#  168|   
#  169|-> 	BUG_ON(!t->enabled);
#  170|   
#  171|   	if ((t->free_bytes < size) && t->grow(t, size)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def697]
criu-4.2/criu/rst-malloc.c:188:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  186|   	struct rst_mem_type_s *t = &rst_mems[type];
#  187|   
#  188|-> 	BUG_ON(!t->enabled);
#  189|   
#  190|   	t->free_mem -= t->last;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def698]
criu-4.2/criu/rst-malloc.c:211:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  209|   	void *aux;
#  210|   
#  211|-> 	BUG_ON(!t->remapable || t->enabled);
#  212|   
#  213|   	if (!t->buf)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def699]
criu-4.2/criu/seccomp.c:173:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/seccomp.c:140:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:140:12: branch_false: ...to here
criu-4.2/criu/seccomp.c:145:20: branch_false: following ‘false’ branch (when ‘len >= 0’)...
criu-4.2/criu/seccomp.c:154:20: branch_false: ...to here
criu-4.2/criu/seccomp.c:154:20: branch_true: following ‘true’ branch (when ‘meta’ is non-NULL)...
criu-4.2/criu/seccomp.c:155:25: branch_true: ...to here
criu-4.2/criu/seccomp.c:157:28: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:169:25: branch_false: ...to here
criu-4.2/criu/seccomp.c:169:25: acquire_memory: allocated here
criu-4.2/criu/seccomp.c:169:25: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:173:17: branch_false: ...to here
criu-4.2/criu/seccomp.c:173:17: throw: if ‘seccomp_filter__init’ throws an exception...
criu-4.2/criu/seccomp.c:173:17: danger: ‘___p’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  171|   			return -1;
#  172|   
#  173|-> 		seccomp_filter__init(&chain->filter);
#  174|   
#  175|   		chain->filter.has_flags = true;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def700]
criu-4.2/criu/seccomp.c:222:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seccomp.c:211:13: enter_function: entry to ‘try_use_tsync’
criu-4.2/criu/seccomp.c:217:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:217:12: branch_false: ...to here
criu-4.2/criu/seccomp.c:220:21: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:221:25: branch_true: ...to here
criu-4.2/criu/seccomp.c:221:25: call_function: calling ‘seccomp_lookup’ from ‘try_use_tsync’
criu-4.2/criu/seccomp.c:221:25: return_function: returning to ‘try_use_tsync’ from ‘seccomp_lookup’
criu-4.2/criu/seccomp.c:222:17: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:222:17: branch_true: ...to here
criu-4.2/criu/seccomp.c:222:17: danger: dereference of NULL ‘0’
#  220|   	for (i = 0; i < item->nr_threads; i++) {
#  221|   		entry = seccomp_find_entry(item->threads[i].real);
#  222|-> 		BUG_ON(!entry);
#  223|   
#  224|   		if (entry == leader)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def701]
criu-4.2/criu/seccomp.c:234:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seccomp.c:211:13: enter_function: entry to ‘try_use_tsync’
criu-4.2/criu/seccomp.c:217:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:217:12: branch_false: ...to here
criu-4.2/criu/seccomp.c:220:21: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:221:25: branch_true: ...to here
criu-4.2/criu/seccomp.c:221:25: call_function: calling ‘seccomp_lookup’ from ‘try_use_tsync’
criu-4.2/criu/seccomp.c:221:25: return_function: returning to ‘try_use_tsync’ from ‘seccomp_lookup’
criu-4.2/criu/seccomp.c:222:17: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:224:20: branch_false: ...to here
criu-4.2/criu/seccomp.c:227:20: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:234:25: danger: dereference of NULL ‘0’
#  232|   
#  233|   		for (j = 0; j < leader->nr_chains; j++) {
#  234|-> 			BUG_ON((!chain_a || !chain_b));
#  235|   
#  236|   			if (chain_a->filter.filter.len != chain_b->filter.filter.len)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def702]
criu-4.2/criu/seccomp.c:256:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seccomp.c:211:13: enter_function: entry to ‘try_use_tsync’
criu-4.2/criu/seccomp.c:217:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:217:12: branch_false: ...to here
criu-4.2/criu/seccomp.c:254:21: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:255:25: branch_true: ...to here
criu-4.2/criu/seccomp.c:255:25: call_function: calling ‘seccomp_lookup’ from ‘try_use_tsync’
criu-4.2/criu/seccomp.c:255:25: return_function: returning to ‘try_use_tsync’ from ‘seccomp_lookup’
criu-4.2/criu/seccomp.c:256:17: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:256:17: branch_true: ...to here
criu-4.2/criu/seccomp.c:256:17: danger: dereference of NULL ‘0’
#  254|   	for (i = 0; i < item->nr_threads; i++) {
#  255|   		entry = seccomp_find_entry(item->threads[i].real);
#  256|-> 		BUG_ON(!entry);
#  257|   
#  258|   		if (entry == leader)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def703]
criu-4.2/criu/seccomp.c:318:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/seccomp.c:312:12: branch_true: following ‘true’ branch (when ‘nr_chains != 0’)...
criu-4.2/criu/seccomp.c:313:38: branch_true: ...to here
criu-4.2/criu/seccomp.c:313:38: acquire_memory: allocated here
criu-4.2/criu/seccomp.c:313:38: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:313:17: branch_false: ...to here
criu-4.2/criu/seccomp.c:314:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:318:21: branch_false: ...to here
criu-4.2/criu/seccomp.c:318:21: throw: if ‘rb_first’ throws an exception...
criu-4.2/criu/seccomp.c:318:21: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  316|   	}
#  317|   
#  318|-> 	for (node = rb_first(&seccomp_tid_rb_root); node; node = rb_next(node)) {
#  319|   		entry = rb_entry(node, struct seccomp_entry, node);
#  320|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def704]
criu-4.2/criu/seccomp.c:318:66: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/seccomp.c:312:12: branch_true: following ‘true’ branch (when ‘nr_chains != 0’)...
criu-4.2/criu/seccomp.c:313:38: branch_true: ...to here
criu-4.2/criu/seccomp.c:313:38: acquire_memory: allocated here
criu-4.2/criu/seccomp.c:313:38: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:313:17: branch_false: ...to here
criu-4.2/criu/seccomp.c:314:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:318:21: branch_false: ...to here
criu-4.2/criu/seccomp.c:318:53: branch_true: following ‘true’ branch (when ‘node’ is non-NULL)...
criu-4.2/criu/seccomp.c:321:22: branch_true: ...to here
criu-4.2/criu/seccomp.c:321:20: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:321:20: branch_true: ...to here
criu-4.2/criu/seccomp.c:318:66: throw: if ‘rb_next’ throws an exception...
criu-4.2/criu/seccomp.c:318:66: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  316|   	}
#  317|   
#  318|-> 	for (node = rb_first(&seccomp_tid_rb_root); node; node = rb_next(node)) {
#  319|   		entry = rb_entry(node, struct seccomp_entry, node);
#  320|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def705]
criu-4.2/criu/seccomp.c:326:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/seccomp.c:312:12: branch_true: following ‘true’ branch (when ‘nr_chains != 0’)...
criu-4.2/criu/seccomp.c:313:38: branch_true: ...to here
criu-4.2/criu/seccomp.c:313:38: acquire_memory: allocated here
criu-4.2/criu/seccomp.c:313:38: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:313:17: branch_false: ...to here
criu-4.2/criu/seccomp.c:314:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:318:21: branch_false: ...to here
criu-4.2/criu/seccomp.c:318:53: branch_true: following ‘true’ branch (when ‘node’ is non-NULL)...
criu-4.2/criu/seccomp.c:321:22: branch_true: ...to here
criu-4.2/criu/seccomp.c:324:44: branch_true: following ‘true’ branch (when ‘chain’ is non-NULL)...
criu-4.2/criu/seccomp.c:325:28: branch_true: ...to here
criu-4.2/criu/seccomp.c:325:28: branch_true: following ‘true’ branch (when ‘img_filter_pos >= nr_chains’)...
criu-4.2/criu/seccomp.c:326:33: branch_true: ...to here
criu-4.2/criu/seccomp.c:326:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/seccomp.c:326:33: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  324|   		for (chain = entry->chain; chain; chain = chain->prev) {
#  325|   			if (img_filter_pos >= nr_chains) {
#  326|-> 				pr_err("Unexpected position %zu > %zu\n", img_filter_pos, nr_chains);
#  327|   				xfree(se.seccomp_filters);
#  328|   				return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def706]
criu-4.2/criu/seccomp.c:342:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/seccomp.c:297:12: enter_function: entry to ‘dump_seccomp_filters’
criu-4.2/criu/seccomp.c:312:12: branch_true: following ‘true’ branch (when ‘nr_chains != 0’)...
criu-4.2/criu/seccomp.c:313:38: branch_true: ...to here
criu-4.2/criu/seccomp.c:313:38: acquire_memory: allocated here
criu-4.2/criu/seccomp.c:313:38: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:313:17: branch_false: ...to here
criu-4.2/criu/seccomp.c:314:20: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seccomp.c:318:21: branch_false: ...to here
criu-4.2/criu/seccomp.c:342:15: call_function: calling ‘img_from_set’ from ‘dump_seccomp_filters’
criu-4.2/criu/seccomp.c:342:15: return_function: returning to ‘dump_seccomp_filters’ from ‘img_from_set’
criu-4.2/criu/seccomp.c:342:15: throw: if ‘pb_write_one’ throws an exception...
criu-4.2/criu/seccomp.c:342:15: danger: ‘___p’ leaks here; was allocated at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
#  340|   	}
#  341|   
#  342|-> 	ret = pb_write_one(img_from_set(glob_imgset, CR_FD_SECCOMP), &se, PB_SECCOMP);
#  343|   
#  344|   	xfree(se.seccomp_filters);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def707]
criu-4.2/criu/seccomp.c:380:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seccomp.c:372:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:375:15: branch_false: ...to here
criu-4.2/criu/seccomp.c:377:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seccomp.c:380:9: branch_false: ...to here
criu-4.2/criu/seccomp.c:380:9: branch_true: following ‘true’ branch...
criu-4.2/criu/seccomp.c:380:9: branch_true: ...to here
criu-4.2/criu/seccomp.c:380:9: danger: dereference of NULL ‘0’
#  378|   		return 0; /* there were no filters */
#  379|   
#  380|-> 	BUG_ON(!seccomp_img_entry);
#  381|   
#  382|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def708]
criu-4.2/criu/seize.c:59:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
criu-4.2/criu/seize.c:286:12: enter_function: entry to ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: call_function: calling ‘freezer_open_thread_list’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: return_function: returning to ‘seize_cgroup_tree’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:298:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:298:12: branch_false: ...to here
criu-4.2/criu/seize.c:301:16: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:305:23: call_function: inlined call to ‘atoi’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:311:20: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:312:25: branch_true: ...to here
criu-4.2/criu/seize.c:312:25: call_function: inlined call to ‘__task_comm_info’ from ‘seize_cgroup_tree’
#   57|   				comm[n - 1] = '\0';
#   58|   			} else {
#   59|-> 				pr_warn("Failed to read %s: %s\n", path, strerror(errno));
#   60|   			}
#   61|   			close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def709]
criu-4.2/criu/seize.c:180:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
criu-4.2/criu/seize.c:187:27: enter_function: entry to ‘get_freezer_state’
criu-4.2/criu/seize.c:189:12: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:190:24: branch_true: ...to here
criu-4.2/criu/seize.c:190:24: call_function: calling ‘get_freezer_v2_state’ from ‘get_freezer_state’
#  178|   	}
#  179|   
#  180|-> 	pr_err("Unknown freezer state: %c\n", state);
#  181|   close:
#  182|   	fclose(event);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def710]
criu-4.2/criu/seize.c:180:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
criu-4.2/criu/seize.c:187:27: enter_function: entry to ‘get_freezer_state’
criu-4.2/criu/seize.c:189:12: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:190:24: branch_true: ...to here
criu-4.2/criu/seize.c:190:24: call_function: calling ‘get_freezer_v2_state’ from ‘get_freezer_state’
#  178|   	}
#  179|   
#  180|-> 	pr_err("Unknown freezer state: %c\n", state);
#  181|   close:
#  182|   	fclose(event);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def711]
criu-4.2/criu/seize.c:240:77: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘freezer_open()’
criu-4.2/criu/seize.c:250:12: enter_function: entry to ‘freezer_restore_state’
criu-4.2/criu/seize.c:255:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:258:14: call_function: calling ‘freezer_open’ from ‘freezer_restore_state’
criu-4.2/criu/seize.c:258:14: return_function: returning to ‘freezer_restore_state’ from ‘freezer_open’
criu-4.2/criu/seize.c:259:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:262:15: branch_false: ...to here
criu-4.2/criu/seize.c:262:15: call_function: calling ‘freezer_write_state’ from ‘freezer_restore_state’
#  238|   	int fd;
#  239|   
#  240|-> 	snprintf(path, sizeof(path), "%s/%s", opts.freeze_cgroup, cgroup_v2 ? freezer_v2 : freezer_v1);
#  241|   	fd = open(path, O_RDWR);
#  242|   	if (fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def712]
criu-4.2/criu/seize.c:272:68: warning[-Wanalyzer-file-leak]: leak of FILE ‘freezer_open_thread_list(root)’
criu-4.2/criu/seize.c:440:12: enter_function: entry to ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:447:13: call_function: calling ‘freezer_open_thread_list’ from ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:447:13: return_function: returning to ‘log_unfrozen_stacks’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:448:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:448:12: branch_false: ...to here
criu-4.2/criu/seize.c:451:16: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:456:23: call_function: inlined call to ‘atoi’ from ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:458:25: throw: if ‘do_open_proc’ throws an exception...
criu-4.2/criu/seize.c:272:68: danger: ‘freezer_open_thread_list(root)’ leaks here; was opened at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
#  270|   	FILE *f;
#  271|   
#  272|-> 	snprintf(path, sizeof(path), "%s/%s", root_path, cgroup_v2 ? "cgroup.threads" : "tasks");
#  273|   	f = fopen(path, "r");
#  274|   	if (f == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def713]
criu-4.2/criu/seize.c:272:68: warning[-Wanalyzer-file-leak]: leak of FILE ‘freezer_open_thread_list(root_path)’
criu-4.2/criu/seize.c:286:12: enter_function: entry to ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: call_function: calling ‘freezer_open_thread_list’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: return_function: returning to ‘seize_cgroup_tree’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:298:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:298:12: branch_false: ...to here
criu-4.2/criu/seize.c:301:16: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:305:23: call_function: inlined call to ‘atoi’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:311:20: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:317:22: branch_false: ...to here
criu-4.2/criu/seize.c:317:22: throw: if ‘compel_interrupt_task’ throws an exception...
criu-4.2/criu/seize.c:272:68: danger: ‘freezer_open_thread_list(root_path)’ leaks here; was opened at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
#  270|   	FILE *f;
#  271|   
#  272|-> 	snprintf(path, sizeof(path), "%s/%s", root_path, cgroup_v2 ? "cgroup.threads" : "tasks");
#  273|   	f = fopen(path, "r");
#  274|   	if (f == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def714]
criu-4.2/criu/seize.c:272:68: warning[-Wanalyzer-malloc-leak]: leak of ‘freezer_open_thread_list(root)’
criu-4.2/criu/seize.c:440:12: enter_function: entry to ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:447:13: call_function: calling ‘freezer_open_thread_list’ from ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:447:13: return_function: returning to ‘log_unfrozen_stacks’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:448:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:448:12: branch_false: ...to here
criu-4.2/criu/seize.c:451:16: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:456:23: call_function: inlined call to ‘atoi’ from ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:458:25: throw: if ‘do_open_proc’ throws an exception...
criu-4.2/criu/seize.c:272:68: danger: ‘freezer_open_thread_list(root)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/3)
#  270|   	FILE *f;
#  271|   
#  272|-> 	snprintf(path, sizeof(path), "%s/%s", root_path, cgroup_v2 ? "cgroup.threads" : "tasks");
#  273|   	f = fopen(path, "r");
#  274|   	if (f == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def715]
criu-4.2/criu/seize.c:272:68: warning[-Wanalyzer-malloc-leak]: leak of ‘freezer_open_thread_list(root_path)’
criu-4.2/criu/seize.c:286:12: enter_function: entry to ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: call_function: calling ‘freezer_open_thread_list’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: return_function: returning to ‘seize_cgroup_tree’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:298:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:298:12: branch_false: ...to here
criu-4.2/criu/seize.c:301:16: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:305:23: call_function: inlined call to ‘atoi’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:311:20: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:317:22: branch_false: ...to here
criu-4.2/criu/seize.c:317:22: throw: if ‘compel_interrupt_task’ throws an exception...
criu-4.2/criu/seize.c:272:68: danger: ‘freezer_open_thread_list(root_path)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/3)
#  270|   	FILE *f;
#  271|   
#  272|-> 	snprintf(path, sizeof(path), "%s/%s", root_path, cgroup_v2 ? "cgroup.threads" : "tasks");
#  273|   	f = fopen(path, "r");
#  274|   	if (f == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def716]
criu-4.2/criu/seize.c:348:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(root_path)’
criu-4.2/criu/seize.c:286:12: enter_function: entry to ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: call_function: calling ‘freezer_open_thread_list’ from ‘seize_cgroup_tree’
criu-4.2/criu/seize.c:297:13: return_function: returning to ‘seize_cgroup_tree’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:298:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:298:12: branch_false: ...to here
criu-4.2/criu/seize.c:342:15: acquire_memory: allocated here
criu-4.2/criu/seize.c:343:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:343:12: branch_false: ...to here
criu-4.2/criu/seize.c:348:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/seize.c:348:22: danger: ‘opendir(root_path)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/8)
#  346|   	}
#  347|   
#  348|-> 	while ((de = readdir(dir))) {
#  349|   		struct stat st;
#  350|   		int ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def717]
criu-4.2/criu/seize.c:484:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(root)’
criu-4.2/criu/seize.c:440:12: enter_function: entry to ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:447:13: call_function: calling ‘freezer_open_thread_list’ from ‘log_unfrozen_stacks’
criu-4.2/criu/seize.c:447:13: return_function: returning to ‘log_unfrozen_stacks’ from ‘freezer_open_thread_list’
criu-4.2/criu/seize.c:448:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:448:12: branch_false: ...to here
criu-4.2/criu/seize.c:478:15: acquire_memory: allocated here
criu-4.2/criu/seize.c:479:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:479:12: branch_false: ...to here
criu-4.2/criu/seize.c:484:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/seize.c:484:22: danger: ‘opendir(root)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/8)
#  482|   	}
#  483|   
#  484|-> 	while ((de = readdir(dir))) {
#  485|   		struct stat st;
#  486|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def718]
criu-4.2/criu/seize.c:517:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seize.c:517:9: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:517:9: branch_false: ...to here
criu-4.2/criu/seize.c:517:9: danger: dereference of NULL ‘0’
#  515|   	int exit_code = -1;
#  516|   
#  517|-> 	BUG_ON(!compel_interrupt_only_mode);
#  518|   
#  519|   	fd = freezer_open();

Error: GCC_ANALYZER_WARNING (CWE-476): [#def719]
criu-4.2/criu/seize.c:807:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seize.c:795:9: branch_true: following ‘true’ branch (when ‘item’ is non-NULL)...
criu-4.2/criu/seize.c:796:21: branch_true: ...to here
criu-4.2/criu/seize.c:807:41: danger: dereference of NULL ‘0’
#  805|   				if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGKILL) {
#  806|   					pr_err("Unexpected exit code %d of %d: %s\n", status, pid, strsignal(status));
#  807|-> 					BUG();
#  808|   				}
#  809|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def720]
criu-4.2/criu/seize.c:816:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seize.c:814:12: branch_true: following ‘true’ branch (when ‘pid > 0’)...
criu-4.2/criu/seize.c:815:17: branch_true: ...to here
criu-4.2/criu/seize.c:816:17: danger: dereference of NULL ‘0’
#  814|   	if (pid > 0) {
#  815|   		pr_err("Unexpected child %d\n", pid);
#  816|-> 		BUG();
#  817|   	}
#  818|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def721]
criu-4.2/criu/seize.c:932:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/seize.c:874:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:877:29: branch_false: ...to here
criu-4.2/criu/seize.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:881:14: branch_false: ...to here
criu-4.2/criu/seize.c:887:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/seize.c:891:9: branch_false: ...to here
criu-4.2/criu/seize.c:900:21: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:901:36: branch_true: ...to here
criu-4.2/criu/seize.c:904:20: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:907:17: branch_false: ...to here
criu-4.2/criu/seize.c:916:20: branch_false: following ‘false’ branch...
criu-4.2/criu/seize.c:927:20: branch_false: ...to here
criu-4.2/criu/seize.c:932:17: branch_true: following ‘true’ branch...
criu-4.2/criu/seize.c:932:17: branch_true: ...to here
criu-4.2/criu/seize.c:932:17: danger: dereference of NULL ‘0’
#  930|   			processes_to_wait--;
#  931|   
#  932|-> 		BUG_ON(item->nr_threads + 1 > nr_threads);
#  933|   		item->threads[item->nr_threads].real = pid;
#  934|   		item->threads[item->nr_threads].ns[0].virt = t_creds.s.vpid;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def722]
criu-4.2/criu/servicefd.c:101:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/servicefd.c:153:5: enter_function: entry to ‘install_service_fd’
criu-4.2/criu/servicefd.c:158:9: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:159:13: branch_false: ...to here
criu-4.2/criu/servicefd.c:162:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:170:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:170:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:173:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:173:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:174:12: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/servicefd.c:178:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:178:19: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:185:9: call_function: inlined call to ‘set_bit’ from ‘install_service_fd’
criu-4.2/criu/servicefd.c:155:19: call_function: inlined call to ‘__get_service_fd’ from ‘install_service_fd’
#   99|   static int __get_service_fd(enum sfd_type type, int service_fd_id)
#  100|   {
#  101|-> 	return service_fd_base - type - SERVICE_FD_MAX * service_fd_id;
#  102|   }
#  103|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def723]
criu-4.2/criu/servicefd.c:106:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  104|   int get_service_fd(enum sfd_type type)
#  105|   {
#  106|-> 	BUG_ON((int)type <= SERVICE_FD_MIN || (int)type >= SERVICE_FD_MAX);
#  107|   
#  108|   	if (!test_bit(type, sfd_map))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def724]
criu-4.2/criu/servicefd.c:150:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  148|   	pr_err("Service fd %s is being modified in protected context\n", sfd_type_name(type));
#  149|   	print_stack_trace(current ? vpid(current) : 0);
#  150|-> 	BUG();
#  151|   }
#  152|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def725]
criu-4.2/criu/servicefd.c:158:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/servicefd.c:158:9: branch_true: following ‘true’ branch...
criu-4.2/criu/servicefd.c:158:9: branch_true: ...to here
criu-4.2/criu/servicefd.c:158:9: danger: dereference of NULL ‘0’
#  156|   	int tmp;
#  157|   
#  158|-> 	BUG_ON((int)type <= SERVICE_FD_MIN || (int)type >= SERVICE_FD_MAX);
#  159|   	if (sfds_protected && !test_bit(type, sfd_map))
#  160|   		sfds_protection_bug(type);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def726]
criu-4.2/criu/servicefd.c:179:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/servicefd.c:153:5: enter_function: entry to ‘install_service_fd’
criu-4.2/criu/servicefd.c:158:9: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:159:13: branch_false: ...to here
criu-4.2/criu/servicefd.c:162:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:170:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:170:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:173:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:173:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:174:12: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/servicefd.c:178:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:178:19: branch_true: following ‘true’ branch...
criu-4.2/criu/servicefd.c:179:17: call_function: inlined call to ‘sfd_type_name’ from ‘install_service_fd’
criu-4.2/criu/servicefd.c:179:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/servicefd.c:179:17: danger: ‘tmp’ leaks here; was opened at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7)
#  177|   		return -1;
#  178|   	} else if (tmp != sfd) {
#  179|-> 		pr_err("%s busy target %d -> %d\n", sfd_type_name(type), fd, sfd);
#  180|   		close(tmp);
#  181|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def727]
criu-4.2/criu/servicefd.c:180:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/servicefd.c:153:5: enter_function: entry to ‘install_service_fd’
criu-4.2/criu/servicefd.c:158:9: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:159:13: branch_false: ...to here
criu-4.2/criu/servicefd.c:162:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:170:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:170:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:173:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:173:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:174:12: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/servicefd.c:178:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:178:19: branch_true: following ‘true’ branch...
criu-4.2/criu/servicefd.c:179:17: call_function: inlined call to ‘sfd_type_name’ from ‘install_service_fd’
criu-4.2/criu/servicefd.c:180:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/servicefd.c:180:17: danger: ‘tmp’ leaks here; was opened at [(8)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/7)
#  178|   	} else if (tmp != sfd) {
#  179|   		pr_err("%s busy target %d -> %d\n", sfd_type_name(type), fd, sfd);
#  180|-> 		close(tmp);
#  181|   		close(fd);
#  182|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def728]
criu-4.2/criu/servicefd.c:186:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/servicefd.c:153:5: enter_function: entry to ‘install_service_fd’
criu-4.2/criu/servicefd.c:158:9: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:159:13: branch_false: ...to here
criu-4.2/criu/servicefd.c:162:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:170:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:170:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:173:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:173:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:174:12: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/servicefd.c:178:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:178:19: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:185:9: call_function: inlined call to ‘set_bit’ from ‘install_service_fd’
criu-4.2/criu/servicefd.c:186:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/servicefd.c:186:9: danger: ‘tmp’ leaks here; was opened at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7)
#  184|   
#  185|   	set_bit(type, sfd_map);
#  186|-> 	close(fd);
#  187|   	return sfd;
#  188|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def729]
criu-4.2/criu/servicefd.c:234:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/servicefd.c:217:12: enter_function: entry to ‘move_service_fd’
criu-4.2/criu/servicefd.c:219:19: call_function: calling ‘get_service_fd’ from ‘move_service_fd’
criu-4.2/criu/servicefd.c:219:19: return_function: returning to ‘move_service_fd’ from ‘get_service_fd’
criu-4.2/criu/servicefd.c:223:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:226:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:226:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:229:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:229:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:230:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
criu-4.2/criu/servicefd.c:233:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:233:19: branch_true: following ‘true’ branch (when ‘ret != new’)...
criu-4.2/criu/servicefd.c:234:17: call_function: inlined call to ‘sfd_type_name’ from ‘move_service_fd’
criu-4.2/criu/servicefd.c:234:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/servicefd.c:234:17: danger: ‘ret’ leaks here; was opened at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  232|   		return -1;
#  233|   	} else if (ret != new) {
#  234|-> 		pr_err("%s busy target %d -> %d\n", sfd_type_name(type), old, new);
#  235|   		return -1;
#  236|   	} else if (!(rsti(me)->clone_flags & CLONE_FILES))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def730]
criu-4.2/criu/servicefd.c:237:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/servicefd.c:217:12: enter_function: entry to ‘move_service_fd’
criu-4.2/criu/servicefd.c:219:19: call_function: calling ‘get_service_fd’ from ‘move_service_fd’
criu-4.2/criu/servicefd.c:219:19: return_function: returning to ‘move_service_fd’ from ‘get_service_fd’
criu-4.2/criu/servicefd.c:223:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:226:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:226:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:229:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:229:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:230:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
criu-4.2/criu/servicefd.c:233:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:233:19: branch_false: following ‘false’ branch (when ‘ret == new’)...
criu-4.2/criu/servicefd.c:236:22: branch_false: ...to here
criu-4.2/criu/servicefd.c:236:19: branch_true: following ‘true’ branch...
criu-4.2/criu/servicefd.c:237:17: branch_true: ...to here
criu-4.2/criu/servicefd.c:237:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/servicefd.c:237:17: danger: ‘ret’ leaks here; was opened at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
#  235|   		return -1;
#  236|   	} else if (!(rsti(me)->clone_flags & CLONE_FILES))
#  237|-> 		close(old);
#  238|   
#  239|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def731]
criu-4.2/criu/servicefd.c:240:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/servicefd.c:217:12: enter_function: entry to ‘move_service_fd’
criu-4.2/criu/servicefd.c:219:19: call_function: calling ‘get_service_fd’ from ‘move_service_fd’
criu-4.2/criu/servicefd.c:219:19: return_function: returning to ‘move_service_fd’ from ‘get_service_fd’
criu-4.2/criu/servicefd.c:223:12: branch_false: following ‘false’ branch...
criu-4.2/criu/servicefd.c:226:14: branch_false: ...to here
criu-4.2/criu/servicefd.c:226:12: branch_true: following ‘true’ branch (when ‘oldbit != 0’)...
criu-4.2/criu/servicefd.c:229:23: branch_true: ...to here
criu-4.2/criu/servicefd.c:229:23: acquire_resource: opened here
criu-4.2/criu/servicefd.c:230:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
criu-4.2/criu/servicefd.c:233:19: branch_false: ...to here
criu-4.2/criu/servicefd.c:240:1: danger: ‘ret’ leaks here; was opened at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
#  238|   
#  239|   	return 0;
#  240|-> }
#  241|   
#  242|   static int choose_service_fd_base(struct pstree_item *me)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def732]
criu-4.2/criu/shmem.c:201:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/shmem.c:659:5: enter_function: entry to ‘add_shmem_area’
criu-4.2/criu/shmem.c:667:14: call_function: calling ‘shmem_find’ from ‘add_shmem_area’
criu-4.2/criu/shmem.c:667:14: return_function: returning to ‘add_shmem_area’ from ‘shmem_find’
criu-4.2/criu/shmem.c:668:12: branch_true: following ‘true’ branch...
criu-4.2/criu/shmem.c:669:21: branch_true: ...to here
criu-4.2/criu/shmem.c:669:20: branch_true: following ‘true’ branch...
criu-4.2/criu/shmem.c:670:29: branch_true: ...to here
criu-4.2/criu/shmem.c:670:29: call_function: calling ‘expand_shmem’ from ‘add_shmem_area’
#  199|   	new_map_size = nr_new_map_items * sizeof(*si->pstate_map);
#  200|   
#  201|-> 	BUG_ON(new_map_size < map_size);
#  202|   
#  203|   	if (xrealloc_safe(&si->pstate_map, new_map_size))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def733]
criu-4.2/criu/shmem.c:569:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘f’
criu-4.2/criu/shmem.c:557:12: enter_function: entry to ‘open_shmem’
criu-4.2/criu/shmem.c:565:14: call_function: calling ‘shmem_find’ from ‘open_shmem’
criu-4.2/criu/shmem.c:565:14: return_function: returning to ‘open_shmem’ from ‘shmem_find’
criu-4.2/criu/shmem.c:567:12: branch_false: following ‘false’ branch...
criu-4.2/criu/shmem.c:572:9: branch_false: ...to here
criu-4.2/criu/shmem.c:572:9: branch_false: following ‘false’ branch...
criu-4.2/criu/shmem.c:574:12: branch_false: ...to here
criu-4.2/criu/shmem.c:574:12: branch_false: following ‘false’ branch...
criu-4.2/criu/shmem.c:577:13: branch_false: ...to here
criu-4.2/criu/shmem.c:577:12: branch_true: following ‘true’ branch...
criu-4.2/criu/shmem.c:578:21: branch_true: ...to here
criu-4.2/criu/shmem.c:578:21: acquire_resource: opened here
criu-4.2/criu/shmem.c:579:20: branch_false: following ‘false’ branch...
criu-4.2/criu/shmem.c:584:17: branch_false: ...to here
criu-4.2/criu/shmem.c:569:24: danger: ‘f’ leaks here; was opened at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  567|   	if (!si) {
#  568|   		pr_err("Can't find my shmem %#016" PRIx64 "\n", vi->start);
#  569|-> 		return -1;
#  570|   	}
#  571|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def734]
criu-4.2/criu/shmem.c:572:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/shmem.c:557:12: enter_function: entry to ‘open_shmem’
criu-4.2/criu/shmem.c:565:14: call_function: calling ‘shmem_find’ from ‘open_shmem’
criu-4.2/criu/shmem.c:565:14: return_function: returning to ‘open_shmem’ from ‘shmem_find’
criu-4.2/criu/shmem.c:567:12: branch_false: following ‘false’ branch...
criu-4.2/criu/shmem.c:572:9: branch_false: ...to here
criu-4.2/criu/shmem.c:572:9: branch_true: following ‘true’ branch...
criu-4.2/criu/shmem.c:572:9: branch_true: ...to here
criu-4.2/criu/shmem.c:572:9: danger: dereference of NULL ‘0’
#  570|   	}
#  571|   
#  572|-> 	BUG_ON(si->pid == SYSVIPC_SHMEM_PID);
#  573|   
#  574|   	if (si->pid != pid)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def735]
criu-4.2/criu/sigact.c:196:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sigact.c:196:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sigact.c:196:9: branch_true: ...to here
criu-4.2/criu/sigact.c:196:9: danger: dereference of NULL ‘0’
#  194|   	int ret = 0;
#  195|   
#  196|-> 	BUG_ON(sig == SIGKILL || sig == SIGSTOP);
#  197|   
#  198|   	ret = pb_read_one_eof(img, &e, PB_SIGACT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def736]
criu-4.2/criu/sk-inet.c:148:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-inet.c:148:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:148:9: branch_true: ...to here
criu-4.2/criu/sk-inet.c:148:9: danger: dereference of NULL ‘0’
#  146|   static int can_dump_inet_sk(const struct inet_sk_desc *sk)
#  147|   {
#  148|-> 	BUG_ON((sk->sd.family != AF_INET) && (sk->sd.family != AF_INET6));
#  149|   
#  150|   	if (sk->type == SOCK_DGRAM) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def737]
criu-4.2/criu/sk-inet.c:238:13: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:254:29: enter_function: entry to ‘gen_uncon_sk’
criu-4.2/criu/sk-inet.c:262:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:268:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:286:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:286:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:293:15: branch_false: ...to here
criu-4.2/criu/sk-inet.c:294:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:295:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:295:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:302:22: branch_false: ...to here
criu-4.2/criu/sk-inet.c:304:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:314:17: branch_true: ...to here
criu-4.2/criu/sk-inet.c:316:20: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/criu/sk-inet.c:321:21: branch_false: ...to here
criu-4.2/criu/sk-inet.c:321:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:326:29: branch_false: ...to here
criu-4.2/criu/sk-inet.c:328:21: call_function: calling ‘dump_tcp_uncon_shutdown’ from ‘gen_uncon_sk’
#  236|   	struct pollfd pfd = { .fd = lfd, .events = POLLRDHUP | POLLHUP };
#  237|   
#  238|-> 	if (poll(&pfd, 1, 0) != 1) {
#  239|   		pr_perror("Unable to poll the socket");
#  240|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def738]
criu-4.2/criu/sk-inet.c:239:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:254:29: enter_function: entry to ‘gen_uncon_sk’
criu-4.2/criu/sk-inet.c:262:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:268:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:286:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:286:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:293:15: branch_false: ...to here
criu-4.2/criu/sk-inet.c:294:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:295:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:295:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:302:22: branch_false: ...to here
criu-4.2/criu/sk-inet.c:304:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:314:17: branch_true: ...to here
criu-4.2/criu/sk-inet.c:316:20: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/criu/sk-inet.c:321:21: branch_false: ...to here
criu-4.2/criu/sk-inet.c:321:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:326:29: branch_false: ...to here
criu-4.2/criu/sk-inet.c:328:21: call_function: calling ‘dump_tcp_uncon_shutdown’ from ‘gen_uncon_sk’
#  237|   
#  238|   	if (poll(&pfd, 1, 0) != 1) {
#  239|-> 		pr_perror("Unable to poll the socket");
#  240|   		return -1;
#  241|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def739]
criu-4.2/criu/sk-inet.c:280:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:275:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:277:17: branch_false: ...to here
criu-4.2/criu/sk-inet.c:277:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:280:17: branch_false: ...to here
criu-4.2/criu/sk-inet.c:280:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:280:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  278|   		aux = sizeof(struct sockaddr_in6);
#  279|   	else {
#  280|-> 		pr_err("Unsupported socket family: %d\n", sk->sd.family);
#  281|   		goto err;
#  282|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def740]
criu-4.2/criu/sk-inet.c:287:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:286:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:286:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:287:25: branch_true: ...to here
criu-4.2/criu/sk-inet.c:287:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:287:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  285|   	if (ret < 0) {
#  286|   		if (errno != ENOTCONN) {
#  287|-> 			pr_perror("Unexpected error returned from unconnected socket");
#  288|   			goto err;
#  289|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def741]
criu-4.2/criu/sk-inet.c:296:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:254:29: enter_function: entry to ‘gen_uncon_sk’
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/sk-inet.c:290:20: call_function: inlined call to ‘dump_sockaddr’ from ‘gen_uncon_sk’
criu-4.2/criu/sk-inet.c:294:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:295:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:295:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:296:25: branch_true: ...to here
criu-4.2/criu/sk-inet.c:296:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:296:25: danger: ‘___p’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
#  294|   	if (ret < 0) {
#  295|   		if (errno != ENOTCONN) {
#  296|-> 			pr_perror("Unexpected error returned from unconnected socket");
#  297|   			goto err;
#  298|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def742]
criu-4.2/criu/sk-inet.c:317:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:286:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:286:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:293:15: branch_false: ...to here
criu-4.2/criu/sk-inet.c:294:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:295:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:295:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:302:22: branch_false: ...to here
criu-4.2/criu/sk-inet.c:304:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:314:17: branch_true: ...to here
criu-4.2/criu/sk-inet.c:316:20: branch_true: following ‘true’ branch (when ‘ret != 0’)...
criu-4.2/criu/sk-inet.c:317:25: branch_true: ...to here
criu-4.2/criu/sk-inet.c:317:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:317:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  315|   		ret = getsockopt(lfd, SOL_TCP, TCP_INFO, &info, &aux);
#  316|   		if (ret) {
#  317|-> 			pr_perror("Failed to obtain TCP_INFO");
#  318|   			goto err;
#  319|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def743]
criu-4.2/criu/sk-inet.c:322:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:286:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:286:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:293:15: branch_false: ...to here
criu-4.2/criu/sk-inet.c:294:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:295:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:295:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:302:22: branch_false: ...to here
criu-4.2/criu/sk-inet.c:304:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:314:17: branch_true: ...to here
criu-4.2/criu/sk-inet.c:316:20: branch_false: following ‘false’ branch (when ‘ret == 0’)...
criu-4.2/criu/sk-inet.c:321:21: branch_false: ...to here
criu-4.2/criu/sk-inet.c:321:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:322:25: branch_true: ...to here
criu-4.2/criu/sk-inet.c:322:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:322:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  320|   
#  321|   		if (info.tcpi_state != TCP_CLOSE) {
#  322|-> 			pr_err("Socket state %d obtained but expected %d\n", info.tcpi_state, TCP_CLOSE);
#  323|   			goto err;
#  324|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def744]
criu-4.2/criu/sk-inet.c:334:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:268:14: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:268:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:272:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:285:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:286:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:286:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:293:15: branch_false: ...to here
criu-4.2/criu/sk-inet.c:294:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/sk-inet.c:295:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:295:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:302:22: branch_false: ...to here
criu-4.2/criu/sk-inet.c:304:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:332:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:334:9: throw: if ‘sk_collect_one’ throws an exception...
criu-4.2/criu/sk-inet.c:334:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  332|   	sk->state = TCP_CLOSE;
#  333|   
#  334|-> 	sk_collect_one(sk->sd.ino, sk->sd.family, &sk->sd, ns);
#  335|   
#  336|   	return sk;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def745]
criu-4.2/criu/sk-inet.c:683:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:669:13: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:669:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:673:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:682:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:683:31: branch_true: ...to here
criu-4.2/criu/sk-inet.c:683:31: throw: if ‘nla_get_u8’ throws an exception...
criu-4.2/criu/sk-inet.c:683:31: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  681|   
#  682|   	if (tb[INET_DIAG_SHUTDOWN])
#  683|-> 		d->shutdown = nla_get_u8(tb[INET_DIAG_SHUTDOWN]);
#  684|   	else
#  685|   		pr_err_once("Can't check shutdown state of inet socket\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def746]
criu-4.2/criu/sk-inet.c:685:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:669:13: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:669:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:673:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:682:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:685:17: branch_false: ...to here
criu-4.2/criu/sk-inet.c:685:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:685:17: branch_false: ...to here
criu-4.2/criu/sk-inet.c:685:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:685:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  683|   		d->shutdown = nla_get_u8(tb[INET_DIAG_SHUTDOWN]);
#  684|   	else
#  685|-> 		pr_err_once("Can't check shutdown state of inet socket\n");
#  686|   
#  687|   	ret = sk_collect_one(m->idiag_inode, family, &d->sd, ns);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def747]
criu-4.2/criu/sk-inet.c:687:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-inet.c:669:13: acquire_memory: allocated here
criu-4.2/criu/sk-inet.c:669:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-inet.c:673:9: branch_false: ...to here
criu-4.2/criu/sk-inet.c:682:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:685:17: branch_false: ...to here
criu-4.2/criu/sk-inet.c:687:15: throw: if ‘sk_collect_one’ throws an exception...
criu-4.2/criu/sk-inet.c:687:15: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  685|   		pr_err_once("Can't check shutdown state of inet socket\n");
#  686|   
#  687|-> 	ret = sk_collect_one(m->idiag_inode, family, &d->sd, ns);
#  688|   
#  689|   	show_one_inet("Collected", d);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def748]
criu-4.2/criu/sk-inet.c:758:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:853:12: enter_function: entry to ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:896:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:905:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:907:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:907:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:910:13: call_function: inlined call to ‘tcp_connection’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:926:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:936:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:937:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:937:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:942:29: branch_false: ...to here
criu-4.2/criu/sk-inet.c:943:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:948:31: branch_false: ...to here
criu-4.2/criu/sk-inet.c:948:17: call_function: calling ‘mutex_unlock’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:948:17: return_function: returning to ‘open_inet_sk’ from ‘mutex_unlock’
criu-4.2/criu/sk-inet.c:951:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:953:1: branch_false: ...to here
criu-4.2/criu/sk-inet.c:954:9: call_function: calling ‘dec_users_and_wake’ from ‘open_inet_sk’
#  756|   		return;
#  757|   	list_for_each_entry(ii, &port->type_list, port_list) {
#  758|-> 		fle = file_master(&ii->d);
#  759|   		set_fds_event(fle->pid);
#  760|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def749]
criu-4.2/criu/sk-inet.c:759:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:853:12: enter_function: entry to ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:896:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:905:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:907:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:907:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:910:13: call_function: inlined call to ‘tcp_connection’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:926:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:936:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:937:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:937:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:942:29: branch_false: ...to here
criu-4.2/criu/sk-inet.c:943:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:948:31: branch_false: ...to here
criu-4.2/criu/sk-inet.c:948:17: call_function: calling ‘mutex_unlock’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:948:17: return_function: returning to ‘open_inet_sk’ from ‘mutex_unlock’
criu-4.2/criu/sk-inet.c:951:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:953:1: branch_false: ...to here
criu-4.2/criu/sk-inet.c:954:9: call_function: calling ‘dec_users_and_wake’ from ‘open_inet_sk’
#  757|   	list_for_each_entry(ii, &port->type_list, port_list) {
#  758|   		fle = file_master(&ii->d);
#  759|-> 		set_fds_event(fle->pid);
#  760|   	}
#  761|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def750]
criu-4.2/criu/sk-inet.c:776:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-inet.c:763:12: enter_function: entry to ‘post_open_inet_sk’
criu-4.2/criu/sk-inet.c:776:17: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:776:17: branch_true: ...to here
criu-4.2/criu/sk-inet.c:776:17: danger: dereference of NULL ‘0’
#  774|   	if (tcp_connection(ii->ie)) {
#  775|   		pr_debug("Schedule %d socket for repair off\n", sk);
#  776|-> 		BUG_ON(ii->sk_fd != -1);
#  777|   		ii->sk_fd = sk;
#  778|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def751]
criu-4.2/criu/sk-inet.c:893:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:13: throw: if ‘reset_setsockcreatecon’ throws an exception...
criu-4.2/criu/sk-inet.c:893:13: danger: ‘sk’ leaks here
#  891|   	}
#  892|   
#  893|-> 	if (reset_setsockcreatecon())
#  894|   		goto err;
#  895|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def752]
criu-4.2/criu/sk-inet.c:897:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:896:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:896:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:897:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:897:21: throw: if ‘do_restore_opt’ throws an exception...
criu-4.2/criu/sk-inet.c:897:21: danger: ‘sk’ leaks here
#  895|   
#  896|   	if (ie->v6only) {
#  897|-> 		if (restore_opt(sk, SOL_IPV6, IPV6_V6ONLY, &yes) == -1)
#  898|   			goto err;
#  899|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def753]
criu-4.2/criu/sk-inet.c:905:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:896:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:896:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:905:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:905:13: throw: if ‘do_restore_opt’ throws an exception...
criu-4.2/criu/sk-inet.c:905:13: danger: ‘sk’ leaks here
#  903|   	 * The origin value of SO_REUSEADDR will be restored in post_open.
#  904|   	 */
#  905|-> 	if (restore_opt(sk, SOL_SOCKET, SO_REUSEADDR, &yes))
#  906|   		goto err;
#  907|   	if (restore_opt(sk, SOL_SOCKET, SO_REUSEPORT, &yes))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def754]
criu-4.2/criu/sk-inet.c:944:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:853:12: enter_function: entry to ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:896:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:905:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:907:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:907:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:910:13: call_function: inlined call to ‘tcp_connection’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:926:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:936:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:937:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:937:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:942:29: branch_false: ...to here
criu-4.2/criu/sk-inet.c:943:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:944:25: branch_true: ...to here
criu-4.2/criu/sk-inet.c:944:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-inet.c:944:25: danger: ‘sk’ leaks here
#  942|   		mutex_lock(&ii->port->reuseaddr_lock);
#  943|   		if (listen(sk, ie->backlog) == -1) {
#  944|-> 			pr_perror("Can't listen on a socket");
#  945|   			mutex_unlock(&ii->port->reuseaddr_lock);
#  946|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def755]
criu-4.2/criu/sk-inet.c:956:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:853:12: enter_function: entry to ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:896:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:905:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:907:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:907:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:910:13: call_function: inlined call to ‘tcp_connection’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:926:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:936:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:937:21: branch_true: ...to here
criu-4.2/criu/sk-inet.c:937:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:942:29: branch_false: ...to here
criu-4.2/criu/sk-inet.c:943:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:948:31: branch_false: ...to here
criu-4.2/criu/sk-inet.c:948:17: call_function: calling ‘mutex_unlock’ from ‘open_inet_sk’
criu-4.2/criu/sk-inet.c:948:17: return_function: returning to ‘open_inet_sk’ from ‘mutex_unlock’
criu-4.2/criu/sk-inet.c:951:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:953:1: branch_false: ...to here
criu-4.2/criu/sk-inet.c:956:13: throw: if ‘rst_file_params’ throws an exception...
criu-4.2/criu/sk-inet.c:956:13: danger: ‘sk’ leaks here
#  954|   	dec_users_and_wake(ii->port);
#  955|   
#  956|-> 	if (rst_file_params(sk, ie->fown, ie->flags))
#  957|   		goto err;
#  958|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def756]
criu-4.2/criu/sk-inet.c:986:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-inet.c:860:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:863:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:868:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:873:14: branch_false: ...to here
criu-4.2/criu/sk-inet.c:873:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:878:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:881:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:881:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:884:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:884:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-inet.c:887:43: branch_false: ...to here
criu-4.2/criu/sk-inet.c:887:14: acquire_resource: socket created here
criu-4.2/criu/sk-inet.c:888:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-inet.c:893:13: branch_false: ...to here
criu-4.2/criu/sk-inet.c:893:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-inet.c:894:17: branch_true: ...to here
criu-4.2/criu/sk-inet.c:986:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/sk-inet.c:986:9: danger: ‘sk’ leaks here
#  984|   	return 1;
#  985|   err:
#  986|-> 	close(sk);
#  987|   	return -1;
#  988|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def757]
criu-4.2/criu/sk-inet.c:1017:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1015|   	}
# 1016|   
# 1017|-> 	BUG();
# 1018|   	return -1;
# 1019|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def758]
criu-4.2/criu/sk-netlink.c:51:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-netlink.c:41:14: acquire_memory: allocated here
criu-4.2/criu/sk-netlink.c:41:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-netlink.c:45:24: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:51:9: throw: if ‘nlmsg_parse’ throws an exception...
criu-4.2/criu/sk-netlink.c:51:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   49|   	sd->state = m->ndiag_state;
#   50|   
#   51|-> 	nlmsg_parse(hdr, sizeof(struct netlink_diag_msg), tb, NETLINK_DIAG_MAX, NULL);
#   52|   
#   53|   	if (tb[NETLINK_DIAG_GROUPS]) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def759]
criu-4.2/criu/sk-netlink.c:54:29: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-netlink.c:41:14: acquire_memory: allocated here
criu-4.2/criu/sk-netlink.c:41:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-netlink.c:45:24: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:53:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:54:29: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:54:29: throw: if ‘nla_len’ throws an exception...
criu-4.2/criu/sk-netlink.c:54:29: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   52|   
#   53|   	if (tb[NETLINK_DIAG_GROUPS]) {
#   54|-> 		sd->gsize = nla_len(tb[NETLINK_DIAG_GROUPS]);
#   55|   		groups = nla_data(tb[NETLINK_DIAG_GROUPS]);
#   56|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def760]
criu-4.2/criu/sk-netlink.c:55:26: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-netlink.c:41:14: acquire_memory: allocated here
criu-4.2/criu/sk-netlink.c:41:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-netlink.c:45:24: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:53:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:54:29: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:55:26: throw: if ‘nla_data’ throws an exception...
criu-4.2/criu/sk-netlink.c:55:26: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   53|   	if (tb[NETLINK_DIAG_GROUPS]) {
#   54|   		sd->gsize = nla_len(tb[NETLINK_DIAG_GROUPS]);
#   55|-> 		groups = nla_data(tb[NETLINK_DIAG_GROUPS]);
#   56|   
#   57|   		sd->groups = xmalloc(sd->gsize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def761]
criu-4.2/criu/sk-netlink.c:57:30: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-netlink.c:41:14: acquire_memory: allocated here
criu-4.2/criu/sk-netlink.c:41:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-netlink.c:45:24: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:53:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:54:29: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:57:30: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-netlink.c:57:30: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:57:30: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-netlink.c:57:30: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   55|   		groups = nla_data(tb[NETLINK_DIAG_GROUPS]);
#   56|   
#   57|-> 		sd->groups = xmalloc(sd->gsize);
#   58|   		if (!sd->groups) {
#   59|   			xfree(sd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def762]
criu-4.2/criu/sk-netlink.c:68:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-netlink.c:41:14: acquire_memory: allocated here
criu-4.2/criu/sk-netlink.c:41:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-netlink.c:45:24: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:53:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:64:17: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:68:16: throw: if ‘sk_collect_one’ throws an exception...
criu-4.2/criu/sk-netlink.c:68:16: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#   66|   	}
#   67|   
#   68|-> 	return sk_collect_one(m->ndiag_ino, PF_NETLINK, &sd->sd, ns);
#   69|   }
#   70|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def763]
criu-4.2/criu/sk-netlink.c:100:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-netlink.c:90:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:93:9: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:96:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:99:12: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:99:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:100:17: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:100:17: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:100:17: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:100:17: danger: dereference of NULL ‘0’
#   98|   
#   99|   	if (sk) {
#  100|-> 		BUG_ON(sk->sd.already_dumped);
#  101|   
#  102|   		ne.ns_id = sk->sd.sk_ns->id;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def764]
criu-4.2/criu/sk-netlink.c:218:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-netlink.c:205:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:208:43: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:208:14: acquire_resource: socket created here
criu-4.2/criu/sk-netlink.c:209:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-netlink.c:214:13: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:214:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:215:17: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:217:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:218:25: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:218:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-netlink.c:218:25: danger: ‘sk’ leaks here
#  216|   		addr.nl_family = AF_NETLINK;
#  217|   		if (nse->n_groups > 1) {
#  218|-> 			pr_err("Groups above 32 are not supported yet\n");
#  219|   			goto err;
#  220|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def765]
criu-4.2/criu/sk-netlink.c:244:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-netlink.c:205:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:208:43: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:208:14: acquire_resource: socket created here
criu-4.2/criu/sk-netlink.c:209:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-netlink.c:214:13: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:214:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:240:13: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:240:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:241:17: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:244:21: throw: if ‘connect’ throws an exception...
criu-4.2/criu/sk-netlink.c:244:21: danger: ‘sk’ leaks here
#  242|   		addr.nl_groups = 1 << (nse->dst_group - 1);
#  243|   		addr.nl_pid = nse->dst_portid;
#  244|-> 		if (connect(sk, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
#  245|   			pr_perror("Can't connect netlink socket");
#  246|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def766]
criu-4.2/criu/sk-netlink.c:250:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-netlink.c:205:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:208:43: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:208:14: acquire_resource: socket created here
criu-4.2/criu/sk-netlink.c:209:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-netlink.c:214:13: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:214:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:240:13: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:240:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:250:44: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:250:13: throw: if ‘rst_file_params’ throws an exception...
criu-4.2/criu/sk-netlink.c:250:13: danger: ‘sk’ leaks here
#  248|   	}
#  249|   
#  250|-> 	if (rst_file_params(sk, nse->fown, nse->flags))
#  251|   		goto err;
#  252|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def767]
criu-4.2/criu/sk-netlink.c:259:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-netlink.c:205:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-netlink.c:208:43: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:208:14: acquire_resource: socket created here
criu-4.2/criu/sk-netlink.c:209:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-netlink.c:214:13: branch_false: ...to here
criu-4.2/criu/sk-netlink.c:214:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:215:17: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:217:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-netlink.c:218:25: branch_true: ...to here
criu-4.2/criu/sk-netlink.c:259:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/sk-netlink.c:259:9: danger: ‘sk’ leaks here
#  257|   	return 0;
#  258|   err:
#  259|-> 	close(sk);
#  260|   	return -1;
#  261|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def768]
criu-4.2/criu/sk-packet.c:71:25: warning[-Wanalyzer-malloc-leak]: leak of ‘psk.mclist’
criu-4.2/criu/sk-packet.c:150:12: enter_function: entry to ‘dump_one_packet_fd’
criu-4.2/criu/sk-packet.c:165:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:166:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:179:24: branch_false: ...to here
criu-4.2/criu/sk-packet.c:190:15: call_function: calling ‘dump_mreqs’ from ‘dump_one_packet_fd’
#   69|   
#   70|   		if (m->pdmc_count != 1) {
#   71|-> 			pr_err("Multiple MC membership not supported (but can be)\n");
#   72|   			goto err;
#   73|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def769]
criu-4.2/criu/sk-packet.c:75:17: warning[-Wanalyzer-malloc-leak]: leak of ‘psk.mclist’
criu-4.2/criu/sk-packet.c:150:12: enter_function: entry to ‘dump_one_packet_fd’
criu-4.2/criu/sk-packet.c:165:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:166:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:179:24: branch_false: ...to here
criu-4.2/criu/sk-packet.c:190:15: call_function: calling ‘dump_mreqs’ from ‘dump_one_packet_fd’
#   73|   		}
#   74|   
#   75|-> 		pr_debug("\tmr%d: idx %d type %d\n", i, m->pdmc_index, m->pdmc_type);
#   76|   
#   77|   		im = xmalloc(sizeof(*im));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def770]
criu-4.2/criu/sk-packet.c:77:22: warning[-Wanalyzer-malloc-leak]: leak of ‘psk.mclist’
criu-4.2/criu/sk-packet.c:150:12: enter_function: entry to ‘dump_one_packet_fd’
criu-4.2/criu/sk-packet.c:165:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:166:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:179:24: branch_false: ...to here
criu-4.2/criu/sk-packet.c:190:15: call_function: calling ‘dump_mreqs’ from ‘dump_one_packet_fd’
#   75|   		pr_debug("\tmr%d: idx %d type %d\n", i, m->pdmc_index, m->pdmc_type);
#   76|   
#   77|-> 		im = xmalloc(sizeof(*im));
#   78|   		if (!im)
#   79|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def771]
criu-4.2/criu/sk-packet.c:81:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:58:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:61:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:62:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:62:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:63:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:63:12: branch_false: ...to here
criu-4.2/criu/sk-packet.c:66:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:67:49: branch_true: ...to here
criu-4.2/criu/sk-packet.c:70:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:75:17: branch_false: ...to here
criu-4.2/criu/sk-packet.c:77:22: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:77:22: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:81:17: branch_false: ...to here
criu-4.2/criu/sk-packet.c:81:17: throw: if ‘packet_mclist__init’ throws an exception...
criu-4.2/criu/sk-packet.c:81:17: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
#   79|   			goto err;
#   80|   
#   81|-> 		packet_mclist__init(im);
#   82|   		psk->mclist[i] = im;
#   83|   		psk->n_mclist++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def772]
criu-4.2/criu/sk-packet.c:81:17: warning[-Wanalyzer-malloc-leak]: leak of ‘psk.mclist’
criu-4.2/criu/sk-packet.c:150:12: enter_function: entry to ‘dump_one_packet_fd’
criu-4.2/criu/sk-packet.c:165:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:166:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:179:24: branch_false: ...to here
criu-4.2/criu/sk-packet.c:190:15: call_function: calling ‘dump_mreqs’ from ‘dump_one_packet_fd’
#   79|   			goto err;
#   80|   
#   81|-> 		packet_mclist__init(im);
#   82|   		psk->mclist[i] = im;
#   83|   		psk->n_mclist++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def773]
criu-4.2/criu/sk-packet.c:92:41: warning[-Wanalyzer-malloc-leak]: leak of ‘psk.mclist’
criu-4.2/criu/sk-packet.c:150:12: enter_function: entry to ‘dump_one_packet_fd’
criu-4.2/criu/sk-packet.c:165:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:166:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:179:24: branch_false: ...to here
criu-4.2/criu/sk-packet.c:190:15: call_function: calling ‘dump_mreqs’ from ‘dump_one_packet_fd’
#   90|   		case PACKET_MR_UNICAST:
#   91|   			im->addr.len = m->pdmc_alen;
#   92|-> 			im->addr.data = xmalloc(m->pdmc_alen);
#   93|   			if (!im->addr.data)
#   94|   				goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def774]
criu-4.2/criu/sk-packet.c:120:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:116:16: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:116:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:120:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:120:9: throw: if ‘packet_ring__init’ throws an exception...
criu-4.2/criu/sk-packet.c:120:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  118|   		return NULL;
#  119|   
#  120|-> 	packet_ring__init(ring);
#  121|   
#  122|   	ring->block_size = dr->pdr_block_size;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def775]
criu-4.2/criu/sk-packet.c:165:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-packet.c:150:12: enter_function: entry to ‘dump_one_packet_fd’
criu-4.2/criu/sk-packet.c:165:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:165:9: branch_true: ...to here
criu-4.2/criu/sk-packet.c:165:9: danger: dereference of NULL ‘0’
#  163|   
#  164|   	pr_info("Dumping packet socket fd %d id %#x\n", lfd, id);
#  165|-> 	BUG_ON(sd->sd.already_dumped);
#  166|   	sd->sd.already_dumped = 1;
#  167|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def776]
criu-4.2/criu/sk-packet.c:245:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  243|   static int packet_save_mreqs(struct packet_sock_desc *sd, struct nlattr *mc)
#  244|   {
#  245|-> 	sd->mreq_n = nla_len(mc) / sizeof(struct packet_diag_mclist);
#  246|   	pr_debug("\tGot %d mreqs\n", sd->mreq_n);
#  247|   	sd->mreqs = xmalloc(nla_len(mc));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def777]
criu-4.2/criu/sk-packet.c:246:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  244|   {
#  245|   	sd->mreq_n = nla_len(mc) / sizeof(struct packet_diag_mclist);
#  246|-> 	pr_debug("\tGot %d mreqs\n", sd->mreq_n);
#  247|   	sd->mreqs = xmalloc(nla_len(mc));
#  248|   	if (!sd->mreqs)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def778]
criu-4.2/criu/sk-packet.c:247:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  245|   	sd->mreq_n = nla_len(mc) / sizeof(struct packet_diag_mclist);
#  246|   	pr_debug("\tGot %d mreqs\n", sd->mreq_n);
#  247|-> 	sd->mreqs = xmalloc(nla_len(mc));
#  248|   	if (!sd->mreqs)
#  249|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def779]
criu-4.2/criu/sk-packet.c:251:27: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  249|   		return -1;
#  250|   
#  251|-> 	memcpy(sd->mreqs, nla_data(mc), nla_len(mc));
#  252|   	return 0;
#  253|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def780]
criu-4.2/criu/sk-packet.c:251:27: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  249|   		return -1;
#  250|   
#  251|-> 	memcpy(sd->mreqs, nla_data(mc), nla_len(mc));
#  252|   	return 0;
#  253|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def781]
criu-4.2/criu/sk-packet.c:251:41: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  249|   		return -1;
#  250|   
#  251|-> 	memcpy(sd->mreqs, nla_data(mc), nla_len(mc));
#  252|   	return 0;
#  253|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def782]
criu-4.2/criu/sk-packet.c:251:41: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
#  249|   		return -1;
#  250|   
#  251|-> 	memcpy(sd->mreqs, nla_data(mc), nla_len(mc));
#  252|   	return 0;
#  253|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def783]
criu-4.2/criu/sk-packet.c:284:26: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:284:26: throw: if ‘nla_data’ throws an exception...
criu-4.2/criu/sk-packet.c:284:26: danger: ‘___p’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  282|   	sd->rx = NULL;
#  283|   	sd->tx = NULL;
#  284|-> 	memcpy(&sd->nli, nla_data(tb[PACKET_DIAG_INFO]), sizeof(sd->nli));
#  285|   
#  286|   	if (packet_save_mreqs(sd, tb[PACKET_DIAG_MCLIST]))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def784]
criu-4.2/criu/sk-packet.c:295:26: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:295:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:295:26: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-packet.c:295:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:295:26: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-packet.c:295:26: danger: ‘<unknown>’ leaks here; was allocated at [(10)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/9)
#  293|   
#  294|   	if (tb[PACKET_DIAG_RX_RING]) {
#  295|-> 		sd->rx = xmalloc(sizeof(*sd->rx));
#  296|   		if (sd->rx == NULL)
#  297|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def785]
criu-4.2/criu/sk-packet.c:295:26: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:295:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:295:26: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-packet.c:295:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:295:26: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-packet.c:295:26: danger: ‘___p’ leaks here; was allocated at [(6)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/5)
#  293|   
#  294|   	if (tb[PACKET_DIAG_RX_RING]) {
#  295|-> 		sd->rx = xmalloc(sizeof(*sd->rx));
#  296|   		if (sd->rx == NULL)
#  297|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def786]
criu-4.2/criu/sk-packet.c:302:26: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:301:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:301:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:302:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:302:26: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-packet.c:302:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:302:26: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-packet.c:302:26: danger: ‘<unknown>’ leaks here; was allocated at [(10)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/9)
#  300|   
#  301|   	if (tb[PACKET_DIAG_TX_RING]) {
#  302|-> 		sd->tx = xmalloc(sizeof(*sd->tx));
#  303|   		if (sd->tx == NULL)
#  304|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def787]
criu-4.2/criu/sk-packet.c:302:26: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:301:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:301:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:302:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:302:26: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-packet.c:302:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:302:26: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-packet.c:302:26: danger: ‘___p’ leaks here; was allocated at [(6)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/5)
#  300|   
#  301|   	if (tb[PACKET_DIAG_TX_RING]) {
#  302|-> 		sd->tx = xmalloc(sizeof(*sd->tx));
#  303|   		if (sd->tx == NULL)
#  304|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def788]
criu-4.2/criu/sk-packet.c:308:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:301:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:301:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:308:16: branch_false: ...to here
criu-4.2/criu/sk-packet.c:308:16: throw: if ‘sk_collect_one’ throws an exception...
criu-4.2/criu/sk-packet.c:308:16: danger: ‘<unknown>’ leaks here; was allocated at [(10)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/9)
#  306|   	}
#  307|   
#  308|-> 	return sk_collect_one(m->pdiag_ino, PF_PACKET, &sd->sd, ns);
#  309|   err:
#  310|   	xfree(sd->tx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def789]
criu-4.2/criu/sk-packet.c:308:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: acquire_memory: allocated here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:301:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:301:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:308:16: branch_false: ...to here
criu-4.2/criu/sk-packet.c:308:16: throw: if ‘sk_collect_one’ throws an exception...
criu-4.2/criu/sk-packet.c:308:16: danger: ‘___p’ leaks here; was allocated at [(6)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/5)
#  306|   	}
#  307|   
#  308|-> 	return sk_collect_one(m->pdiag_ino, PF_PACKET, &sd->sd, ns);
#  309|   err:
#  310|   	xfree(sd->tx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def790]
criu-4.2/criu/sk-packet.c:312:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.2/criu/sk-packet.c:255:5: enter_function: entry to ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:265:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:270:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:275:14: branch_false: ...to here
criu-4.2/criu/sk-packet.c:275:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-packet.c:279:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:286:13: call_function: calling ‘packet_save_mreqs’ from ‘packet_receive_one’
criu-4.2/criu/sk-packet.c:286:13: return_function: returning to ‘packet_receive_one’ from ‘packet_save_mreqs’
criu-4.2/criu/sk-packet.c:286:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:289:13: branch_false: ...to here
criu-4.2/criu/sk-packet.c:294:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:295:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:295:26: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-packet.c:295:26: branch_true: ...to here
criu-4.2/criu/sk-packet.c:296:20: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sk-packet.c:297:25: branch_true: ...to here
criu-4.2/criu/sk-packet.c:312:9: danger: ‘<unknown>’ leaks here; was allocated at [(10)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/9)
#  310|   	xfree(sd->tx);
#  311|   	xfree(sd->rx);
#  312|-> 	xfree(sd);
#  313|   	return -1;
#  314|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def791]
criu-4.2/criu/sk-packet.c:349:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/sk-packet.c:324:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:329:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:329:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-packet.c:330:21: branch_true: ...to here
criu-4.2/criu/sk-packet.c:337:30: acquire_resource: opened here
criu-4.2/criu/sk-packet.c:338:28: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
criu-4.2/criu/sk-packet.c:343:25: branch_false: ...to here
criu-4.2/criu/sk-packet.c:349:1: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/4)
#  347|   	pr_err("No open packet socket %x by %d\n", (int)vma->shmid, pid);
#  348|   	return -1;
#  349|-> }
#  350|   
#  351|   int collect_socket_map(struct vma_area *vma)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def792]
criu-4.2/criu/sk-packet.c:452:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/sk-packet.c:421:14: acquire_resource: socket created here
criu-4.2/criu/sk-packet.c:422:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/sk-packet.c:427:9: branch_false: ...to here
criu-4.2/criu/sk-packet.c:431:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-packet.c:452:44: branch_false: ...to here
criu-4.2/criu/sk-packet.c:452:13: throw: if ‘rst_file_params’ throws an exception...
criu-4.2/criu/sk-packet.c:452:13: danger: ‘sk’ leaks here
#  450|   	}
#  451|   
#  452|-> 	if (rst_file_params(sk, pse->fown, pse->flags))
#  453|   		goto err;
#  454|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def793]
criu-4.2/criu/sk-queue.c:95:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-queue.c:81:12: enter_function: entry to ‘dump_scm_rights’
criu-4.2/criu/sk-queue.c:90:15: acquire_memory: allocated here
criu-4.2/criu/sk-queue.c:90:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-queue.c:94:16: call_function: inlined call to ‘xptr_pull_s’ from ‘dump_scm_rights’
criu-4.2/criu/sk-queue.c:95:9: throw: if ‘scm_entry__init’ throws an exception...
criu-4.2/criu/sk-queue.c:95:9: danger: ‘___p’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#   93|   
#   94|   	scme = xptr_pull(&buf, ScmEntry);
#   95|-> 	scm_entry__init(scme);
#   96|   	scme->type = SCM_RIGHTS;
#   97|   	scme->n_rights = nr_fds;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def794]
criu-4.2/criu/sk-queue.c:206:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-queue.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-queue.c:183:9: branch_false: ...to here
criu-4.2/criu/sk-queue.c:186:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-queue.c:192:14: branch_false: ...to here
criu-4.2/criu/sk-queue.c:197:16: acquire_memory: allocated here
criu-4.2/criu/sk-queue.c:197:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-queue.c:204:15: branch_false: ...to here
criu-4.2/criu/sk-queue.c:205:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-queue.c:206:17: branch_true: ...to here
criu-4.2/criu/sk-queue.c:206:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sk-queue.c:206:17: danger: ‘___p’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  204|   	ret = setsockopt(sock_fd, SOL_SOCKET, SO_PEEK_OFF, &ret, sizeof(int));
#  205|   	if (ret < 0) {
#  206|-> 		pr_perror("setsockopt fail");
#  207|   		goto err_brk;
#  208|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def795]
criu-4.2/criu/sk-queue.c:225:35: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-queue.c:176:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-queue.c:183:9: branch_false: ...to here
criu-4.2/criu/sk-queue.c:186:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-queue.c:192:14: branch_false: ...to here
criu-4.2/criu/sk-queue.c:197:16: acquire_memory: allocated here
criu-4.2/criu/sk-queue.c:197:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-queue.c:204:15: branch_false: ...to here
criu-4.2/criu/sk-queue.c:205:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-queue.c:210:9: branch_false: ...to here
criu-4.2/criu/sk-queue.c:225:35: throw: if ‘recvmsg’ throws an exception...
criu-4.2/criu/sk-queue.c:225:35: danger: ‘___p’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  223|   		};
#  224|   
#  225|-> 		ret = pe.length = recvmsg(sock_fd, &msg, MSG_DONTWAIT | MSG_PEEK);
#  226|   		if (!ret)
#  227|   			/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def796]
criu-4.2/criu/sk-tcp.c:277:13: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-tcp.c:273:15: acquire_memory: allocated here
criu-4.2/criu/sk-tcp.c:273:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-tcp.c:277:13: branch_false: ...to here
criu-4.2/criu/sk-tcp.c:277:13: throw: if ‘read_img_buf’ throws an exception...
criu-4.2/criu/sk-tcp.c:277:13: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  275|   		return -1;
#  276|   
#  277|-> 	if (read_img_buf(img, buf, len) < 0)
#  278|   		goto err;
#  279|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def797]
criu-4.2/criu/sk-unix.c:723:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  721|   	char *name;
#  722|   
#  723|-> 	len = nla_len(tb[UNIX_DIAG_NAME]);
#  724|   	name = xmalloc(len + 1);
#  725|   	if (!name)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def798]
criu-4.2/criu/sk-unix.c:724:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  722|   
#  723|   	len = nla_len(tb[UNIX_DIAG_NAME]);
#  724|-> 	name = xmalloc(len + 1);
#  725|   	if (!name)
#  726|   		return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def799]
criu-4.2/criu/sk-unix.c:728:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  726|   		return -ENOMEM;
#  727|   
#  728|-> 	memcpy(name, nla_data(tb[UNIX_DIAG_NAME]), len);
#  729|   	name[len] = '\0';
#  730|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def800]
criu-4.2/criu/sk-unix.c:735:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  733|   
#  734|   		if (!tb[UNIX_DIAG_VFS]) {
#  735|-> 			pr_err("Bound socket w/o inode %d\n", m->udiag_ino);
#  736|   			goto skip;
#  737|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def801]
criu-4.2/criu/sk-unix.c:770:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  768|   
#  769|   	if (tb[UNIX_DIAG_SHUTDOWN])
#  770|-> 		d->shutdown = nla_get_u8(tb[UNIX_DIAG_SHUTDOWN]);
#  771|   	else
#  772|   		pr_err_once("No socket shutdown info\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def802]
criu-4.2/criu/sk-unix.c:772:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  770|   		d->shutdown = nla_get_u8(tb[UNIX_DIAG_SHUTDOWN]);
#  771|   	else
#  772|-> 		pr_err_once("No socket shutdown info\n");
#  773|   
#  774|   	if (tb[UNIX_DIAG_PEER])

Error: GCC_ANALYZER_WARNING (CWE-401): [#def803]
criu-4.2/criu/sk-unix.c:775:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:843:5: enter_function: entry to ‘unix_receive_one’
criu-4.2/criu/sk-unix.c:850:16: call_function: calling ‘unix_collect_one’ from ‘unix_receive_one’
#  773|   
#  774|   	if (tb[UNIX_DIAG_PEER])
#  775|-> 		d->peer_ino = nla_get_u32(tb[UNIX_DIAG_PEER]);
#  776|   
#  777|   	if (tb[UNIX_DIAG_NAME]) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def804]
criu-4.2/criu/sk-unix.c:1269:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1267|   
# 1268|   	if (prev_root_fd && (root_ns_mask & CLONE_NEWNS)) {
# 1269|-> 		*prev_root_fd = open("/", O_RDONLY);
# 1270|   		if (*prev_root_fd < 0) {
# 1271|   			pr_perror("Can't open current root");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def805]
criu-4.2/criu/sk-unix.c:1271:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1269|   		*prev_root_fd = open("/", O_RDONLY);
# 1270|   		if (*prev_root_fd < 0) {
# 1271|-> 			pr_perror("Can't open current root");
# 1272|   			goto err;
# 1273|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def806]
criu-4.2/criu/sk-unix.c:1277:39: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:1602:12: enter_function: entry to ‘bind_unix_sk’
criu-4.2/criu/sk-unix.c:1608:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1611:14: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1626:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1626:28: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1626:28: call_function: calling ‘prep_unix_sk_cwd’ from ‘bind_unix_sk’
# 1275|   
# 1276|   	if (prev_mntns_fd && ui->name[0] && ui->ue->mnt_id >= 0) {
# 1277|-> 		struct ns_id *mntns = lookup_nsid_by_mnt_id(ui->ue->mnt_id);
# 1278|   		int ns_fd;
# 1279|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def807]
criu-4.2/criu/sk-unix.c:1277:39: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘root_fd’
criu-4.2/criu/sk-unix.c:1602:12: enter_function: entry to ‘bind_unix_sk’
criu-4.2/criu/sk-unix.c:1608:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1611:14: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1626:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1626:28: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1626:28: call_function: calling ‘prep_unix_sk_cwd’ from ‘bind_unix_sk’
# 1275|   
# 1276|   	if (prev_mntns_fd && ui->name[0] && ui->ue->mnt_id >= 0) {
# 1277|-> 		struct ns_id *mntns = lookup_nsid_by_mnt_id(ui->ue->mnt_id);
# 1278|   		int ns_fd;
# 1279|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def808]
criu-4.2/criu/sk-unix.c:1281:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:1602:12: enter_function: entry to ‘bind_unix_sk’
criu-4.2/criu/sk-unix.c:1608:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1611:14: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1626:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1626:28: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1626:28: call_function: calling ‘prep_unix_sk_cwd’ from ‘bind_unix_sk’
# 1279|   
# 1280|   		if (mntns == NULL) {
# 1281|-> 			pr_err("Unable to find the %d mount\n", ui->ue->mnt_id);
# 1282|   			goto err;
# 1283|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def809]
criu-4.2/criu/sk-unix.c:1281:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘root_fd’
criu-4.2/criu/sk-unix.c:1602:12: enter_function: entry to ‘bind_unix_sk’
criu-4.2/criu/sk-unix.c:1608:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1611:14: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1626:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1626:28: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1626:28: call_function: calling ‘prep_unix_sk_cwd’ from ‘bind_unix_sk’
# 1279|   
# 1280|   		if (mntns == NULL) {
# 1281|-> 			pr_err("Unable to find the %d mount\n", ui->ue->mnt_id);
# 1282|   			goto err;
# 1283|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def810]
criu-4.2/criu/sk-unix.c:1299:30: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1297|   	if (prev_root_fd && (root_ns_mask & CLONE_NEWNS)) {
# 1298|   		if (ui->ue->mnt_id >= 0) {
# 1299|-> 			ns = lookup_nsid_by_mnt_id(ui->ue->mnt_id);
# 1300|   		} else {
# 1301|   			if (root == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def811]
criu-4.2/criu/sk-unix.c:1299:30: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘root_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1297|   	if (prev_root_fd && (root_ns_mask & CLONE_NEWNS)) {
# 1298|   		if (ui->ue->mnt_id >= 0) {
# 1299|-> 			ns = lookup_nsid_by_mnt_id(ui->ue->mnt_id);
# 1300|   		} else {
# 1301|   			if (root == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def812]
criu-4.2/criu/sk-unix.c:1302:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1300|   		} else {
# 1301|   			if (root == NULL)
# 1302|-> 				root = lookup_ns_by_id(root_item->ids->mnt_ns_id, &mnt_ns_desc);
# 1303|   			ns = root;
# 1304|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def813]
criu-4.2/criu/sk-unix.c:1302:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘root_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1300|   		} else {
# 1301|   			if (root == NULL)
# 1302|-> 				root = lookup_ns_by_id(root_item->ids->mnt_ns_id, &mnt_ns_desc);
# 1303|   			ns = root;
# 1304|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def814]
criu-4.2/criu/sk-unix.c:1308:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1306|   			goto err;
# 1307|   
# 1308|-> 		fd = fdstore_get(ns->mnt.root_fd_id);
# 1309|   		if (fd < 0) {
# 1310|   			pr_err("Can't get root fd\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def815]
criu-4.2/criu/sk-unix.c:1308:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘root_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1306|   			goto err;
# 1307|   
# 1308|-> 		fd = fdstore_get(ns->mnt.root_fd_id);
# 1309|   		if (fd < 0) {
# 1310|   			pr_err("Can't get root fd\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def816]
criu-4.2/criu/sk-unix.c:1310:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cwd_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1308|   		fd = fdstore_get(ns->mnt.root_fd_id);
# 1309|   		if (fd < 0) {
# 1310|-> 			pr_err("Can't get root fd\n");
# 1311|   			goto err;
# 1312|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def817]
criu-4.2/criu/sk-unix.c:1310:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘root_fd’
criu-4.2/criu/sk-unix.c:2004:12: enter_function: entry to ‘unlink_sk’
criu-4.2/criu/sk-unix.c:2009:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2012:13: call_function: calling ‘prep_unix_sk_cwd’ from ‘unlink_sk’
# 1308|   		fd = fdstore_get(ns->mnt.root_fd_id);
# 1309|   		if (fd < 0) {
# 1310|-> 			pr_err("Can't get root fd\n");
# 1311|   			goto err;
# 1312|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def818]
criu-4.2/criu/sk-unix.c:1351:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1349|   
# 1350|   	ui = container_of(d, struct unix_sk_info, d);
# 1351|-> 	BUG_ON((ui->flags & (USK_PAIR_MASTER | USK_PAIR_SLAVE)) || (ui->ue->uflags & (USK_CALLBACK | USK_INHERIT)));
# 1352|   
# 1353|   	if (chk_restored_scms(ui))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def819]
criu-4.2/criu/sk-unix.c:1459:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*ui.name, 2097152)’
criu-4.2/criu/sk-unix.c:1454:18: acquire_resource: opened here
criu-4.2/criu/sk-unix.c:1455:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1459:26: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1459:26: throw: if ‘fdstore_add’ throws an exception...
criu-4.2/criu/sk-unix.c:1459:26: danger: ‘open(*ui.name, 2097152)’ leaks here; was opened at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
# 1457|   		return -1;
# 1458|   	}
# 1459|-> 	ui->fdstore_id = fdstore_add(fd);
# 1460|   	pr_debug("ghost: id %#x %d fdstore_id %d %s\n", ui->ue->id, ui->ue->ino, ui->fdstore_id, ui->name);
# 1461|   	close(fd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def820]
criu-4.2/criu/sk-unix.c:1674:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-unix.c:1674:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1674:9: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1674:9: danger: dereference of NULL ‘0’
# 1672|   	fle = file_master(&ui->d);
# 1673|   	fle_peer = file_master(&peer->d);
# 1674|-> 	BUG_ON(fle->task != fle_peer->task); /* See interconnected_pair() */
# 1675|   
# 1676|   	if (chk_restored_scms(ui) || chk_restored_scms(peer))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def821]
criu-4.2/criu/sk-unix.c:1713:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-unix.c:1708:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1711:20: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1713:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1713:9: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1713:9: danger: dereference of NULL ‘0’
# 1711|   	fle_peer = file_master(&peer->d);
# 1712|   
# 1713|-> 	BUG_ON(fle->task != fle_peer->task); /* See interconnected_pair() */
# 1714|   
# 1715|   	if (set_netns(ui->ue->ns_id))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def822]
criu-4.2/criu/sk-unix.c:1733:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/sk-unix.c:1708:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1711:20: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1713:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1715:23: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1718:33: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1718:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1723:13: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1723:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1728:23: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1728:23: acquire_resource: opened here
criu-4.2/criu/sk-unix.c:1729:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/sk-unix.c:1733:17: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1733:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/sk-unix.c:1733:17: danger: ‘tmp’ leaks here; was opened at [(11)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/10)
# 1731|   			return -1;
# 1732|   		}
# 1733|-> 		close(sk[0]);
# 1734|   		sk[0] = tmp;
# 1735|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def823]
criu-4.2/criu/sk-unix.c:1737:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/sk-unix.c:1708:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1711:20: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1713:9: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1715:23: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1715:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1718:33: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1718:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1723:13: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1723:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1728:23: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1728:23: acquire_resource: opened here
criu-4.2/criu/sk-unix.c:1729:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/sk-unix.c:1733:17: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1737:13: throw: if ‘setup_and_serve_out’ throws an exception...
criu-4.2/criu/sk-unix.c:1737:13: danger: ‘tmp’ leaks here; was opened at [(11)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/10)
# 1735|   	}
# 1736|   
# 1737|-> 	if (setup_and_serve_out(fle_peer, sk[1])) {
# 1738|   		pr_err("Can't send pair slave\n");
# 1739|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def824]
criu-4.2/criu/sk-unix.c:1785:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/sk-unix.c:1775:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1780:23: branch_true: ...to here
criu-4.2/criu/sk-unix.c:1780:23: acquire_resource: opened here
criu-4.2/criu/sk-unix.c:1781:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/sk-unix.c:1785:17: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1785:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/sk-unix.c:1785:17: danger: ‘ret’ leaks here; was opened at [(3)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/2)
# 1783|   			return -1;
# 1784|   		}
# 1785|-> 		close(sks[0]);
# 1786|   		sks[0] = ret;
# 1787|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def825]
criu-4.2/criu/sk-unix.c:1789:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sks[0]’
criu-4.2/criu/sk-unix.c:1796:12: enter_function: entry to ‘open_unixsk_standalone’
criu-4.2/criu/sk-unix.c:1822:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1826:15: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1829:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1837:13: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1837:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1850:21: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1850:19: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:1854:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:1859:23: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1860:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/sk-unix.c:1865:21: branch_false: ...to here
criu-4.2/criu/sk-unix.c:1865:21: call_function: calling ‘setup_second_end’ from ‘open_unixsk_standalone’
# 1787|   	}
# 1788|   
# 1789|-> 	if (setup_and_serve_out(second_end, sks[1])) {
# 1790|   		pr_err("Can't send pair slave\n");
# 1791|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def826]
criu-4.2/criu/sk-unix.c:2135:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘uname’
criu-4.2/criu/sk-unix.c:2124:12: enter_function: entry to ‘collect_one_unixsk’
criu-4.2/criu/sk-unix.c:2130:13: call_function: calling ‘init_unix_sk_info’ from ‘collect_one_unixsk’
criu-4.2/criu/sk-unix.c:2130:13: return_function: returning to ‘collect_one_unixsk’ from ‘init_unix_sk_info’
criu-4.2/criu/sk-unix.c:2130:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2133:9: branch_false: ...to here
criu-4.2/criu/sk-unix.c:2133:9: release_memory: ‘uname’ is NULL
criu-4.2/criu/sk-unix.c:2135:12: branch_true: following ‘true’ branch (when ‘ulen > 0’)...
criu-4.2/criu/sk-unix.c:2135:25: branch_true: ...to here
criu-4.2/criu/sk-unix.c:2135:25: danger: dereference of NULL ‘uname’
# 2133|   	uname = ui->name;
# 2134|   	ulen = ui->ue->name.len;
# 2135|-> 	if (ulen > 0 && uname[0] == 0) {
# 2136|   		prefix = "@";
# 2137|   		uname++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def827]
criu-4.2/criu/sk-unix.c:2225:23: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sk-unix.c:2195:12: enter_function: entry to ‘add_fake_queuer’
criu-4.2/criu/sk-unix.c:2203:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2206:16: branch_false: ...to here
criu-4.2/criu/sk-unix.c:2206:16: acquire_memory: allocated here
criu-4.2/criu/sk-unix.c:2206:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sk-unix.c:2210:9: branch_false: ...to here
criu-4.2/criu/sk-unix.c:2222:13: call_function: calling ‘init_unix_sk_info’ from ‘add_fake_queuer’
criu-4.2/criu/sk-unix.c:2222:13: return_function: returning to ‘add_fake_queuer’ from ‘init_unix_sk_info’
criu-4.2/criu/sk-unix.c:2222:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2225:23: branch_false: ...to here
criu-4.2/criu/sk-unix.c:2225:23: throw: if ‘find_unused_file_desc_id’ throws an exception...
criu-4.2/criu/sk-unix.c:2225:23: danger: ‘___p’ leaks here; was allocated at [(4)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/3)
# 2223|   		return -1;
# 2224|   
# 2225|-> 	peer_ue->id = find_unused_file_desc_id();
# 2226|   	set_peer(peer, ui);
# 2227|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def828]
criu-4.2/criu/sk-unix.c:2306:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sk-unix.c:2303:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sk-unix.c:2306:9: branch_false: ...to here
criu-4.2/criu/sk-unix.c:2306:9: branch_true: following ‘true’ branch...
criu-4.2/criu/sk-unix.c:2306:9: branch_true: ...to here
criu-4.2/criu/sk-unix.c:2306:9: danger: dereference of NULL ‘0’
# 2304|   		return;
# 2305|   
# 2306|-> 	BUG_ON(!ui->ue->peer);
# 2307|   
# 2308|   	if (ui->ue->peer == ui->ue->ino) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def829]
criu-4.2/criu/sockets.c:183:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  181|   
#  182|   	pr_err("Unknown pair family %d proto %d\n", family, proto);
#  183|-> 	BUG();
#  184|   	return -1;
#  185|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def830]
criu-4.2/criu/sockets.c:222:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘nl’
criu-4.2/criu/sockets.c:225:6: enter_function: entry to ‘preload_socket_modules’
criu-4.2/criu/sockets.c:241:14: acquire_resource: socket created here
criu-4.2/criu/sockets.c:242:12: branch_false: following ‘false’ branch (when ‘nl >= 0’)...
criu-4.2/criu/sockets.c:245:9: branch_false: ...to here
criu-4.2/criu/sockets.c:263:9: call_function: calling ‘probe_diag’ from ‘preload_socket_modules’
#  220|   static inline void probe_diag(int nl, struct sock_diag_req *req, int expected_err)
#  221|   {
#  222|-> 	do_rtnl_req(nl, req, req->hdr.nlmsg_len, probe_recv_one, probe_err, NULL, &expected_err);
#  223|   }
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def831]
criu-4.2/criu/sockets.c:245:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘nl’
criu-4.2/criu/sockets.c:241:14: acquire_resource: socket created here
criu-4.2/criu/sockets.c:242:12: branch_false: following ‘false’ branch (when ‘nl >= 0’)...
criu-4.2/criu/sockets.c:245:9: branch_false: ...to here
criu-4.2/criu/sockets.c:245:9: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sockets.c:245:9: danger: ‘nl’ leaks here
#  243|   		return;
#  244|   
#  245|-> 	pr_info("Probing sock diag modules\n");
#  246|   
#  247|   	memset(&req, 0, sizeof(req));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def832]
criu-4.2/criu/sockets.c:437:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  435|   	for (sd = sockets[ino % SK_HASH_SIZE]; sd; sd = sd->next) {
#  436|   		if (sd->ino == ino) {
#  437|-> 			BUG_ON(sd->family != family);
#  438|   			return sd;
#  439|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def833]
criu-4.2/criu/sockets.c:795:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  793|   		break;
#  794|   	default:
#  795|-> 		BUG_ON(1);
#  796|   		return -1;
#  797|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def834]
criu-4.2/criu/stats.c:35:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:34:12: branch_true: following ‘true’ branch...
criu-4.2/criu/stats.c:35:17: branch_true: ...to here
criu-4.2/criu/stats.c:35:17: branch_true: following ‘true’ branch (when ‘c > 8’)...
criu-4.2/criu/stats.c:35:17: branch_true: ...to here
criu-4.2/criu/stats.c:35:17: danger: dereference of NULL ‘0’
#   33|   {
#   34|   	if (dstats != NULL) {
#   35|-> 		BUG_ON(c >= DUMP_CNT_NR_STATS);
#   36|   		dstats->counts[c] += val;
#   37|   	} else if (rstats != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def835]
criu-4.2/criu/stats.c:38:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:34:12: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:37:20: branch_false: ...to here
criu-4.2/criu/stats.c:37:19: branch_true: following ‘true’ branch...
criu-4.2/criu/stats.c:38:17: branch_true: ...to here
criu-4.2/criu/stats.c:38:17: branch_true: following ‘true’ branch (when ‘c > 2’)...
criu-4.2/criu/stats.c:38:17: branch_true: ...to here
criu-4.2/criu/stats.c:38:17: danger: dereference of NULL ‘0’
#   36|   		dstats->counts[c] += val;
#   37|   	} else if (rstats != NULL) {
#   38|-> 		BUG_ON(c >= RESTORE_CNT_NR_STATS);
#   39|   		atomic_add(val, &rstats->counts[c]);
#   40|   	} else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def836]
criu-4.2/criu/stats.c:41:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:34:12: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:37:20: branch_false: ...to here
criu-4.2/criu/stats.c:37:19: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:41:17: branch_false: ...to here
criu-4.2/criu/stats.c:41:17: danger: dereference of NULL ‘0’
#   39|   		atomic_add(val, &rstats->counts[c]);
#   40|   	} else
#   41|-> 		BUG();
#   42|   }
#   43|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def837]
criu-4.2/criu/stats.c:47:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:46:12: branch_true: following ‘true’ branch...
criu-4.2/criu/stats.c:47:17: branch_true: ...to here
criu-4.2/criu/stats.c:47:17: branch_true: following ‘true’ branch (when ‘c > 8’)...
criu-4.2/criu/stats.c:47:17: branch_true: ...to here
criu-4.2/criu/stats.c:47:17: danger: dereference of NULL ‘0’
#   45|   {
#   46|   	if (dstats != NULL) {
#   47|-> 		BUG_ON(c >= DUMP_CNT_NR_STATS);
#   48|   		dstats->counts[c] -= val;
#   49|   	} else if (rstats != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def838]
criu-4.2/criu/stats.c:50:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:46:12: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:49:20: branch_false: ...to here
criu-4.2/criu/stats.c:49:19: branch_true: following ‘true’ branch...
criu-4.2/criu/stats.c:50:17: branch_true: ...to here
criu-4.2/criu/stats.c:50:17: branch_true: following ‘true’ branch (when ‘c > 2’)...
criu-4.2/criu/stats.c:50:17: branch_true: ...to here
criu-4.2/criu/stats.c:50:17: danger: dereference of NULL ‘0’
#   48|   		dstats->counts[c] -= val;
#   49|   	} else if (rstats != NULL) {
#   50|-> 		BUG_ON(c >= RESTORE_CNT_NR_STATS);
#   51|   		atomic_add(-val, &rstats->counts[c]);
#   52|   	} else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def839]
criu-4.2/criu/stats.c:53:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:46:12: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:49:20: branch_false: ...to here
criu-4.2/criu/stats.c:49:19: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:53:17: branch_false: ...to here
criu-4.2/criu/stats.c:53:17: danger: dereference of NULL ‘0’
#   51|   		atomic_add(-val, &rstats->counts[c]);
#   52|   	} else
#   53|-> 		BUG();
#   54|   }
#   55|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def840]
criu-4.2/criu/stats.c:76:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:75:12: branch_true: following ‘true’ branch...
criu-4.2/criu/stats.c:76:17: branch_true: ...to here
criu-4.2/criu/stats.c:76:17: branch_true: following ‘true’ branch (when ‘t > 4’)...
criu-4.2/criu/stats.c:76:17: branch_true: ...to here
criu-4.2/criu/stats.c:76:17: danger: dereference of NULL ‘0’
#   74|   {
#   75|   	if (dstats != NULL) {
#   76|-> 		BUG_ON(t >= DUMP_TIME_NR_STATS);
#   77|   		return &dstats->timings[t];
#   78|   	} else if (rstats != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def841]
criu-4.2/criu/stats.c:83:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:78:19: branch_true: following ‘true’ branch...
criu-4.2/criu/stats.c:83:17: branch_true: ...to here
criu-4.2/criu/stats.c:83:17: branch_true: following ‘true’ branch (when ‘t > 1’)...
criu-4.2/criu/stats.c:83:17: branch_true: ...to here
criu-4.2/criu/stats.c:83:17: danger: dereference of NULL ‘0’
#   81|   		 * from different tasks.
#   82|   		 */
#   83|-> 		BUG_ON(t >= RESTORE_TIME_NS_STATS);
#   84|   		return &rstats->timings[t];
#   85|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def842]
criu-4.2/criu/stats.c:87:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/stats.c:78:19: branch_false: following ‘false’ branch...
criu-4.2/criu/stats.c:87:9: branch_false: ...to here
criu-4.2/criu/stats.c:87:9: danger: dereference of NULL ‘0’
#   85|   	}
#   86|   
#   87|-> 	BUG();
#   88|   	return NULL;
#   89|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def843]
criu-4.2/criu/sysctl.c:96:1: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:183:12: enter_function: entry to ‘__userns_sysctl_op’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:235:31: branch_true: ...to here
criu-4.2/criu/sysctl.c:244:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:249:20: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:277:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:291:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:296:21: branch_false: ...to here
criu-4.2/criu/sysctl.c:296:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:301:17: branch_false: ...to here
criu-4.2/criu/sysctl.c:303:29: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:304:54: branch_true: ...to here
criu-4.2/criu/sysctl.c:304:29: call_function: calling ‘do_sysctl_op’ from ‘__userns_sysctl_op’
#   94|   	}
#   95|   
#   96|-> GEN_SYSCTL_READ_FUNC(u32, strtoul);
#   97|   GEN_SYSCTL_READ_FUNC(u64, strtoull);
#   98|   GEN_SYSCTL_READ_FUNC(s32, strtol);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def844]
criu-4.2/criu/sysctl.c:100:1: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:183:12: enter_function: entry to ‘__userns_sysctl_op’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:235:31: branch_true: ...to here
criu-4.2/criu/sysctl.c:244:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:249:20: branch_false: ...to here
criu-4.2/criu/sysctl.c:255:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:265:21: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:277:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:291:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:296:21: branch_false: ...to here
criu-4.2/criu/sysctl.c:296:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:301:17: branch_false: ...to here
criu-4.2/criu/sysctl.c:303:29: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:304:54: branch_true: ...to here
criu-4.2/criu/sysctl.c:304:29: call_function: calling ‘do_sysctl_op’ from ‘__userns_sysctl_op’
#   98|   GEN_SYSCTL_READ_FUNC(s32, strtol);
#   99|   
#  100|-> GEN_SYSCTL_WRITE_FUNC(u32, "%u ");
#  101|   GEN_SYSCTL_WRITE_FUNC(u64, "%" PRIu64 " ");
#  102|   GEN_SYSCTL_WRITE_FUNC(s32, "%d ");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def845]
criu-4.2/criu/sysctl.c:147:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:183:12: enter_function: entry to ‘__userns_sysctl_op’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:235:31: branch_true: ...to here
criu-4.2/criu/sysctl.c:235:31: call_function: calling ‘sysctl_userns_arg_size’ from ‘__userns_sysctl_op’
#  145|   		return sizeof(char) * CTL_LEN(type) + 1;
#  146|   	default:
#  147|-> 		pr_err("unknown arg type %d\n", type);
#  148|   
#  149|   		/* Ensure overflow to cause an error */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def846]
criu-4.2/criu/sysctl.c:228:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_true: ...to here
criu-4.2/criu/sysctl.c:228:16: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:228:16: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  226|   		goto out;
#  227|   
#  228|-> 	reqs = xmalloc(sizeof(struct sysctl_req *) * userns_req->nr_req);
#  229|   	if (!reqs)
#  230|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def847]
criu-4.2/criu/sysctl.c:245:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:235:31: branch_true: ...to here
criu-4.2/criu/sysctl.c:245:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:245:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  243|   
#  244|   		if (((char *)req) + total_len >= ((char *)userns_req) + MAX_UNSFD_MSG_SIZE) {
#  245|-> 			pr_err("bad sysctl req %s, too big: %d\n", req->name, total_len);
#  246|   			goto out;
#  247|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def848]
criu-4.2/criu/sysctl.c:254:22: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:235:31: branch_true: ...to here
criu-4.2/criu/sysctl.c:244:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:249:20: branch_false: ...to here
criu-4.2/criu/sysctl.c:249:20: branch_true: following ‘true’ branch (when ‘op == 0’)...
criu-4.2/criu/sysctl.c:254:22: branch_true: ...to here
criu-4.2/criu/sysctl.c:254:22: throw: if ‘openat’ throws an exception...
criu-4.2/criu/sysctl.c:254:22: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  252|   			flags = O_WRONLY;
#  253|   
#  254|-> 		fd = openat(dir, req->name, flags);
#  255|   		if (fd < 0) {
#  256|   			if (errno == ENOENT && (req->flags & CTL_FLAGS_OPTIONAL))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def849]
criu-4.2/criu/sysctl.c:258:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:234:21: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:235:31: branch_true: ...to here
criu-4.2/criu/sysctl.c:244:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:249:20: branch_false: ...to here
criu-4.2/criu/sysctl.c:255:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:256:29: branch_true: ...to here
criu-4.2/criu/sysctl.c:258:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:258:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  256|   			if (errno == ENOENT && (req->flags & CTL_FLAGS_OPTIONAL))
#  257|   				continue;
#  258|-> 			pr_perror("Can't open sysctl %s", req->name);
#  259|   			goto out;
#  260|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def850]
criu-4.2/criu/sysctl.c:287:38: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:287:38: throw: if ‘ns_to_string’ throws an exception...
criu-4.2/criu/sysctl.c:287:38: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  285|   	if (!worker) {
#  286|   		int nsfd;
#  287|-> 		const char *nsname = ns_to_string(userns_req->ns);
#  288|   
#  289|   		BUG_ON(!nsname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def851]
criu-4.2/criu/sysctl.c:289:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:289:17: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:289:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  287|   		const char *nsname = ns_to_string(userns_req->ns);
#  288|   
#  289|-> 		BUG_ON(!nsname);
#  290|   		nsfd = openat(proc_fd, nsname, O_RDONLY);
#  291|   		if (nsfd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def852]
criu-4.2/criu/sysctl.c:289:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:289:17: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: danger: dereference of NULL ‘0’
#  287|   		const char *nsname = ns_to_string(userns_req->ns);
#  288|   
#  289|-> 		BUG_ON(!nsname);
#  290|   		nsfd = openat(proc_fd, nsname, O_RDONLY);
#  291|   		if (nsfd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def853]
criu-4.2/criu/sysctl.c:290:24: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:290:24: throw: if ‘openat’ throws an exception...
criu-4.2/criu/sysctl.c:290:24: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  288|   
#  289|   		BUG_ON(!nsname);
#  290|-> 		nsfd = openat(proc_fd, nsname, O_RDONLY);
#  291|   		if (nsfd < 0) {
#  292|   			pr_perror("failed to open pid %d's ns %s", pid, nsname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def854]
criu-4.2/criu/sysctl.c:292:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:291:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:292:25: branch_true: ...to here
criu-4.2/criu/sysctl.c:292:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:292:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  290|   		nsfd = openat(proc_fd, nsname, O_RDONLY);
#  291|   		if (nsfd < 0) {
#  292|-> 			pr_perror("failed to open pid %d's ns %s", pid, nsname);
#  293|   			exit(1);
#  294|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def855]
criu-4.2/criu/sysctl.c:297:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:291:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:296:21: branch_false: ...to here
criu-4.2/criu/sysctl.c:296:20: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:297:25: branch_true: ...to here
criu-4.2/criu/sysctl.c:297:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:297:25: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  295|   
#  296|   		if (setns(nsfd, 0) < 0) {
#  297|-> 			pr_perror("failed to setns to %d's ns %s", pid, nsname);
#  298|   			exit(1);
#  299|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def856]
criu-4.2/criu/sysctl.c:301:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:291:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:296:21: branch_false: ...to here
criu-4.2/criu/sysctl.c:296:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:301:17: branch_false: ...to here
criu-4.2/criu/sysctl.c:301:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/sysctl.c:301:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
#  299|   		}
#  300|   
#  301|-> 		close(nsfd);
#  302|   
#  303|   		for (i = 0; i < userns_req->nr_req; i++) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def857]
criu-4.2/criu/sysctl.c:304:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_true: following ‘true’ branch (when ‘worker == 0’)...
criu-4.2/criu/sysctl.c:287:38: branch_true: ...to here
criu-4.2/criu/sysctl.c:289:17: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:290:24: branch_false: ...to here
criu-4.2/criu/sysctl.c:291:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:296:21: branch_false: ...to here
criu-4.2/criu/sysctl.c:296:20: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:301:17: branch_false: ...to here
criu-4.2/criu/sysctl.c:303:29: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:304:54: branch_true: ...to here
criu-4.2/criu/sysctl.c:304:29: danger: use of uninitialized value ‘*<unknown>’ here
#  302|   
#  303|   		for (i = 0; i < userns_req->nr_req; i++) {
#  304|-> 			if (do_sysctl_op(fds[i], reqs[i], op) < 0) {
#  305|   				if (op != CTL_READ || errno != EIO || !(req->flags & CTL_FLAGS_READ_EIO_SKIP))
#  306|   					exit(1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def858]
criu-4.2/criu/sysctl.c:316:13: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_false: following ‘false’ branch (when ‘worker != 0’)...
criu-4.2/criu/sysctl.c:316:13: branch_false: ...to here
criu-4.2/criu/sysctl.c:316:13: throw: if ‘waitpid’ throws an exception...
criu-4.2/criu/sysctl.c:316:13: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  314|   	}
#  315|   
#  316|-> 	if (waitpid(worker, &status, 0) != worker) {
#  317|   		pr_perror("worker didn't die?");
#  318|   		kill(worker, SIGKILL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def859]
criu-4.2/criu/sysctl.c:317:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_false: following ‘false’ branch (when ‘worker != 0’)...
criu-4.2/criu/sysctl.c:316:13: branch_false: ...to here
criu-4.2/criu/sysctl.c:316:12: branch_true: following ‘true’ branch...
criu-4.2/criu/sysctl.c:317:17: branch_true: ...to here
criu-4.2/criu/sysctl.c:317:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:317:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/2)
#  315|   
#  316|   	if (waitpid(worker, &status, 0) != worker) {
#  317|-> 		pr_perror("worker didn't die?");
#  318|   		kill(worker, SIGKILL);
#  319|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def860]
criu-4.2/criu/sysctl.c:324:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/sysctl.c:219:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:224:15: branch_false: ...to here
criu-4.2/criu/sysctl.c:224:15: acquire_memory: allocated here
criu-4.2/criu/sysctl.c:224:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:228:16: branch_false: ...to here
criu-4.2/criu/sysctl.c:228:16: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/sysctl.c:232:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:282:12: branch_false: following ‘false’ branch (when ‘worker >= 0’)...
criu-4.2/criu/sysctl.c:285:12: branch_false: ...to here
criu-4.2/criu/sysctl.c:285:12: branch_false: following ‘false’ branch (when ‘worker != 0’)...
criu-4.2/criu/sysctl.c:316:13: branch_false: ...to here
criu-4.2/criu/sysctl.c:316:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysctl.c:321:9: branch_false: ...to here
criu-4.2/criu/sysctl.c:324:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/sysctl.c:324:17: danger: ‘___p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  322|   
#  323|   	if (!WIFEXITED(status) || WEXITSTATUS(status)) {
#  324|-> 		pr_err("worker failed: %d\n", status);
#  325|   		goto out;
#  326|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def861]
criu-4.2/criu/sysfs_parse.c:178:27: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
criu-4.2/criu/sysfs_parse.c:136:5: enter_function: entry to ‘parse_aufs_branches’
criu-4.2/criu/sysfs_parse.c:150:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysfs_parse.c:155:13: branch_false: ...to here
criu-4.2/criu/sysfs_parse.c:155:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysfs_parse.c:160:12: branch_false: ...to here
criu-4.2/criu/sysfs_parse.c:160:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysfs_parse.c:163:9: branch_false: ...to here
criu-4.2/criu/sysfs_parse.c:164:13: call_function: calling ‘parse_aufs_sbinfo’ from ‘parse_aufs_branches’
criu-4.2/criu/sysfs_parse.c:164:13: return_function: returning to ‘parse_aufs_branches’ from ‘parse_aufs_sbinfo’
criu-4.2/criu/sysfs_parse.c:164:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysfs_parse.c:166:19: branch_false: ...to here
criu-4.2/criu/sysfs_parse.c:166:19: acquire_memory: allocated here
criu-4.2/criu/sysfs_parse.c:166:12: branch_false: following ‘false’ branch...
criu-4.2/criu/sysfs_parse.c:166:12: branch_false: ...to here
criu-4.2/criu/sysfs_parse.c:178:27: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/sysfs_parse.c:178:27: danger: ‘opendir(&path)’ leaks here; was allocated at [(20)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/19)
#  176|   	while (1) {
#  177|   		errno = 0;
#  178|-> 		if ((de = readdir(dp)) == NULL) {
#  179|   			if (errno) {
#  180|   				pr_perror("Cannot readdir %s", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def862]
criu-4.2/criu/tls.c:65:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tls.c:94:5: enter_function: entry to ‘tls_send_data_from_fd’
criu-4.2/criu/tls.c:98:21: acquire_memory: allocated here
criu-4.2/criu/tls.c:98:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:100:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:103:16: branch_true: following ‘true’ branch (when ‘len != 0’)...
criu-4.2/criu/tls.c:106:40: branch_true: ...to here
criu-4.2/criu/tls.c:107:20: branch_false: following ‘false’ branch...
criu-4.2/criu/tls.c:107:20: branch_false: ...to here
criu-4.2/criu/tls.c:112:32: branch_true: following ‘true’ branch...
criu-4.2/criu/tls.c:113:54: branch_true: ...to here
criu-4.2/criu/tls.c:113:31: call_function: calling ‘tls_send’ from ‘tls_send_data_from_fd’
#   63|   
#   64|   	tls_sk_flags = flags;
#   65|-> 	ret = gnutls_record_send(session, buf, len);
#   66|   	tls_sk_flags = 0;
#   67|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def863]
criu-4.2/criu/tls.c:80:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tls.c:94:5: enter_function: entry to ‘tls_send_data_from_fd’
criu-4.2/criu/tls.c:98:21: acquire_memory: allocated here
criu-4.2/criu/tls.c:98:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:100:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:103:16: branch_true: following ‘true’ branch (when ‘len != 0’)...
criu-4.2/criu/tls.c:106:40: branch_true: ...to here
criu-4.2/criu/tls.c:107:20: branch_false: following ‘false’ branch...
criu-4.2/criu/tls.c:107:20: branch_false: ...to here
criu-4.2/criu/tls.c:112:32: branch_true: following ‘true’ branch...
criu-4.2/criu/tls.c:113:54: branch_true: ...to here
criu-4.2/criu/tls.c:113:31: call_function: calling ‘tls_send’ from ‘tls_send_data_from_fd’
#   78|   			break;
#   79|   		default:
#   80|-> 			tls_perror("Failed to send data", ret);
#   81|   			errno = EIO;
#   82|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def864]
criu-4.2/criu/tls.c:108:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tls.c:98:21: acquire_memory: allocated here
criu-4.2/criu/tls.c:98:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:100:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:103:16: branch_true: following ‘true’ branch (when ‘len != 0’)...
criu-4.2/criu/tls.c:106:40: branch_true: ...to here
criu-4.2/criu/tls.c:107:20: branch_true: following ‘true’ branch...
criu-4.2/criu/tls.c:108:25: branch_true: ...to here
criu-4.2/criu/tls.c:108:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tls.c:108:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  106|   		copied = read(fd, buf, min(len, buf_size));
#  107|   		if (copied <= 0) {
#  108|-> 			pr_perror("Can't read from pipe");
#  109|   			goto err;
#  110|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def865]
criu-4.2/criu/tls.c:115:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tls.c:98:21: acquire_memory: allocated here
criu-4.2/criu/tls.c:98:21: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:100:12: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tls.c:100:12: branch_false: ...to here
criu-4.2/criu/tls.c:103:16: branch_true: following ‘true’ branch (when ‘len != 0’)...
criu-4.2/criu/tls.c:106:40: branch_true: ...to here
criu-4.2/criu/tls.c:107:20: branch_false: following ‘false’ branch...
criu-4.2/criu/tls.c:107:20: branch_false: ...to here
criu-4.2/criu/tls.c:112:32: branch_true: following ‘true’ branch...
criu-4.2/criu/tls.c:113:54: branch_true: ...to here
criu-4.2/criu/tls.c:115:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tls.c:115:33: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  113|   			ret = tls_send((buf + sent), (copied - sent), 0);
#  114|   			if (ret < 0) {
#  115|-> 				tls_perror("Failed sending data", ret);
#  116|   				goto err;
#  117|   			}

Error: COMPILER_WARNING (CWE-704): [#def866]
criu-4.2/criu/tty.c: scope_hint: In function ‘pts_fd_get_index’
criu-4.2/criu/tty.c:262:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  262 |         char *pos = strrchr(link->name, '/');
#      |                     ^~~~~~~
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  260|   	int index;
#  261|   	const struct fd_link *link = p->link;
#  262|-> 	char *pos = strrchr(link->name, '/');
#  263|   
#  264|   	if (!pos || pos == (link->name + link->len - 1)) {

Error: COMPILER_WARNING (CWE-704): [#def867]
criu-4.2/criu/tty.c:262:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  260|   	int index;
#  261|   	const struct fd_link *link = p->link;
#  262|-> 	char *pos = strrchr(link->name, '/');
#  263|   
#  264|   	if (!pos || pos == (link->name + link->len - 1)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def868]
criu-4.2/criu/tty.c:457:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:974:12: enter_function: entry to ‘pty_open_unpaired_slave’
criu-4.2/criu/tty.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1022:24: branch_false: ...to here
criu-4.2/criu/tty.c:1022:24: call_function: calling ‘pty_alloc_fake_reg’ from ‘pty_open_unpaired_slave’
#  455|   
#  456|   	r->rfe = (void *)r + sizeof(*r);
#  457|-> 	reg_file_entry__init(r->rfe);
#  458|   
#  459|   	r->rfe->name = (void *)r + sizeof(*r) + sizeof(*r->rfe);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def869]
criu-4.2/criu/tty.c:499:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/tty.c:974:12: enter_function: entry to ‘pty_open_unpaired_slave’
criu-4.2/criu/tty.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1022:24: branch_false: ...to here
criu-4.2/criu/tty.c:1022:24: call_function: calling ‘pty_alloc_fake_reg’ from ‘pty_open_unpaired_slave’
#  497|   	pr_debug("Allocating fake descriptor for %#x (reg_d %p)\n", info->tfe->id, info->reg_d);
#  498|   
#  499|-> 	BUG_ON(!info->reg_d);
#  500|   	BUG_ON(!is_pty(info->driver));
#  501|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def870]
criu-4.2/criu/tty.c:500:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/tty.c:974:12: enter_function: entry to ‘pty_open_unpaired_slave’
criu-4.2/criu/tty.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1022:24: branch_false: ...to here
criu-4.2/criu/tty.c:1022:24: call_function: calling ‘pty_alloc_fake_reg’ from ‘pty_open_unpaired_slave’
#  498|   
#  499|   	BUG_ON(!info->reg_d);
#  500|-> 	BUG_ON(!is_pty(info->driver));
#  501|   
#  502|   	fake_desc = pty_alloc_reg(info, false);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def871]
criu-4.2/criu/tty.c:519:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:974:12: enter_function: entry to ‘pty_open_unpaired_slave’
criu-4.2/criu/tty.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1022:24: branch_false: ...to here
criu-4.2/criu/tty.c:1022:24: call_function: calling ‘pty_alloc_fake_reg’ from ‘pty_open_unpaired_slave’
#  517|   		char *inverted_path = xmalloc(len + 32);
#  518|   
#  519|-> 		BUG_ON(!pos || !inverted_path);
#  520|   
#  521|   		memcpy(inverted_path, orig->rfe->name, slash_at + 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def872]
criu-4.2/criu/tty.c:519:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/tty.c:974:12: enter_function: entry to ‘pty_open_unpaired_slave’
criu-4.2/criu/tty.c:984:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1022:24: branch_false: ...to here
criu-4.2/criu/tty.c:1022:24: call_function: calling ‘pty_alloc_fake_reg’ from ‘pty_open_unpaired_slave’
#  517|   		char *inverted_path = xmalloc(len + 32);
#  518|   
#  519|-> 		BUG_ON(!pos || !inverted_path);
#  520|   
#  521|   		memcpy(inverted_path, orig->rfe->name, slash_at + 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def873]
criu-4.2/criu/tty.c:925:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/tty.c:919:12: enter_function: entry to ‘pty_open_slaves’
criu-4.2/criu/tty.c:924:9: branch_true: following ‘true’ branch (when ‘slave != info’)...
criu-4.2/criu/tty.c:925:17: call_function: inlined call to ‘tty_is_master’ from ‘pty_open_slaves’
criu-4.2/criu/tty.c:925:17: danger: dereference of NULL ‘0’
#  923|   
#  924|   	list_for_each_entry(slave, &info->sibling, sibling) {
#  925|-> 		BUG_ON(tty_is_master(slave));
#  926|   
#  927|   		fd = open_tty_reg(slave->reg_d, slave->tfe->flags);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def874]
criu-4.2/criu/tty.c:1248:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1244:13: acquire_memory: allocated here
criu-4.2/criu/tty.c:1244:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1248:9: branch_false: ...to here
criu-4.2/criu/tty.c:1248:9: throw: if ‘fdinfo_entry__init’ throws an exception...
criu-4.2/criu/tty.c:1248:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1246|   		return -1;
# 1247|   
# 1248|-> 	fdinfo_entry__init(e);
# 1249|   
# 1250|   	e->id = desc_id;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def875]
criu-4.2/criu/tty.c:1323:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/tty.c:1305:12: enter_function: entry to ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1312:12: branch_false: following ‘false’ branch (when ‘ctl_tty_id != 0’)...
criu-4.2/criu/tty.c:1315:9: branch_false: ...to here
criu-4.2/criu/tty.c:1318:14: call_function: calling ‘add_fake_fle’ from ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1318:14: return_function: returning to ‘prepare_ctl_tty’ from ‘add_fake_fle’
criu-4.2/criu/tty.c:1319:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1322:15: branch_false: ...to here
criu-4.2/criu/tty.c:1323:9: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:1323:9: branch_true: ...to here
criu-4.2/criu/tty.c:1323:9: danger: dereference of NULL ‘0’
# 1321|   
# 1322|   	fle = find_used_fd(item, fd);
# 1323|-> 	BUG_ON(!fle);
# 1324|   	/*
# 1325|   	 * Add a fake ctl_tty depending on the above fake fle, which will

Error: GCC_ANALYZER_WARNING (CWE-401): [#def876]
criu-4.2/criu/tty.c:1329:13: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1305:12: enter_function: entry to ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1312:12: branch_false: following ‘false’ branch (when ‘ctl_tty_id != 0’)...
criu-4.2/criu/tty.c:1315:9: branch_false: ...to here
criu-4.2/criu/tty.c:1318:14: call_function: calling ‘add_fake_fle’ from ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1318:14: return_function: returning to ‘prepare_ctl_tty’ from ‘add_fake_fle’
criu-4.2/criu/tty.c:1319:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1322:15: branch_false: ...to here
criu-4.2/criu/tty.c:1323:9: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1328:19: branch_false: ...to here
criu-4.2/criu/tty.c:1328:19: acquire_memory: allocated here
criu-4.2/criu/tty.c:1328:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1329:13: branch_false: ...to here
criu-4.2/criu/tty.c:1329:13: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/tty.c:1329:13: branch_true: ...to here
criu-4.2/criu/tty.c:1329:13: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:1329:13: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/14)
# 1327|   	 */
# 1328|   	ctl_tty = xmalloc(sizeof(*ctl_tty));
# 1329|-> 	e = xmalloc(sizeof(*e));
# 1330|   
# 1331|   	if (!ctl_tty || !e)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def877]
criu-4.2/criu/tty.c:1340:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1305:12: enter_function: entry to ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1312:12: branch_false: following ‘false’ branch (when ‘ctl_tty_id != 0’)...
criu-4.2/criu/tty.c:1315:9: branch_false: ...to here
criu-4.2/criu/tty.c:1318:14: call_function: calling ‘add_fake_fle’ from ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1318:14: return_function: returning to ‘prepare_ctl_tty’ from ‘add_fake_fle’
criu-4.2/criu/tty.c:1319:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1322:15: branch_false: ...to here
criu-4.2/criu/tty.c:1323:9: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1328:19: branch_false: ...to here
criu-4.2/criu/tty.c:1328:19: acquire_memory: allocated here
criu-4.2/criu/tty.c:1328:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1329:13: branch_false: ...to here
criu-4.2/criu/tty.c:1329:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1331:13: branch_false: ...to here
criu-4.2/criu/tty.c:1331:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1334:9: branch_false: ...to here
criu-4.2/criu/tty.c:1340:9: throw: if ‘file_desc_add’ throws an exception...
criu-4.2/criu/tty.c:1340:9: danger: ‘___p’ leaks here; was allocated at [(15)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/14)
# 1338|   	 * FD_TYPES__CTL_TTY (as it's unique for FD_TYPES__TTY type).
# 1339|   	 */
# 1340|-> 	file_desc_add(&ctl_tty->desc, ctl_tty_id, &ctl_tty_desc_ops);
# 1341|   
# 1342|   	fdinfo_entry__init(e);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def878]
criu-4.2/criu/tty.c:1342:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1305:12: enter_function: entry to ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1312:12: branch_false: following ‘false’ branch (when ‘ctl_tty_id != 0’)...
criu-4.2/criu/tty.c:1315:9: branch_false: ...to here
criu-4.2/criu/tty.c:1318:14: call_function: calling ‘add_fake_fle’ from ‘prepare_ctl_tty’
criu-4.2/criu/tty.c:1318:14: return_function: returning to ‘prepare_ctl_tty’ from ‘add_fake_fle’
criu-4.2/criu/tty.c:1319:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1322:15: branch_false: ...to here
criu-4.2/criu/tty.c:1323:9: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1328:19: branch_false: ...to here
criu-4.2/criu/tty.c:1328:19: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1329:13: branch_false: ...to here
criu-4.2/criu/tty.c:1329:13: acquire_memory: allocated here
criu-4.2/criu/tty.c:1329:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1331:13: branch_false: ...to here
criu-4.2/criu/tty.c:1331:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1334:9: branch_false: ...to here
criu-4.2/criu/tty.c:1342:9: throw: if ‘fdinfo_entry__init’ throws an exception...
criu-4.2/criu/tty.c:1342:9: danger: ‘___p’ leaks here; was allocated at [(17)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/16)
# 1340|   	file_desc_add(&ctl_tty->desc, ctl_tty_id, &ctl_tty_desc_ops);
# 1341|   
# 1342|-> 	fdinfo_entry__init(e);
# 1343|   
# 1344|   	e->id = ctl_tty_id;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def879]
criu-4.2/criu/tty.c:1897:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1864:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1877:51: branch_false: ...to here
criu-4.2/criu/tty.c:1878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1881:17: branch_false: ...to here
criu-4.2/criu/tty.c:1881:17: acquire_memory: allocated here
criu-4.2/criu/tty.c:1881:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1885:9: branch_false: ...to here
criu-4.2/criu/tty.c:1894:12: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:1895:30: branch_true: ...to here
criu-4.2/criu/tty.c:1896:20: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:1897:25: branch_true: ...to here
criu-4.2/criu/tty.c:1897:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:1897:25: danger: ‘___p’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
# 1895|   		dinfo->lfd = dup(lfd);
# 1896|   		if (dinfo->lfd < 0) {
# 1897|-> 			pr_perror("Can't dup local fd on %#x", id);
# 1898|   			xfree(dinfo);
# 1899|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def880]
criu-4.2/criu/tty.c:1956:31: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1864:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1877:51: branch_false: ...to here
criu-4.2/criu/tty.c:1878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1881:17: branch_false: ...to here
criu-4.2/criu/tty.c:1881:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1885:9: branch_false: ...to here
criu-4.2/criu/tty.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1935:13: branch_false: ...to here
criu-4.2/criu/tty.c:1935:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1945:12: branch_false: ...to here
criu-4.2/criu/tty.c:1953:24: acquire_memory: allocated here
criu-4.2/criu/tty.c:1953:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1953:9: branch_false: ...to here
criu-4.2/criu/tty.c:1956:31: branch_true: following ‘true’ branch (when ‘___p’ is NULL)...
criu-4.2/criu/tty.c:1956:31: branch_true: ...to here
criu-4.2/criu/tty.c:1956:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:1956:31: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
# 1954|   
# 1955|   	termios_locked.n_c_cc = TERMIOS_NCC;
# 1956|-> 	termios_locked.c_cc = xmalloc(pb_repeated_size(&termios_locked, c_cc));
# 1957|   
# 1958|   	if (!termios.c_cc || !termios_locked.c_cc)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def881]
criu-4.2/criu/tty.c:1963:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1864:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1877:51: branch_false: ...to here
criu-4.2/criu/tty.c:1878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1881:17: branch_false: ...to here
criu-4.2/criu/tty.c:1881:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1885:9: branch_false: ...to here
criu-4.2/criu/tty.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1935:13: branch_false: ...to here
criu-4.2/criu/tty.c:1935:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1945:12: branch_false: ...to here
criu-4.2/criu/tty.c:1953:24: acquire_memory: allocated here
criu-4.2/criu/tty.c:1953:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1953:9: branch_false: ...to here
criu-4.2/criu/tty.c:1956:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1956:9: branch_false: ...to here
criu-4.2/criu/tty.c:1958:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1962:12: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:1963:17: branch_true: ...to here
criu-4.2/criu/tty.c:1963:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:1963:17: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/10)
# 1961|   	memzero(&t, sizeof(t));
# 1962|   	if (ioctl(lfd, TCGETS, &t) < 0) {
# 1963|-> 		pr_perror("Can't get tty params on %#x", id);
# 1964|   		goto out;
# 1965|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def882]
criu-4.2/criu/tty.c:1970:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1864:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1877:51: branch_false: ...to here
criu-4.2/criu/tty.c:1878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1881:17: branch_false: ...to here
criu-4.2/criu/tty.c:1881:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1885:9: branch_false: ...to here
criu-4.2/criu/tty.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1935:13: branch_false: ...to here
criu-4.2/criu/tty.c:1935:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1945:12: branch_false: ...to here
criu-4.2/criu/tty.c:1953:24: acquire_memory: allocated here
criu-4.2/criu/tty.c:1953:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1953:9: branch_false: ...to here
criu-4.2/criu/tty.c:1956:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1956:9: branch_false: ...to here
criu-4.2/criu/tty.c:1958:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1962:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1966:9: branch_false: ...to here
criu-4.2/criu/tty.c:1969:12: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:1970:17: branch_true: ...to here
criu-4.2/criu/tty.c:1970:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:1970:17: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/10)
# 1968|   	memzero(&t, sizeof(t));
# 1969|   	if (ioctl(lfd, TIOCGLCKTRMIOS, &t) < 0) {
# 1970|-> 		pr_perror("Can't get tty locked params on %#x", id);
# 1971|   		goto out;
# 1972|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def883]
criu-4.2/criu/tty.c:1977:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1864:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1877:51: branch_false: ...to here
criu-4.2/criu/tty.c:1878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1881:17: branch_false: ...to here
criu-4.2/criu/tty.c:1881:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1885:9: branch_false: ...to here
criu-4.2/criu/tty.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1935:13: branch_false: ...to here
criu-4.2/criu/tty.c:1935:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1945:12: branch_false: ...to here
criu-4.2/criu/tty.c:1953:24: acquire_memory: allocated here
criu-4.2/criu/tty.c:1953:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1953:9: branch_false: ...to here
criu-4.2/criu/tty.c:1956:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1956:9: branch_false: ...to here
criu-4.2/criu/tty.c:1958:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1962:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1966:9: branch_false: ...to here
criu-4.2/criu/tty.c:1969:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1973:9: branch_false: ...to here
criu-4.2/criu/tty.c:1976:12: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:1977:17: branch_true: ...to here
criu-4.2/criu/tty.c:1977:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:1977:17: danger: ‘___p’ leaks here; was allocated at [(11)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/10)
# 1975|   	memzero(&w, sizeof(w));
# 1976|   	if (ioctl(lfd, TIOCGWINSZ, &w) < 0) {
# 1977|-> 		pr_perror("Can't get tty window params on %#x", id);
# 1978|   		goto out;
# 1979|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def884]
criu-4.2/criu/tty.c:1982:15: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:1849:12: enter_function: entry to ‘dump_tty_info’
criu-4.2/criu/tty.c:1864:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1877:51: branch_false: ...to here
criu-4.2/criu/tty.c:1878:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1881:17: branch_false: ...to here
criu-4.2/criu/tty.c:1881:17: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1885:9: branch_false: ...to here
criu-4.2/criu/tty.c:1925:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1935:13: branch_false: ...to here
criu-4.2/criu/tty.c:1935:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1945:12: branch_false: ...to here
criu-4.2/criu/tty.c:1953:24: acquire_memory: allocated here
criu-4.2/criu/tty.c:1953:24: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1953:9: branch_false: ...to here
criu-4.2/criu/tty.c:1956:31: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:1956:9: branch_false: ...to here
criu-4.2/criu/tty.c:1958:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1962:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1966:9: branch_false: ...to here
criu-4.2/criu/tty.c:1969:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1973:9: branch_false: ...to here
criu-4.2/criu/tty.c:1976:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:1980:9: branch_false: ...to here
criu-4.2/criu/tty.c:1982:15: call_function: calling ‘img_from_set’ from ‘dump_tty_info’
criu-4.2/criu/tty.c:1982:15: return_function: returning to ‘dump_tty_info’ from ‘img_from_set’
criu-4.2/criu/tty.c:1982:15: throw: if ‘pb_write_one’ throws an exception...
criu-4.2/criu/tty.c:1982:15: danger: ‘___p’ leaks here; was allocated at [(12)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/11)
# 1980|   	winsize_copy(&winsize, &w);
# 1981|   
# 1982|-> 	ret = pb_write_one(img_from_set(glob_imgset, CR_FD_TTY_INFO), &info, PB_TTY_INFO);
# 1983|   out:
# 1984|   	xfree(termios.c_cc);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def885]
criu-4.2/criu/tty.c:2092:21: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2102:12: enter_function: entry to ‘tty_do_dump_queued_data’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2113:15: call_function: calling ‘tty_unblock’ from ‘tty_do_dump_queued_data’
# 2090|   
# 2091|   	if ((flags & fmask) != fmask) {
# 2092|-> 		if (fcntl(lfd, F_SETFL, fmask)) {
# 2093|   			ret = -errno;
# 2094|   			pr_perror("Can't change mode to %o on (%#x)", fmask, id);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def886]
criu-4.2/criu/tty.c:2094:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2102:12: enter_function: entry to ‘tty_do_dump_queued_data’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2113:15: call_function: calling ‘tty_unblock’ from ‘tty_do_dump_queued_data’
# 2092|   		if (fcntl(lfd, F_SETFL, fmask)) {
# 2093|   			ret = -errno;
# 2094|-> 			pr_perror("Can't change mode to %o on (%#x)", fmask, id);
# 2095|   			return ret;
# 2096|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def887]
criu-4.2/criu/tty.c:2122:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2114:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2114:12: branch_false: ...to here
criu-4.2/criu/tty.c:2121:20: branch_true: following ‘true’ branch (when ‘ret == 0’)...
criu-4.2/criu/tty.c:2122:25: branch_true: ...to here
criu-4.2/criu/tty.c:2122:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:2122:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
# 2120|   		ret = read(dinfo->lfd, &buf[off], size - off);
# 2121|   		if (ret == 0) {
# 2122|-> 			pr_debug("No more data on tty (%s %#x)\n", dinfo->driver->name, dinfo->id);
# 2123|   			break;
# 2124|   		} else if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def888]
criu-4.2/criu/tty.c:2126:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2114:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2114:12: branch_false: ...to here
criu-4.2/criu/tty.c:2121:20: branch_false: following ‘false’ branch (when ‘ret != 0’)...
criu-4.2/criu/tty.c:2124:27: branch_false: ...to here
criu-4.2/criu/tty.c:2124:27: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/tty.c:2125:29: branch_true: ...to here
criu-4.2/criu/tty.c:2125:28: branch_true: following ‘true’ branch...
criu-4.2/criu/tty.c:2126:33: branch_true: ...to here
criu-4.2/criu/tty.c:2126:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:2126:33: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
# 2124|   		} else if (ret < 0) {
# 2125|   			if (errno == EAGAIN) {
# 2126|-> 				pr_debug("Not waiting data tty (%s %#x)\n", dinfo->driver->name, dinfo->id);
# 2127|   				break;
# 2128|   			} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def889]
criu-4.2/criu/tty.c:2130:33: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2114:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2114:12: branch_false: ...to here
criu-4.2/criu/tty.c:2121:20: branch_false: following ‘false’ branch (when ‘ret != 0’)...
criu-4.2/criu/tty.c:2124:27: branch_false: ...to here
criu-4.2/criu/tty.c:2125:28: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2129:33: branch_false: ...to here
criu-4.2/criu/tty.c:2130:33: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:2130:33: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
# 2128|   			} else {
# 2129|   				ret = -errno;
# 2130|-> 				pr_perror("Can't read data from tty (%s %#x)", dinfo->driver->name, dinfo->id);
# 2131|   				xfree(buf);
# 2132|   				return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def890]
criu-4.2/criu/tty.c:2137:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2114:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2114:12: branch_false: ...to here
criu-4.2/criu/tty.c:2121:20: branch_false: following ‘false’ branch (when ‘ret != 0’)...
criu-4.2/criu/tty.c:2124:27: branch_false: ...to here
criu-4.2/criu/tty.c:2124:27: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/tty.c:2136:21: branch_false: ...to here
criu-4.2/criu/tty.c:2137:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:2137:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
# 2135|   
# 2136|   		off += ret;
# 2137|-> 		pr_debug("Read %d bytes (%d) from tty (%s %#x)\n", ret, (int)off, dinfo->driver->name, dinfo->id);
# 2138|   
# 2139|   		if (off >= size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def891]
criu-4.2/criu/tty.c:2140:25: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tty.c:2109:15: acquire_memory: allocated here
criu-4.2/criu/tty.c:2109:15: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tty.c:2113:15: branch_false: ...to here
criu-4.2/criu/tty.c:2114:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2114:12: branch_false: ...to here
criu-4.2/criu/tty.c:2121:20: branch_false: following ‘false’ branch (when ‘ret != 0’)...
criu-4.2/criu/tty.c:2124:27: branch_false: ...to here
criu-4.2/criu/tty.c:2124:27: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/tty.c:2136:21: branch_false: ...to here
criu-4.2/criu/tty.c:2140:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tty.c:2140:25: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
# 2138|   
# 2139|   		if (off >= size) {
# 2140|-> 			pr_err("The tty (%s %#x) queued data overflow %zu bytes limit\n", dinfo->driver->name,
# 2141|   			       dinfo->id, size);
# 2142|   			off = size;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def892]
criu-4.2/criu/tty.c:2433:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(service_mountpoint(pm), 0)’
criu-4.2/criu/tty.c:2427:15: acquire_resource: opened here
criu-4.2/criu/tty.c:2428:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tty.c:2433:9: branch_false: ...to here
criu-4.2/criu/tty.c:2433:9: danger: ‘open(service_mountpoint(pm), 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
# 2431|   	}
# 2432|   
# 2433|-> 	list_for_each_entry(bm, &pm->mnt_bind, mnt_bind) {
# 2434|   		int idx;
# 2435|   		struct stat st;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def893]
criu-4.2/criu/tun.c:88:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/net/tun", 0)’
criu-4.2/criu/tun.c:83:15: acquire_resource: opened here
criu-4.2/criu/tun.c:84:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tun.c:88:9: branch_false: ...to here
criu-4.2/criu/tun.c:88:9: throw: if ‘check_has_netns_ioc’ throws an exception...
criu-4.2/criu/tun.c:88:9: danger: ‘open("/dev/net/tun", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   86|   		goto out;
#   87|   	}
#   88|-> 	check_has_netns_ioc(tun, &val, "tun");
#   89|   	close(tun);
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def894]
criu-4.2/criu/tun.c:124:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tun.c:120:14: acquire_memory: allocated here
criu-4.2/criu/tun.c:120:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tun.c:124:29: branch_false: ...to here
criu-4.2/criu/tun.c:124:9: throw: if ‘__strlcpy’ throws an exception...
criu-4.2/criu/tun.c:124:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  122|   		return -1;
#  123|   
#  124|-> 	__strlcpy(tl->name, nde->name, sizeof(tl->name));
#  125|   	/*
#  126|   	 * Keep tun-flags not only for persistency fixup (see

Error: GCC_ANALYZER_WARNING (CWE-401): [#def895]
criu-4.2/criu/tun.c:156:9: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/tun.c:153:14: acquire_memory: allocated here
criu-4.2/criu/tun.c:153:14: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/tun.c:156:19: branch_false: ...to here
criu-4.2/criu/tun.c:156:9: throw: if ‘__strlcpy’ throws an exception...
criu-4.2/criu/tun.c:156:9: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  154|   	if (!tl)
#  155|   		goto err;
#  156|-> 	__strlcpy(tl->name, name, sizeof(tl->name));
#  157|   	tl->ns_id = ns_id;
#  158|   	INIT_LIST_HEAD(&tl->l);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def896]
criu-4.2/criu/tun.c:235:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/net/tun", 2)’
criu-4.2/criu/tun.c:229:14: acquire_resource: opened here
criu-4.2/criu/tun.c:230:12: branch_false: following ‘false’ branch...
criu-4.2/criu/tun.c:235:13: branch_false: ...to here
criu-4.2/criu/tun.c:235:12: branch_true: following ‘true’ branch...
criu-4.2/criu/tun.c:236:17: branch_true: ...to here
criu-4.2/criu/tun.c:236:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/tun.c:235:13: danger: ‘open("/dev/net/tun", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  233|   	}
#  234|   
#  235|-> 	if (idx) {
#  236|   		pr_debug("  restoring %u for %s tun\n", idx, name);
#  237|   		if (ioctl(fd, TUNSETIFINDEX, &idx) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def897]
criu-4.2/criu/uffd.c:124:9: warning[-Wanalyzer-malloc-leak]: leak of ‘lpi_init()’
criu-4.2/criu/uffd.c:1368:12: enter_function: entry to ‘prepare_uffds’
criu-4.2/criu/uffd.c:1377:12: branch_false: following ‘false’ branch...
criu-4.2/criu/uffd.c:1377:12: branch_false: ...to here
criu-4.2/criu/uffd.c:1383:21: branch_true: following ‘true’ branch...
criu-4.2/criu/uffd.c:1384:41: branch_true: ...to here
criu-4.2/criu/uffd.c:1385:21: call_function: calling ‘ud_open’ from ‘prepare_uffds’
#  122|   
#  123|   	memset(lpi, 0, sizeof(*lpi));
#  124|-> 	INIT_LIST_HEAD(&lpi->iovs);
#  125|   	INIT_LIST_HEAD(&lpi->reqs);
#  126|   	INIT_LIST_HEAD(&lpi->l);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def898]
criu-4.2/criu/uffd.c:388:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/criu/uffd.c:1313:12: enter_function: entry to ‘prepare_lazy_socket’
criu-4.2/criu/uffd.c:1318:12: branch_false: following ‘false’ branch...
criu-4.2/criu/uffd.c:1321:9: branch_false: ...to here
criu-4.2/criu/uffd.c:1322:23: call_function: calling ‘server_listen’ from ‘prepare_lazy_socket’
#  386|   
#  387|   out:
#  388|-> 	close(fd);
#  389|   	return -1;
#  390|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def899]
criu-4.2/criu/util.c:123:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
criu-4.2/criu/util.c:163:7: enter_function: entry to ‘xsprintf’
criu-4.2/criu/util.c:168:9: acquire_resource: ‘va_start’ called here
criu-4.2/criu/util.c:169:15: call_function: calling ‘xvstrcat’ from ‘xsprintf’
#  121|   
#  122|   	do {
#  123|-> 		new = xrealloc(str, offset + delta);
#  124|   		if (!new) {
#  125|   			/* realloc failed. We must release former string */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def900]
criu-4.2/criu/util.c:127:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
criu-4.2/criu/util.c:163:7: enter_function: entry to ‘xsprintf’
criu-4.2/criu/util.c:168:9: acquire_resource: ‘va_start’ called here
criu-4.2/criu/util.c:169:15: call_function: calling ‘xvstrcat’ from ‘xsprintf’
#  125|   			/* realloc failed. We must release former string */
#  126|   			xfree(str);
#  127|-> 			pr_err("Failed to allocate string\n");
#  128|   			return new;
#  129|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def901]
criu-4.2/criu/util.c:145:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/util.c:123:23: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/util.c:131:17: branch_false: ...to here
criu-4.2/criu/util.c:134:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:143:12: branch_true: ...to here
criu-4.2/criu/util.c:143:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
criu-4.2/criu/util.c:145:17: branch_true: ...to here
criu-4.2/criu/util.c:145:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/util.c:145:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  143|   	if (ret < 0) {
#  144|   		/* vsnprintf failed */
#  145|-> 		pr_err("Failed to print string\n");
#  146|   		xfree(new);
#  147|   		new = NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def902]
criu-4.2/criu/util.c:224:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  222|   
#  223|   	if (*fd > -1) {
#  224|-> 		ret = close(*fd);
#  225|   		if (!ret)
#  226|   			*fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def903]
criu-4.2/criu/util.c:224:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/util.c:234:5: enter_function: entry to ‘reopen_fd_as_safe’
criu-4.2/criu/util.c:238:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:239:20: branch_true: ...to here
criu-4.2/criu/util.c:239:20: branch_true: following ‘true’ branch (when ‘allow_reuse_fd != 0’)...
criu-4.2/criu/util.c:242:31: branch_true: ...to here
criu-4.2/criu/util.c:242:31: acquire_resource: opened here
criu-4.2/criu/util.c:243:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/util.c:246:27: branch_false: ...to here
criu-4.2/criu/util.c:246:27: branch_false: following ‘false’ branch (when ‘tmp == new_fd’)...
criu-4.2/criu/util.c:253:17: branch_false: ...to here
criu-4.2/criu/util.c:253:17: call_function: calling ‘close_safe’ from ‘reopen_fd_as_safe’
#  222|   
#  223|   	if (*fd > -1) {
#  224|-> 		ret = close(*fd);
#  225|   		if (!ret)
#  226|   			*fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def904]
criu-4.2/criu/util.c:228:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  226|   			*fd = -1;
#  227|   		else
#  228|-> 			pr_perror("Unable to close fd %d", *fd);
#  229|   	}
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def905]
criu-4.2/criu/util.c:228:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/util.c:234:5: enter_function: entry to ‘reopen_fd_as_safe’
criu-4.2/criu/util.c:238:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:239:20: branch_true: ...to here
criu-4.2/criu/util.c:239:20: branch_true: following ‘true’ branch (when ‘allow_reuse_fd != 0’)...
criu-4.2/criu/util.c:242:31: branch_true: ...to here
criu-4.2/criu/util.c:242:31: acquire_resource: opened here
criu-4.2/criu/util.c:243:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/util.c:246:27: branch_false: ...to here
criu-4.2/criu/util.c:246:27: branch_false: following ‘false’ branch (when ‘tmp == new_fd’)...
criu-4.2/criu/util.c:253:17: branch_false: ...to here
criu-4.2/criu/util.c:253:17: call_function: calling ‘close_safe’ from ‘reopen_fd_as_safe’
#  226|   			*fd = -1;
#  227|   		else
#  228|-> 			pr_perror("Unable to close fd %d", *fd);
#  229|   	}
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def906]
criu-4.2/criu/util.c:231:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/util.c:238:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:239:20: branch_true: ...to here
criu-4.2/criu/util.c:239:20: branch_true: following ‘true’ branch (when ‘allow_reuse_fd != 0’)...
criu-4.2/criu/util.c:242:31: branch_true: ...to here
criu-4.2/criu/util.c:242:31: acquire_resource: opened here
criu-4.2/criu/util.c:243:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/util.c:246:27: branch_false: ...to here
criu-4.2/criu/util.c:246:27: branch_false: following ‘false’ branch (when ‘tmp == new_fd’)...
criu-4.2/criu/util.c:253:17: branch_false: ...to here
criu-4.2/criu/util.c:231:16: danger: ‘tmp’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  229|   	}
#  230|   
#  231|-> 	return ret;
#  232|   }
#  233|   

Error: GCC_ANALYZER_WARNING: [#def907]
criu-4.2/criu/util.c:242:31: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘new_fd’
criu-4.2/criu/util.c:570:5: enter_function: entry to ‘cr_system_userns’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:605:21: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:21: branch_false: ...to here
criu-4.2/criu/util.c:618:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:57: branch_false: ...to here
criu-4.2/criu/util.c:618:57: call_function: calling ‘move_fd_from’ from ‘cr_system_userns’
criu-4.2/criu/util.c:618:57: return_function: returning to ‘cr_system_userns’ from ‘move_fd_from’
criu-4.2/criu/util.c:618:21: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:621:20: branch_false: ...to here
criu-4.2/criu/util.c:621:20: branch_false: following ‘false’ branch (when ‘in >= 0’)...
criu-4.2/criu/util.c:624:29: branch_false: ...to here
criu-4.2/criu/util.c:624:29: call_function: calling ‘reopen_fd_as_safe’ from ‘cr_system_userns’
#  240|   			tmp = fcntl(old_fd, F_DUPFD, new_fd);
#  241|   		else
#  242|-> 			tmp = dup2(old_fd, new_fd);
#  243|   		if (tmp < 0) {
#  244|   			pr_perror("Dup %d -> %d failed (called at %s:%d)", old_fd, new_fd, file, line);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def908]
criu-4.2/criu/util.c:244:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  242|   			tmp = dup2(old_fd, new_fd);
#  243|   		if (tmp < 0) {
#  244|-> 			pr_perror("Dup %d -> %d failed (called at %s:%d)", old_fd, new_fd, file, line);
#  245|   			return tmp;
#  246|   		} else if (tmp != new_fd) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def909]
criu-4.2/criu/util.c:247:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  245|   			return tmp;
#  246|   		} else if (tmp != new_fd) {
#  247|-> 			close(tmp);
#  248|   			pr_err("fd %d already in use (called at %s:%d)\n", new_fd, file, line);
#  249|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def910]
criu-4.2/criu/util.c:247:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/util.c:238:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:239:20: branch_true: ...to here
criu-4.2/criu/util.c:239:20: branch_true: following ‘true’ branch (when ‘allow_reuse_fd != 0’)...
criu-4.2/criu/util.c:242:31: branch_true: ...to here
criu-4.2/criu/util.c:242:31: acquire_resource: opened here
criu-4.2/criu/util.c:243:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/util.c:246:27: branch_false: ...to here
criu-4.2/criu/util.c:246:27: branch_true: following ‘true’ branch (when ‘tmp != new_fd’)...
criu-4.2/criu/util.c:247:25: branch_true: ...to here
criu-4.2/criu/util.c:247:25: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:247:25: danger: ‘tmp’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  245|   			return tmp;
#  246|   		} else if (tmp != new_fd) {
#  247|-> 			close(tmp);
#  248|   			pr_err("fd %d already in use (called at %s:%d)\n", new_fd, file, line);
#  249|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def911]
criu-4.2/criu/util.c:248:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  246|   		} else if (tmp != new_fd) {
#  247|   			close(tmp);
#  248|-> 			pr_err("fd %d already in use (called at %s:%d)\n", new_fd, file, line);
#  249|   			return -1;
#  250|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def912]
criu-4.2/criu/util.c:266:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  264|   		tmp = dup(*img_fd);
#  265|   		if (tmp < 0) {
#  266|-> 			pr_perror("Can't dup file");
#  267|   			return -1;
#  268|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def913]
criu-4.2/criu/util.c:266:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out’
criu-4.2/criu/util.c:570:5: enter_function: entry to ‘cr_system_userns’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:604:31: branch_true: ...to here
criu-4.2/criu/util.c:604:31: acquire_resource: opened here
criu-4.2/criu/util.c:604:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:604:25: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:21: branch_false: ...to here
criu-4.2/criu/util.c:618:21: call_function: calling ‘move_fd_from’ from ‘cr_system_userns’
#  264|   		tmp = dup(*img_fd);
#  265|   		if (tmp < 0) {
#  266|-> 			pr_perror("Can't dup file");
#  267|   			return -1;
#  268|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def914]
criu-4.2/criu/util.c:270:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  268|   		}
#  269|   
#  270|-> 		close(*img_fd);
#  271|   
#  272|   		*img_fd = tmp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def915]
criu-4.2/criu/util.c:270:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out’
criu-4.2/criu/util.c:570:5: enter_function: entry to ‘cr_system_userns’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:604:31: branch_true: ...to here
criu-4.2/criu/util.c:604:31: acquire_resource: opened here
criu-4.2/criu/util.c:604:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:604:25: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:21: branch_false: ...to here
criu-4.2/criu/util.c:618:21: call_function: calling ‘move_fd_from’ from ‘cr_system_userns’
#  268|   		}
#  269|   
#  270|-> 		close(*img_fd);
#  271|   
#  272|   		*img_fd = tmp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def916]
criu-4.2/criu/util.c:270:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.2/criu/util.c:261:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:264:23: branch_true: ...to here
criu-4.2/criu/util.c:264:23: acquire_resource: opened here
criu-4.2/criu/util.c:265:20: branch_false: following ‘false’ branch (when ‘tmp >= 0’)...
criu-4.2/criu/util.c:270:17: branch_false: ...to here
criu-4.2/criu/util.c:270:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:270:17: danger: ‘tmp’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  268|   		}
#  269|   
#  270|-> 		close(*img_fd);
#  271|   
#  272|   		*img_fd = tmp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def917]
criu-4.2/criu/util.c:357:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘_fd’
criu-4.2/criu/util.c:352:15: acquire_resource: opened here
criu-4.2/criu/util.c:353:12: branch_false: following ‘false’ branch (when ‘_fd >= 0’)...
criu-4.2/criu/util.c:357:13: branch_false: ...to here
criu-4.2/criu/util.c:357:13: throw: if ‘install_service_fd’ throws an exception...
criu-4.2/criu/util.c:357:13: danger: ‘_fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
#  355|   		return -1;
#  356|   	}
#  357|-> 	if (install_service_fd(PROC_FD_OFF, _fd) < 0)
#  358|   		return -1;
#  359|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def918]
criu-4.2/criu/util.c:373:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 2162688)’
criu-4.2/criu/util.c:367:14: acquire_resource: opened here
criu-4.2/criu/util.c:368:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:373:15: branch_false: ...to here
criu-4.2/criu/util.c:373:15: danger: ‘open(path, 2162688)’ leaks here; was opened at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
#  371|   	}
#  372|   
#  373|-> 	ret = install_service_fd(PROC_FD_OFF, fd);
#  374|   	if (ret < 0)
#  375|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def919]
criu-4.2/criu/util.c:579:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  577|   	sigaddset(&blockmask, SIGCHLD);
#  578|   	if (sigprocmask(SIG_BLOCK, &blockmask, &oldmask) == -1) {
#  579|-> 		pr_perror("Cannot set mask of blocked signals");
#  580|   		return -1;
#  581|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def920]
criu-4.2/criu/util.c:579:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  577|   	sigaddset(&blockmask, SIGCHLD);
#  578|   	if (sigprocmask(SIG_BLOCK, &blockmask, &oldmask) == -1) {
#  579|-> 		pr_perror("Cannot set mask of blocked signals");
#  580|   		return -1;
#  581|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def921]
criu-4.2/criu/util.c:585:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  583|   	pid = fork();
#  584|   	if (pid == -1) {
#  585|-> 		pr_perror("fork() failed");
#  586|   		goto out;
#  587|   	} else if (pid == 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def922]
criu-4.2/criu/util.c:585:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  583|   	pid = fork();
#  584|   	if (pid == -1) {
#  585|-> 		pr_perror("fork() failed");
#  586|   		goto out;
#  587|   	} else if (pid == 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def923]
criu-4.2/criu/util.c:590:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  588|   		sigemptyset(&blockmask);
#  589|   		if (sigprocmask(SIG_SETMASK, &blockmask, NULL) == -1) {
#  590|-> 			pr_perror("Cannot clear blocked signals");
#  591|   			goto out_chld;
#  592|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def924]
criu-4.2/criu/util.c:590:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  588|   		sigemptyset(&blockmask);
#  589|   		if (sigprocmask(SIG_SETMASK, &blockmask, NULL) == -1) {
#  590|-> 			pr_perror("Cannot clear blocked signals");
#  591|   			goto out_chld;
#  592|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def925]
criu-4.2/criu/util.c:604:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  602|   
#  603|   		if (out < 0)
#  604|-> 			out = DUP_SAFE(log_get_fd(), out_chld);
#  605|   		if (err < 0)
#  606|   			err = DUP_SAFE(log_get_fd(), out_chld);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def926]
criu-4.2/criu/util.c:604:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  602|   
#  603|   		if (out < 0)
#  604|-> 			out = DUP_SAFE(log_get_fd(), out_chld);
#  605|   		if (err < 0)
#  606|   			err = DUP_SAFE(log_get_fd(), out_chld);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def927]
criu-4.2/criu/util.c:606:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:604:31: branch_true: ...to here
criu-4.2/criu/util.c:604:31: acquire_resource: opened here
criu-4.2/criu/util.c:604:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:604:25: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:606:31: branch_true: ...to here
criu-4.2/criu/util.c:606:31: throw: if ‘log_get_fd’ throws an exception...
criu-4.2/criu/util.c:606:31: danger: ‘out’ leaks here; was opened at [(11)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/10)
#  604|   			out = DUP_SAFE(log_get_fd(), out_chld);
#  605|   		if (err < 0)
#  606|-> 			err = DUP_SAFE(log_get_fd(), out_chld);
#  607|   
#  608|   		/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def928]
criu-4.2/criu/util.c:606:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  604|   			out = DUP_SAFE(log_get_fd(), out_chld);
#  605|   		if (err < 0)
#  606|-> 			err = DUP_SAFE(log_get_fd(), out_chld);
#  607|   
#  608|   		/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def929]
criu-4.2/criu/util.c:606:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.2/criu/util.c:1710:12: enter_function: entry to ‘is_iptables_nft’
criu-4.2/criu/util.c:1716:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1721:15: branch_false: ...to here
criu-4.2/criu/util.c:1721:15: call_function: inlined call to ‘cr_system’ from ‘is_iptables_nft’
#  604|   			out = DUP_SAFE(log_get_fd(), out_chld);
#  605|   		if (err < 0)
#  606|-> 			err = DUP_SAFE(log_get_fd(), out_chld);
#  607|   
#  608|   		/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def930]
criu-4.2/criu/util.c:613:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:605:21: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:606:31: branch_true: ...to here
criu-4.2/criu/util.c:606:31: acquire_resource: opened here
criu-4.2/criu/util.c:606:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:606:25: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:613:31: branch_true: ...to here
criu-4.2/criu/util.c:613:31: branch_true: following ‘true’ branch (when ‘ret__ == -1’)...
criu-4.2/criu/util.c:613:31: branch_true: ...to here
criu-4.2/criu/util.c:613:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/util.c:613:31: danger: ‘err’ leaks here; was opened at [(13)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/12)
#  611|   		 */
#  612|   		if (err == out || err == in)
#  613|-> 			err = DUP_SAFE(err, out_chld);
#  614|   
#  615|   		if (out == in)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def931]
criu-4.2/criu/util.c:613:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:604:31: branch_true: ...to here
criu-4.2/criu/util.c:604:31: acquire_resource: opened here
criu-4.2/criu/util.c:604:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:604:25: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:613:31: branch_true: ...to here
criu-4.2/criu/util.c:613:31: branch_true: following ‘true’ branch (when ‘ret__ == -1’)...
criu-4.2/criu/util.c:613:31: branch_true: ...to here
criu-4.2/criu/util.c:613:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/util.c:613:31: danger: ‘out’ leaks here; was opened at [(11)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/10)
#  611|   		 */
#  612|   		if (err == out || err == in)
#  613|-> 			err = DUP_SAFE(err, out_chld);
#  614|   
#  615|   		if (out == in)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def932]
criu-4.2/criu/util.c:616:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:605:21: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:613:31: branch_true: ...to here
criu-4.2/criu/util.c:613:31: acquire_resource: opened here
criu-4.2/criu/util.c:613:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:613:25: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:616:31: branch_true: ...to here
criu-4.2/criu/util.c:616:31: branch_true: following ‘true’ branch (when ‘ret__ == -1’)...
criu-4.2/criu/util.c:616:31: branch_true: ...to here
criu-4.2/criu/util.c:616:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/util.c:616:31: danger: ‘err’ leaks here; was opened at [(15)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/14)
#  614|   
#  615|   		if (out == in)
#  616|-> 			out = DUP_SAFE(out, out_chld);
#  617|   
#  618|   		if (move_fd_from(&out, STDIN_FILENO) || move_fd_from(&err, STDIN_FILENO))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def933]
criu-4.2/criu/util.c:616:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:604:31: branch_true: ...to here
criu-4.2/criu/util.c:604:31: acquire_resource: opened here
criu-4.2/criu/util.c:604:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:604:25: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:616:31: branch_true: ...to here
criu-4.2/criu/util.c:616:31: branch_true: following ‘true’ branch (when ‘ret__ == -1’)...
criu-4.2/criu/util.c:616:31: branch_true: ...to here
criu-4.2/criu/util.c:616:31: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/util.c:616:31: danger: ‘out’ leaks here; was opened at [(11)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/10)
#  614|   
#  615|   		if (out == in)
#  616|-> 			out = DUP_SAFE(out, out_chld);
#  617|   
#  618|   		if (move_fd_from(&out, STDIN_FILENO) || move_fd_from(&err, STDIN_FILENO))

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def934]
criu-4.2/criu/util.c:622:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘0’
criu-4.2/criu/util.c:570:5: enter_function: entry to ‘cr_system_userns’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:605:21: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:21: branch_false: ...to here
criu-4.2/criu/util.c:618:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:57: branch_false: ...to here
criu-4.2/criu/util.c:618:57: call_function: calling ‘move_fd_from’ from ‘cr_system_userns’
criu-4.2/criu/util.c:618:57: return_function: returning to ‘cr_system_userns’ from ‘move_fd_from’
criu-4.2/criu/util.c:618:21: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:621:20: branch_false: ...to here
criu-4.2/criu/util.c:621:20: branch_true: following ‘true’ branch (when ‘in < 0’)...
criu-4.2/criu/util.c:622:25: branch_true: ...to here
criu-4.2/criu/util.c:622:25: danger: second ‘close’ here; first ‘close’ was at [(26)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/25)
#  620|   
#  621|   		if (in < 0) {
#  622|-> 			close(STDIN_FILENO);
#  623|   		} else {
#  624|   			if (reopen_fd_as_nocheck(STDIN_FILENO, in))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def935]
criu-4.2/criu/util.c:622:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘err’
criu-4.2/criu/util.c:570:5: enter_function: entry to ‘cr_system_userns’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:605:21: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:21: branch_false: ...to here
criu-4.2/criu/util.c:618:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:57: branch_false: ...to here
criu-4.2/criu/util.c:618:57: call_function: calling ‘move_fd_from’ from ‘cr_system_userns’
criu-4.2/criu/util.c:618:57: return_function: returning to ‘cr_system_userns’ from ‘move_fd_from’
criu-4.2/criu/util.c:618:21: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:621:20: branch_false: ...to here
criu-4.2/criu/util.c:621:20: branch_true: following ‘true’ branch (when ‘in < 0’)...
criu-4.2/criu/util.c:622:25: branch_true: ...to here
criu-4.2/criu/util.c:622:25: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:622:25: danger: ‘err’ leaks here; was opened at [(24)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/23)
#  620|   
#  621|   		if (in < 0) {
#  622|-> 			close(STDIN_FILENO);
#  623|   		} else {
#  624|   			if (reopen_fd_as_nocheck(STDIN_FILENO, in))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def936]
criu-4.2/criu/util.c:622:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
criu-4.2/criu/util.c:587:19: branch_false: ...to here
criu-4.2/criu/util.c:587:19: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/util.c:588:17: branch_true: ...to here
criu-4.2/criu/util.c:589:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:594:20: branch_false: ...to here
criu-4.2/criu/util.c:603:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:604:31: branch_true: ...to here
criu-4.2/criu/util.c:604:31: acquire_resource: opened here
criu-4.2/criu/util.c:604:31: branch_false: following ‘false’ branch (when ‘ret__ != -1’)...
criu-4.2/criu/util.c:604:25: branch_false: ...to here
criu-4.2/criu/util.c:605:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:612:21: branch_false: ...to here
criu-4.2/criu/util.c:612:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:615:20: branch_false: ...to here
criu-4.2/criu/util.c:615:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:618:21: branch_false: ...to here
criu-4.2/criu/util.c:618:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:621:20: branch_true: following ‘true’ branch (when ‘in < 0’)...
criu-4.2/criu/util.c:622:25: branch_true: ...to here
criu-4.2/criu/util.c:622:25: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:622:25: danger: ‘out’ leaks here; was opened at [(11)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/10)
#  620|   
#  621|   		if (in < 0) {
#  622|-> 			close(STDIN_FILENO);
#  623|   		} else {
#  624|   			if (reopen_fd_as_nocheck(STDIN_FILENO, in))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def937]
criu-4.2/criu/util.c:673:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/util.c:578:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:583:15: branch_false: ...to here
criu-4.2/criu/util.c:584:12: branch_true: following ‘true’ branch (when ‘pid == -1’)...
criu-4.2/criu/util.c:585:17: branch_true: ...to here
criu-4.2/criu/util.c:671:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:672:17: branch_true: ...to here
criu-4.2/criu/util.c:673:17: danger: dereference of NULL ‘0’
#  671|   	if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) {
#  672|   		pr_perror("Can not unset mask of blocked signals");
#  673|-> 		BUG();
#  674|   	}
#  675|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def938]
criu-4.2/criu/util.c:801:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
criu-4.2/criu/util.c:787:12: branch_true: following ‘true’ branch (when ‘noclose == 0’)...
criu-4.2/criu/util.c:790:20: branch_true: ...to here
criu-4.2/criu/util.c:790:20: branch_false: following ‘false’ branch (when ‘close_fd == -1’)...
criu-4.2/criu/util.c:793:22: branch_false: ...to here
criu-4.2/criu/util.c:793:22: acquire_resource: opened here
criu-4.2/criu/util.c:794:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:798:17: branch_false: ...to here
criu-4.2/criu/util.c:801:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(5)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/4)
#  799|   		dup2(fd, 1);
#  800|   		dup2(fd, 2);
#  801|-> 		close(fd);
#  802|   	}
#  803|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def939]
criu-4.2/criu/util.c:840:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(dirfd)’
criu-4.2/criu/util.c:833:16: acquire_memory: allocated here
criu-4.2/criu/util.c:834:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:834:12: branch_false: ...to here
criu-4.2/criu/util.c:840:22: throw: if ‘readdir’ throws an exception...
criu-4.2/criu/util.c:840:22: danger: ‘fdopendir(dirfd)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/0)
#  838|   	}
#  839|   
#  840|-> 	while ((de = readdir(fdir))) {
#  841|   		if (dir_dots(de))
#  842|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def940]
criu-4.2/criu/util.c:898:17: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.2/criu/util.c:895:13: acquire_memory: allocated here
criu-4.2/criu/util.c:895:13: branch_false: following ‘false’ branch (when ‘___p’ is non-NULL)...
criu-4.2/criu/util.c:897:36: branch_false: ...to here
criu-4.2/criu/util.c:898:17: throw: if ‘vma_entry__init’ throws an exception...
criu-4.2/criu/util.c:898:17: danger: ‘___p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/0)
#  896|   	if (p) {
#  897|   		p->e = (VmaEntry *)(p + 1);
#  898|-> 		vma_entry__init(p->e);
#  899|   		p->e->fd = -1;
#  900|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def941]
criu-4.2/criu/util.c:1244:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/util.c:1213:5: enter_function: entry to ‘setup_tcp_server’
criu-4.2/criu/util.c:1220:13: call_function: calling ‘get_sockaddr_in’ from ‘setup_tcp_server’
criu-4.2/criu/util.c:1220:13: return_function: returning to ‘setup_tcp_server’ from ‘get_sockaddr_in’
criu-4.2/criu/util.c:1220:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1224:9: branch_false: ...to here
criu-4.2/criu/util.c:1226:14: acquire_resource: stream socket created here
criu-4.2/criu/util.c:1228:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/util.c:1233:13: branch_false: ...to here
criu-4.2/criu/util.c:1233:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1238:13: branch_false: ...to here
criu-4.2/criu/util.c:1238:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1243:13: branch_false: ...to here
criu-4.2/criu/util.c:1243:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1244:17: branch_true: ...to here
criu-4.2/criu/util.c:1244:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/util.c:1244:17: danger: ‘sk’ leaks here
# 1242|   
# 1243|   	if (listen(sk, 1)) {
# 1244|-> 		pr_perror("Can't listen on %s server socket", type);
# 1245|   		goto out;
# 1246|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def942]
criu-4.2/criu/util.c:1266:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/util.c:1213:5: enter_function: entry to ‘setup_tcp_server’
criu-4.2/criu/util.c:1220:13: call_function: calling ‘get_sockaddr_in’ from ‘setup_tcp_server’
criu-4.2/criu/util.c:1220:13: return_function: returning to ‘setup_tcp_server’ from ‘get_sockaddr_in’
criu-4.2/criu/util.c:1220:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1224:9: branch_false: ...to here
criu-4.2/criu/util.c:1226:14: acquire_resource: stream socket created here
criu-4.2/criu/util.c:1228:12: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/util.c:1233:13: branch_false: ...to here
criu-4.2/criu/util.c:1233:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1238:13: branch_false: ...to here
criu-4.2/criu/util.c:1238:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1243:13: branch_false: ...to here
criu-4.2/criu/util.c:1243:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1244:17: branch_true: ...to here
criu-4.2/criu/util.c:1266:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:1266:9: danger: ‘sk’ leaks here
# 1264|   	return sk;
# 1265|   out:
# 1266|-> 	close(sk);
# 1267|   	return -1;
# 1268|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def943]
criu-4.2/criu/util.c:1371:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
criu-4.2/criu/util.c:1324:5: enter_function: entry to ‘setup_tcp_client’
criu-4.2/criu/util.c:1341:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1350:14: branch_false: ...to here
criu-4.2/criu/util.c:1350:29: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
criu-4.2/criu/util.c:1351:21: branch_true: ...to here
criu-4.2/criu/util.c:1351:20: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1352:45: branch_true: ...to here
criu-4.2/criu/util.c:1362:21: call_function: calling ‘get_sockaddr_in’ from ‘setup_tcp_client’
criu-4.2/criu/util.c:1362:21: return_function: returning to ‘setup_tcp_client’ from ‘get_sockaddr_in’
criu-4.2/criu/util.c:1362:20: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1365:29: branch_false: ...to here
criu-4.2/criu/util.c:1365:22: acquire_resource: stream socket created here
criu-4.2/criu/util.c:1366:20: branch_false: following ‘false’ branch (when ‘sk >= 0’)...
criu-4.2/criu/util.c:1371:21: branch_false: ...to here
criu-4.2/criu/util.c:1371:21: throw: if ‘connect’ throws an exception...
criu-4.2/criu/util.c:1371:21: danger: ‘sk’ leaks here
# 1369|   		}
# 1370|   
# 1371|-> 		if (connect(sk, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
# 1372|   			pr_info("Can't connect to server %s:%u\n", ipstr, opts.port);
# 1373|   			close(sk);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def944]
criu-4.2/criu/util.c:1955:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:2015:9: branch_false: ...to here
criu-4.2/criu/util.c:2023:16: call_function: calling ‘wait_for_pid’ from ‘run_command’
# 1953|   
# 1954|   again:
# 1955|-> 	ret = waitpid(pid, &status, 0);
# 1956|   	if (ret == -1) {
# 1957|   		if (errno == EINTR)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def945]
criu-4.2/criu/util.c:1987:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1987:17: branch_true: ...to here
criu-4.2/criu/util.c:1987:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:1987:17: danger: ‘pipefd[0]’ leaks here
# 1985|   	child = raw_clone(0, NULL);
# 1986|   	if (child < 0) {
# 1987|-> 		close(pipefd[0]);
# 1988|   		close(pipefd[1]);
# 1989|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def946]
criu-4.2/criu/util.c:1987:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1987:17: branch_true: ...to here
criu-4.2/criu/util.c:1987:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:1987:17: danger: ‘pipefd[1]’ leaks here
# 1985|   	child = raw_clone(0, NULL);
# 1986|   	if (child < 0) {
# 1987|-> 		close(pipefd[0]);
# 1988|   		close(pipefd[1]);
# 1989|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def947]
criu-4.2/criu/util.c:1988:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1987:17: branch_true: ...to here
criu-4.2/criu/util.c:1988:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:1988:17: danger: ‘pipefd[1]’ leaks here
# 1986|   	if (child < 0) {
# 1987|   		close(pipefd[0]);
# 1988|-> 		close(pipefd[1]);
# 1989|   		return -1;
# 1990|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def948]
criu-4.2/criu/util.c:1994:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1994:17: branch_true: ...to here
criu-4.2/criu/util.c:1994:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:1994:17: danger: ‘pipefd[0]’ leaks here
# 1992|   	if (child == 0) {
# 1993|   		/* Close the read-end of the pipe. */
# 1994|-> 		close(pipefd[0]);
# 1995|   
# 1996|   		/* Redirect std{err,out} to write-end of the

Error: GCC_ANALYZER_WARNING (CWE-775): [#def949]
criu-4.2/criu/util.c:1994:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1994:17: branch_true: ...to here
criu-4.2/criu/util.c:1994:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:1994:17: danger: ‘pipefd[1]’ leaks here
# 1992|   	if (child == 0) {
# 1993|   		/* Close the read-end of the pipe. */
# 1994|-> 		close(pipefd[0]);
# 1995|   
# 1996|   		/* Redirect std{err,out} to write-end of the

Error: GCC_ANALYZER_WARNING (CWE-775): [#def950]
criu-4.2/criu/util.c:2004:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1994:17: branch_true: ...to here
criu-4.2/criu/util.c:2000:20: branch_false: following ‘false’ branch (when ‘ret < 0’)...
criu-4.2/criu/util.c:2004:17: branch_false: ...to here
criu-4.2/criu/util.c:2004:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:2004:17: danger: ‘pipefd[1]’ leaks here
# 2002|   
# 2003|   		/* Close the write-end of the pipe. */
# 2004|-> 		close(pipefd[1]);
# 2005|   
# 2006|   		if (ret < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def951]
criu-4.2/criu/util.c:2004:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1994:17: branch_true: ...to here
criu-4.2/criu/util.c:1999:23: acquire_resource: opened here
criu-4.2/criu/util.c:2000:20: branch_true: following ‘true’ branch (when ‘ret >= 0’)...
criu-4.2/criu/util.c:2001:31: branch_true: ...to here
criu-4.2/criu/util.c:2004:17: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:2004:17: danger: ‘ret’ leaks here; was opened at [(16)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/15)
# 2002|   
# 2003|   		/* Close the write-end of the pipe. */
# 2004|-> 		close(pipefd[1]);
# 2005|   
# 2006|   		if (ret < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def952]
criu-4.2/criu/util.c:2010:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_true: following ‘true’ branch...
criu-4.2/criu/util.c:1994:17: branch_true: ...to here
criu-4.2/criu/util.c:1999:23: acquire_resource: opened here
criu-4.2/criu/util.c:2000:20: branch_true: following ‘true’ branch (when ‘ret >= 0’)...
criu-4.2/criu/util.c:2001:31: branch_true: ...to here
criu-4.2/criu/util.c:2006:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/criu/util.c:2010:17: branch_false: ...to here
criu-4.2/criu/util.c:2010:17: throw: if the called function throws an exception...
criu-4.2/criu/util.c:2010:17: danger: ‘ret’ leaks here; was opened at [(16)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/15)
# 2008|   
# 2009|   		/* Does not return. */
# 2010|-> 		child_fn(args);
# 2011|   		_exit(EXIT_FAILURE);
# 2012|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def953]
criu-4.2/criu/util.c:2015:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:2015:9: branch_false: ...to here
criu-4.2/criu/util.c:2015:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:2015:9: danger: ‘pipefd[0]’ leaks here
# 2013|   
# 2014|   	/* close the write-end of the pipe */
# 2015|-> 	close(pipefd[1]);
# 2016|   
# 2017|   	if (buf && buf_size > 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def954]
criu-4.2/criu/util.c:2015:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:2015:9: branch_false: ...to here
criu-4.2/criu/util.c:2015:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:2015:9: danger: ‘pipefd[1]’ leaks here
# 2013|   
# 2014|   	/* close the write-end of the pipe */
# 2015|-> 	close(pipefd[1]);
# 2016|   
# 2017|   	if (buf && buf_size > 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def955]
criu-4.2/criu/util.c:2026:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
criu-4.2/criu/util.c:1972:5: enter_function: entry to ‘run_command’
criu-4.2/criu/util.c:1982:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1985:17: branch_false: ...to here
criu-4.2/criu/util.c:1985:17: call_function: calling ‘raw_clone’ from ‘run_command’
criu-4.2/criu/util.c:1985:17: return_function: returning to ‘run_command’ from ‘raw_clone’
criu-4.2/criu/util.c:1986:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:1992:12: branch_false: ...to here
criu-4.2/criu/util.c:1992:12: branch_false: following ‘false’ branch...
criu-4.2/criu/util.c:2015:9: branch_false: ...to here
criu-4.2/criu/util.c:2026:9: throw: if ‘close’ throws an exception...
criu-4.2/criu/util.c:2026:9: danger: ‘pipefd[0]’ leaks here
# 2024|   
# 2025|   	/* close the read-end of the pipe */
# 2026|-> 	close(pipefd[0]);
# 2027|   
# 2028|   	return fret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def956]
criu-4.2/criu/vdso.c:158:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/vdso.c:132:12: branch_false: following ‘false’ branch (when ‘rt_vdso_marked’ is non-NULL)...
criu-4.2/criu/vdso.c:139:9: branch_false: ...to here
criu-4.2/criu/vdso.c:147:9: branch_true: following ‘true’ branch (when ‘vma != vma_area_list’)...
criu-4.2/criu/vdso.c:148:21: branch_true: ...to here
criu-4.2/criu/vdso.c:158:25: branch_false: following ‘false’ branch (when ‘rt_vvar_marked’ is NULL)...
criu-4.2/criu/vdso.c:159:29: branch_false: ...to here
criu-4.2/criu/vdso.c:147:9: branch_true: following ‘true’ branch (when ‘vma != vma_area_list’)...
criu-4.2/criu/vdso.c:148:21: branch_true: ...to here
criu-4.2/criu/vdso.c:157:27: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:157:28: branch_true: ...to here
criu-4.2/criu/vdso.c:158:25: danger: dereference of NULL ‘0’
#  156|   			pr_debug("vdso: Restore orig VVAR status at %lx\n", (long)vma->e->start);
#  157|   		} else if (addr->rt_vvar != VVAR_BAD_ADDR && addr->rt_vvar == vma->e->start) {
#  158|-> 			BUG_ON(rt_vvar_marked);
#  159|   			if (not_vvar_or_vdso(vma)) {
#  160|   				pr_warn("Mark in rt-vdso points to vma, that doesn't look like vvar - skipping unmap\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def957]
criu-4.2/criu/vdso.c:275:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/vdso.c:270:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:273:18: branch_false: ...to here
criu-4.2/criu/vdso.c:274:12: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:275:17: branch_true: ...to here
criu-4.2/criu/vdso.c:275:17: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:275:17: branch_true: ...to here
criu-4.2/criu/vdso.c:275:17: danger: dereference of NULL ‘0’
#  273|   	vcheck = get_vdso_check_type(ctl);
#  274|   	if (vcheck == VDSO_CHECK_PFN) {
#  275|-> 		BUG_ON(vdso_pfn == VDSO_BAD_PFN);
#  276|   		fd = open_proc(pid, "pagemap");
#  277|   		if (fd < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def958]
criu-4.2/criu/vdso.c:310:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:431:12: enter_function: entry to ‘vdso_mmap_compat’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:465:14: branch_false: ...to here
criu-4.2/criu/vdso.c:465:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:470:13: branch_false: ...to here
criu-4.2/criu/vdso.c:470:13: call_function: calling ‘vdso_parse_maps’ from ‘vdso_mmap_compat’
#  308|   	*s = (struct vdso_maps)VDSO_MAPS_INIT;
#  309|   
#  310|-> 	f.fd = open_proc(pid, "maps");
#  311|   	if (f.fd < 0)
#  312|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def959]
criu-4.2/criu/vdso.c:314:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:431:12: enter_function: entry to ‘vdso_mmap_compat’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:465:14: branch_false: ...to here
criu-4.2/criu/vdso.c:465:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:470:13: branch_false: ...to here
criu-4.2/criu/vdso.c:470:13: call_function: calling ‘vdso_parse_maps’ from ‘vdso_mmap_compat’
#  312|   		return -1;
#  313|   
#  314|-> 	if (bfdopenr(&f))
#  315|   		goto err;
#  316|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def960]
criu-4.2/criu/vdso.c:321:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:431:12: enter_function: entry to ‘vdso_mmap_compat’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:465:14: branch_false: ...to here
criu-4.2/criu/vdso.c:465:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:470:13: branch_false: ...to here
criu-4.2/criu/vdso.c:470:13: call_function: calling ‘vdso_parse_maps’ from ‘vdso_mmap_compat’
#  319|   		char *has_vdso, *has_vvar, *has_vvar_vclock;
#  320|   
#  321|-> 		buf = breadline(&f);
#  322|   		if (buf == NULL)
#  323|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def961]
criu-4.2/criu/vdso.c:343:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:431:12: enter_function: entry to ‘vdso_mmap_compat’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:465:14: branch_false: ...to here
criu-4.2/criu/vdso.c:465:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:470:13: branch_false: ...to here
criu-4.2/criu/vdso.c:470:13: call_function: calling ‘vdso_parse_maps’ from ‘vdso_mmap_compat’
#  341|   
#  342|   		if (sscanf(buf, "%lx-%lx", &start, &end) != 2) {
#  343|-> 			pr_err("Can't find vDSO/VVAR bounds\n");
#  344|   			goto err;
#  345|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def962]
criu-4.2/criu/vdso.c:377:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:431:12: enter_function: entry to ‘vdso_mmap_compat’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:465:14: branch_false: ...to here
criu-4.2/criu/vdso.c:465:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:470:13: branch_false: ...to here
criu-4.2/criu/vdso.c:470:13: call_function: calling ‘vdso_parse_maps’ from ‘vdso_mmap_compat’
#  375|   	exit_code = 0;
#  376|   err:
#  377|-> 	bclose(&f);
#  378|   	return exit_code;
#  379|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def963]
criu-4.2/criu/vdso.c:444:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/vdso.c:444:21: branch_true: ...to here
criu-4.2/criu/vdso.c:444:21: throw: if ‘close’ throws an exception...
criu-4.2/criu/vdso.c:444:21: danger: ‘fds[0]’ leaks here
#  442|   	pid = fork();
#  443|   	if (pid == 0) {
#  444|-> 		if (close(fds[1])) {
#  445|   			pr_perror("Failed to close pipe");
#  446|   			syscall(__NR_exit, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def964]
criu-4.2/criu/vdso.c:444:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/vdso.c:444:21: branch_true: ...to here
criu-4.2/criu/vdso.c:444:21: throw: if ‘close’ throws an exception...
criu-4.2/criu/vdso.c:444:21: danger: ‘fds[1]’ leaks here
#  442|   	pid = fork();
#  443|   	if (pid == 0) {
#  444|-> 		if (close(fds[1])) {
#  445|   			pr_perror("Failed to close pipe");
#  446|   			syscall(__NR_exit, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def965]
criu-4.2/criu/vdso.c:445:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/vdso.c:444:21: branch_true: ...to here
criu-4.2/criu/vdso.c:444:20: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:445:25: branch_true: ...to here
criu-4.2/criu/vdso.c:445:25: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/vdso.c:445:25: danger: ‘fds[0]’ leaks here
#  443|   	if (pid == 0) {
#  444|   		if (close(fds[1])) {
#  445|-> 			pr_perror("Failed to close pipe");
#  446|   			syscall(__NR_exit, 1);
#  447|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def966]
criu-4.2/criu/vdso.c:449:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/vdso.c:444:21: branch_true: ...to here
criu-4.2/criu/vdso.c:449:17: throw: if ‘log_get_fd’ throws an exception...
criu-4.2/criu/vdso.c:449:17: danger: ‘fds[0]’ leaks here
#  447|   		}
#  448|   
#  449|-> 		compat_vdso_helper(native, fds[0], log_get_fd(), vdso_buf, buf_size);
#  450|   
#  451|   		BUG();

Error: GCC_ANALYZER_WARNING (CWE-476): [#def967]
criu-4.2/criu/vdso.c:451:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.2/criu/vdso.c:444:21: branch_true: ...to here
criu-4.2/criu/vdso.c:451:17: danger: dereference of NULL ‘0’
#  449|   		compat_vdso_helper(native, fds[0], log_get_fd(), vdso_buf, buf_size);
#  450|   
#  451|-> 		BUG();
#  452|   	}
#  453|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def968]
criu-4.2/criu/vdso.c:454:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:13: throw: if ‘close’ throws an exception...
criu-4.2/criu/vdso.c:454:13: danger: ‘fds[0]’ leaks here
#  452|   	}
#  453|   
#  454|-> 	if (close(fds[0])) {
#  455|   		pr_perror("Failed to close pipe");
#  456|   		goto out_kill;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def969]
criu-4.2/criu/vdso.c:454:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:13: throw: if ‘close’ throws an exception...
criu-4.2/criu/vdso.c:454:13: danger: ‘fds[1]’ leaks here
#  452|   	}
#  453|   
#  454|-> 	if (close(fds[0])) {
#  455|   		pr_perror("Failed to close pipe");
#  456|   		goto out_kill;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def970]
criu-4.2/criu/vdso.c:455:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:455:17: branch_true: ...to here
criu-4.2/criu/vdso.c:455:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/vdso.c:455:17: danger: ‘fds[1]’ leaks here
#  453|   
#  454|   	if (close(fds[0])) {
#  455|-> 		pr_perror("Failed to close pipe");
#  456|   		goto out_kill;
#  457|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def971]
criu-4.2/criu/vdso.c:458:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:458:9: throw: if ‘waitpid’ throws an exception...
criu-4.2/criu/vdso.c:458:9: danger: ‘fds[1]’ leaks here
#  456|   		goto out_kill;
#  457|   	}
#  458|-> 	waitpid(pid, &status, WUNTRACED);
#  459|   
#  460|   	if (WIFEXITED(status)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def972]
criu-4.2/criu/vdso.c:461:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:461:17: branch_true: ...to here
criu-4.2/criu/vdso.c:461:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/vdso.c:461:17: danger: ‘fds[1]’ leaks here
#  459|   
#  460|   	if (WIFEXITED(status)) {
#  461|-> 		pr_err("Compat vdso helper exited with %d\n", WEXITSTATUS(status));
#  462|   		goto out_kill;
#  463|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def973]
criu-4.2/criu/vdso.c:466:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:454:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:458:9: branch_false: ...to here
criu-4.2/criu/vdso.c:460:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:465:14: branch_false: ...to here
criu-4.2/criu/vdso.c:465:12: branch_true: following ‘true’ branch...
criu-4.2/criu/vdso.c:466:17: branch_true: ...to here
criu-4.2/criu/vdso.c:466:17: throw: if ‘print_on_level’ throws an exception...
criu-4.2/criu/vdso.c:466:17: danger: ‘fds[1]’ leaks here
#  464|   
#  465|   	if (!WIFSTOPPED(status)) {
#  466|-> 		pr_err("Compat vdso helper isn't stopped\n");
#  467|   		goto out_kill;
#  468|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def974]
criu-4.2/criu/vdso.c:497:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/vdso.c:437:12: branch_false: following ‘false’ branch...
criu-4.2/criu/vdso.c:442:15: branch_false: ...to here
criu-4.2/criu/vdso.c:443:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.2/criu/vdso.c:454:13: branch_false: ...to here
criu-4.2/criu/vdso.c:497:13: throw: if ‘close’ throws an exception...
criu-4.2/criu/vdso.c:497:13: danger: ‘fds[1]’ leaks here
#  495|   	kill(pid, SIGKILL);
#  496|   out_close:
#  497|-> 	if (close(fds[1]))
#  498|   		pr_perror("Failed to close pipe");
#  499|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def975]
criu-4.2/include/common/err.h:31:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(do_open_proc(pid, 0, "map_files"))’
criu-4.2/criu/proc_parse.c:823:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:826:13: branch_false: ...to here
criu-4.2/criu/proc_parse.c:826:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:829:25: branch_false: ...to here
criu-4.2/criu/proc_parse.c:829:25: acquire_memory: allocated here
criu-4.2/criu/proc_parse.c:829:25: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:830:12: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:830:12: branch_false: ...to here
criu-4.2/criu/proc_parse.c:839:20: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:843:20: branch_false: ...to here
criu-4.2/criu/proc_parse.c:843:20: branch_true: following ‘true’ branch...
criu-4.2/criu/proc_parse.c:843:30: branch_true: ...to here
criu-4.2/criu/proc_parse.c:843:21: branch_false: following ‘false’ branch...
criu-4.2/criu/proc_parse.c:844:30: branch_false: ...to here
criu-4.2/criu/proc_parse.c:839:21: call_function: inlined call to ‘IS_ERR’ from ‘parse_smaps’
#   29|   static inline long IS_ERR(const void *ptr)
#   30|   {
#   31|-> 	return IS_ERR_VALUE((unsigned long)ptr);
#   32|   }
#   33|   

Error: CPPCHECK_WARNING (CWE-476): [#def976]
criu-4.2/include/common/lock.h:82: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   80|   {
#   81|   	atomic_set(&f->raw, (int)v);
#   82|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#   83|   }
#   84|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def977]
criu-4.2/include/common/lock.h:82:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/compel/plugins/std/infect.c:151:38: enter_function: entry to ‘parasite_init_daemon’
criu-4.2/compel/plugins/std/infect.c:163:12: branch_false: following ‘false’ branch...
criu-4.2/compel/plugins/std/infect.c:168:68: branch_false: ...to here
criu-4.2/compel/plugins/std/infect.c:169:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/compel/plugins/std/infect.c:174:9: branch_false: ...to here
criu-4.2/compel/plugins/std/infect.c:174:9: call_function: calling ‘futex_set_and_wake’ from ‘parasite_init_daemon’
#   80|   {
#   81|   	atomic_set(&f->raw, (int)v);
#   82|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#   83|   }
#   84|   

Error: CPPCHECK_WARNING (CWE-476): [#def978]
criu-4.2/include/common/lock.h:88: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   86|   static inline void futex_wake(futex_t *f)
#   87|   {
#   88|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#   89|   }
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def979]
criu-4.2/include/common/lock.h:88:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/lock.h:88:9: branch_true: following ‘true’ branch...
criu-4.2/include/common/lock.h:88:9: branch_true: ...to here
criu-4.2/include/common/lock.h:88:9: danger: dereference of NULL ‘0’
#   86|   static inline void futex_wake(futex_t *f)
#   87|   {
#   88|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#   89|   }
#   90|   

Error: CPPCHECK_WARNING (CWE-476): [#def980]
criu-4.2/include/common/lock.h:102: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  100|   {
#  101|   	atomic_dec(&f->raw);
#  102|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#  103|   }
#  104|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def981]
criu-4.2/include/common/lock.h:102:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/lock.h:102:9: branch_true: following ‘true’ branch...
criu-4.2/include/common/lock.h:102:9: branch_true: ...to here
criu-4.2/include/common/lock.h:102:9: danger: dereference of NULL ‘0’
#  100|   {
#  101|   	atomic_dec(&f->raw);
#  102|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#  103|   }
#  104|   

Error: CPPCHECK_WARNING (CWE-476): [#def982]
criu-4.2/include/common/lock.h:109: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  107|   {
#  108|   	atomic_inc(&f->raw);
#  109|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#  110|   }
#  111|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def983]
criu-4.2/include/common/lock.h:109:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/lock.h:109:9: branch_true: following ‘true’ branch...
criu-4.2/include/common/lock.h:109:9: branch_true: ...to here
criu-4.2/include/common/lock.h:109:9: danger: dereference of NULL ‘0’
#  107|   {
#  108|   	atomic_inc(&f->raw);
#  109|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#  110|   }
#  111|   

Error: CPPCHECK_WARNING (CWE-476): [#def984]
criu-4.2/include/common/lock.h:141: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  139|   	while ((uint32_t)atomic_read(&f->raw) == v) {
#  140|   		int ret = sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAIT, v, NULL, NULL, 0);
#  141|-> 		LOCK_BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
#  142|   	}
#  143|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def985]
criu-4.2/include/common/lock.h:141:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/lock.h:139:16: branch_true: following ‘true’ branch...
criu-4.2/include/common/lock.h:140:49: branch_true: ...to here
criu-4.2/include/common/lock.h:141:17: danger: dereference of NULL ‘0’
#  139|   	while ((uint32_t)atomic_read(&f->raw) == v) {
#  140|   		int ret = sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAIT, v, NULL, NULL, 0);
#  141|-> 		LOCK_BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
#  142|   	}
#  143|   }

Error: CPPCHECK_WARNING (CWE-476): [#def986]
criu-4.2/include/common/lock.h:162: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  160|   	while ((c = (uint32_t)atomic_inc_return(&m->raw)) != 1) {
#  161|   		ret = sys_futex((uint32_t *)&m->raw.counter, FUTEX_WAIT, c, NULL, NULL, 0);
#  162|-> 		LOCK_BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
#  163|   	}
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def987]
criu-4.2/include/common/lock.h:162:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/lock.h:160:16: branch_true: following ‘true’ branch (when ‘c != 1’)...
criu-4.2/include/common/lock.h:161:45: branch_true: ...to here
criu-4.2/include/common/lock.h:162:17: danger: dereference of NULL ‘0’
#  160|   	while ((c = (uint32_t)atomic_inc_return(&m->raw)) != 1) {
#  161|   		ret = sys_futex((uint32_t *)&m->raw.counter, FUTEX_WAIT, c, NULL, NULL, 0);
#  162|-> 		LOCK_BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
#  163|   	}
#  164|   }

Error: CPPCHECK_WARNING (CWE-476): [#def988]
criu-4.2/include/common/lock.h:175: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  173|   	uint32_t c = 0;
#  174|   	atomic_set(&m->raw, (int)c);
#  175|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&m->raw.counter, FUTEX_WAKE, 1, NULL, NULL, 0) < 0);
#  176|   }
#  177|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def989]
criu-4.2/include/common/lock.h:175:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/lock.h:175:9: branch_true: following ‘true’ branch...
criu-4.2/include/common/lock.h:175:9: branch_true: ...to here
criu-4.2/include/common/lock.h:175:9: danger: dereference of NULL ‘0’
#  173|   	uint32_t c = 0;
#  174|   	atomic_set(&m->raw, (int)c);
#  175|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&m->raw.counter, FUTEX_WAKE, 1, NULL, NULL, 0) < 0);
#  176|   }
#  177|   

Error: CPPCHECK_WARNING (CWE-476): [#def990]
criu-4.2/include/common/scm-code.c:106: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  104|   		 * sys_write_ helpers. Meawhile opencoded BUG_ON here.
#  105|   		 */
#  106|-> 		BUG_ON(min_fd > CR_SCM_MAX_FD);
#  107|   
#  108|   		if (unlikely(min_fd <= 0))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def991]
criu-4.2/include/common/scm-code.c:106:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.2/include/common/scm-code.c:82:21: branch_true: following ‘true’ branch (when ‘i < nr_fds’)...
criu-4.2/include/common/scm-code.c:83:26: branch_true: ...to here
criu-4.2/include/common/scm-code.c:87:20: branch_false: following ‘false’ branch (when ‘ret > 0’)...
criu-4.2/include/common/scm-code.c:90:24: branch_false: ...to here
criu-4.2/include/common/scm-code.c:90:24: branch_true: following ‘true’ branch...
criu-4.2/include/common/scm-code.c:90:17: branch_true: ...to here
criu-4.2/include/common/scm-code.c:91:20: branch_false: following ‘false’ branch...
criu-4.2/include/common/scm-code.c:93:20: branch_false: following ‘false’ branch...
criu-4.2/include/common/scm-code.c:96:27: branch_false: ...to here
criu-4.2/include/common/scm-code.c:106:17: danger: dereference of NULL ‘0’
#  104|   		 * sys_write_ helpers. Meawhile opencoded BUG_ON here.
#  105|   		 */
#  106|-> 		BUG_ON(min_fd > CR_SCM_MAX_FD);
#  107|   
#  108|   		if (unlikely(min_fd <= 0))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def992]
criu-4.2/include/common/scm.h:39:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
criu-4.2/criu/img-streamer.c:169:12: enter_function: entry to ‘establish_streamer_file_pipe’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:186:13: call_function: inlined call to ‘send_fd’ from ‘establish_streamer_file_pipe’
#   37|   static inline int send_fd(int sock, struct sockaddr_un *saddr, int saddr_len, int fd)
#   38|   {
#   39|-> 	return send_fds(sock, saddr, saddr_len, &fd, 1, NULL, 0);
#   40|   }
#   41|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def993]
criu-4.2/include/common/scm.h:39:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
criu-4.2/criu/img-streamer.c:169:12: enter_function: entry to ‘establish_streamer_file_pipe’
criu-4.2/criu/img-streamer.c:181:12: branch_false: following ‘false’ branch...
criu-4.2/criu/img-streamer.c:186:13: branch_false: ...to here
criu-4.2/criu/img-streamer.c:186:13: call_function: inlined call to ‘send_fd’ from ‘establish_streamer_file_pipe’
#   37|   static inline int send_fd(int sock, struct sockaddr_un *saddr, int saddr_len, int fd)
#   38|   {
#   39|-> 	return send_fds(sock, saddr, saddr_len, &fd, 1, NULL, 0);
#   40|   }
#   41|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def994]
criu-4.2/lib/c/criu.c:467:9: warning[-Wanalyzer-malloc-leak]: leak of ‘u’
criu-4.2/lib/c/criu.c:456:13: branch_false: following ‘false’ branch...
criu-4.2/lib/c/criu.c:464:13: branch_false: ...to here
criu-4.2/lib/c/criu.c:464:13: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:465:12: branch_false: following ‘false’ branch (when ‘u’ is non-NULL)...
criu-4.2/lib/c/criu.c:467:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:467:9: throw: if ‘unix_sk__init’ throws an exception...
criu-4.2/lib/c/criu.c:467:9: danger: ‘u’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  465|   	if (!u)
#  466|   		goto er;
#  467|-> 	unix_sk__init(u);
#  468|   
#  469|   	u->inode = inode;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def995]
criu-4.2/lib/c/criu.c:798:9: warning[-Wanalyzer-malloc-leak]: leak of ‘m’
criu-4.2/lib/c/criu.c:795:13: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:796:12: branch_false: following ‘false’ branch (when ‘m’ is non-NULL)...
criu-4.2/lib/c/criu.c:798:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:798:9: throw: if ‘ext_mount_map__init’ throws an exception...
criu-4.2/lib/c/criu.c:798:9: danger: ‘m’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  796|   	if (!m)
#  797|   		goto er;
#  798|-> 	ext_mount_map__init(m);
#  799|   
#  800|   	m->key = strdup(key);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def996]
criu-4.2/lib/c/criu.c:840:9: warning[-Wanalyzer-malloc-leak]: leak of ‘root’
criu-4.2/lib/c/criu.c:837:16: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:838:12: branch_false: following ‘false’ branch (when ‘root’ is non-NULL)...
criu-4.2/lib/c/criu.c:840:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:840:9: throw: if ‘cgroup_root__init’ throws an exception...
criu-4.2/lib/c/criu.c:840:9: danger: ‘root’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  838|   	if (!root)
#  839|   		goto er;
#  840|-> 	cgroup_root__init(root);
#  841|   
#  842|   	if (ctrl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def997]
criu-4.2/lib/c/criu.c:886:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
criu-4.2/lib/c/criu.c:883:13: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:884:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
criu-4.2/lib/c/criu.c:886:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:886:9: throw: if ‘criu_veth_pair__init’ throws an exception...
criu-4.2/lib/c/criu.c:886:9: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  884|   	if (!p)
#  885|   		goto er;
#  886|-> 	criu_veth_pair__init(p);
#  887|   
#  888|   	p->if_in = strdup(in);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def998]
criu-4.2/lib/c/criu.c:1111:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
criu-4.2/lib/c/criu.c:1105:12: branch_false: following ‘false’ branch...
criu-4.2/lib/c/criu.c:1108:13: branch_false: ...to here
criu-4.2/lib/c/criu.c:1108:13: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1109:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
criu-4.2/lib/c/criu.c:1111:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1111:9: throw: if ‘inherit_fd__init’ throws an exception...
criu-4.2/lib/c/criu.c:1111:9: danger: ‘f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1109|   	if (!f)
# 1110|   		goto er;
# 1111|-> 	inherit_fd__init(f);
# 1112|   
# 1113|   	f->fd = fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def999]
criu-4.2/lib/c/criu.c:1176:20: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(address)’
criu-4.2/lib/c/criu.c:1190:5: enter_function: entry to ‘criu_set_page_server_address_port’
criu-4.2/lib/c/criu.c:1192:16: call_function: calling ‘criu_local_set_page_server_address_port’ from ‘criu_set_page_server_address_port’
# 1174|   
# 1175|   		opts->rpc->ps->address = strdup(address);
# 1176|-> 		if (!opts->rpc->ps->address) {
# 1177|   			free(opts->rpc->ps);
# 1178|   			opts->rpc->ps = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1000]
criu-4.2/lib/c/criu.c:1242:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/lib/c/criu.c:1218:12: branch_false: following ‘false’ branch (when ‘len != -1’)...
criu-4.2/lib/c/criu.c:1229:22: branch_false: ...to here
criu-4.2/lib/c/criu.c:1229:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1230:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
criu-4.2/lib/c/criu.c:1236:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1242:15: throw: if ‘recvmsg’ throws an exception...
criu-4.2/lib/c/criu.c:1242:15: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1240|   	msg_hdr.msg_control = buf + len;
# 1241|   	msg_hdr.msg_controllen = cmsg_len;
# 1242|-> 	len = recvmsg(socket_fd, &msg_hdr, MSG_TRUNC);
# 1243|   
# 1244|   	if (len == -1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1001]
criu-4.2/lib/c/criu.c:1302:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/lib/c/criu.c:1295:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1296:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
criu-4.2/lib/c/criu.c:1302:13: branch_false: ...to here
criu-4.2/lib/c/criu.c:1302:13: throw: if ‘criu_req__pack’ throws an exception...
criu-4.2/lib/c/criu.c:1302:13: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1300|   	}
# 1301|   
# 1302|-> 	if (criu_req__pack(req, buf) != len) {
# 1303|   		perror("Failed packing request");
# 1304|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1002]
criu-4.2/lib/c/criu.c:1447:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/lib/c/criu.c:1434:14: acquire_resource: socket created here
criu-4.2/lib/c/criu.c:1435:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
criu-4.2/lib/c/criu.c:1441:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1445:12: branch_true: following ‘true’ branch (when ‘addr_len > 107’)...
criu-4.2/lib/c/criu.c:1446:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1447:17: throw: if ‘close’ throws an exception...
criu-4.2/lib/c/criu.c:1447:17: danger: ‘fd’ leaks here
# 1445|   	if (addr_len >= sizeof(addr.sun_path)) {
# 1446|   		fprintf(stderr, "The service address %s is too long", opts->service_address);
# 1447|-> 		close(fd);
# 1448|   		return -1;
# 1449|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1003]
criu-4.2/lib/c/criu.c:1454:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.2/lib/c/criu.c:1434:14: acquire_resource: socket created here
criu-4.2/lib/c/criu.c:1435:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
criu-4.2/lib/c/criu.c:1441:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1445:12: branch_false: following ‘false’ branch (when ‘addr_len <= 107’)...
criu-4.2/lib/c/criu.c:1450:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1454:15: throw: if ‘connect’ throws an exception...
criu-4.2/lib/c/criu.c:1454:15: danger: ‘fd’ leaks here
# 1452|   	addr_len += sizeof(addr.sun_family);
# 1453|   
# 1454|-> 	ret = connect(fd, (struct sockaddr *)&addr, addr_len);
# 1455|   	if (ret < 0) {
# 1456|   		saved_errno = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1004]
criu-4.2/lib/c/criu.c:1907:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1894:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_true: following ‘true’ branch (when ‘_ns_file’ is NULL)...
criu-4.2/lib/c/criu.c:1907:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1907:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1907:17: danger: ‘_ns’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1905|   	_ns_file = strdup(ns_file);
# 1906|   	if (!_ns_file) {
# 1907|-> 		perror("Can't allocate memory for ns_file");
# 1908|   		goto err;
# 1909|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1005]
criu-4.2/lib/c/criu.c:1914:25: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns_file’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1905:20: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_true: following ‘true’ branch (when ‘extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1912:30: branch_true: ...to here
criu-4.2/lib/c/criu.c:1913:20: branch_true: following ‘true’ branch (when ‘_extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1914:25: branch_true: ...to here
criu-4.2/lib/c/criu.c:1914:25: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1914:25: danger: ‘_ns_file’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 1912|   		_extra_opt = strdup(extra_opt);
# 1913|   		if (!_extra_opt) {
# 1914|-> 			perror("Can't allocate memory for extra_opt");
# 1915|   			goto err;
# 1916|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1006]
criu-4.2/lib/c/criu.c:1914:25: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1894:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_true: following ‘true’ branch (when ‘extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1912:30: branch_true: ...to here
criu-4.2/lib/c/criu.c:1913:20: branch_true: following ‘true’ branch (when ‘_extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1914:25: branch_true: ...to here
criu-4.2/lib/c/criu.c:1914:25: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1914:25: danger: ‘_ns’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 1912|   		_extra_opt = strdup(extra_opt);
# 1913|   		if (!_extra_opt) {
# 1914|-> 			perror("Can't allocate memory for extra_opt");
# 1915|   			goto err;
# 1916|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1007]
criu-4.2/lib/c/criu.c:1921:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_extra_opt’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_true: following ‘true’ branch (when ‘extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1912:30: branch_true: ...to here
criu-4.2/lib/c/criu.c:1912:30: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1913:20: branch_false: following ‘false’ branch (when ‘_extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_true: following ‘true’ branch (when ‘join_ns’ is NULL)...
criu-4.2/lib/c/criu.c:1921:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1921:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1921:17: danger: ‘_extra_opt’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
# 1919|   	join_ns = malloc(sizeof(JoinNamespace));
# 1920|   	if (!join_ns) {
# 1921|-> 		perror("Can't allocate memory for join_ns");
# 1922|   		goto err;
# 1923|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1008]
criu-4.2/lib/c/criu.c:1921:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns_file’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1905:20: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_true: following ‘true’ branch (when ‘join_ns’ is NULL)...
criu-4.2/lib/c/criu.c:1921:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1921:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1921:17: danger: ‘_ns_file’ leaks here; was allocated at [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
# 1919|   	join_ns = malloc(sizeof(JoinNamespace));
# 1920|   	if (!join_ns) {
# 1921|-> 		perror("Can't allocate memory for join_ns");
# 1922|   		goto err;
# 1923|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1009]
criu-4.2/lib/c/criu.c:1921:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1894:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_true: following ‘true’ branch (when ‘join_ns’ is NULL)...
criu-4.2/lib/c/criu.c:1921:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1921:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1921:17: danger: ‘_ns’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 1919|   	join_ns = malloc(sizeof(JoinNamespace));
# 1920|   	if (!join_ns) {
# 1921|-> 		perror("Can't allocate memory for join_ns");
# 1922|   		goto err;
# 1923|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1010]
criu-4.2/lib/c/criu.c:1928:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_extra_opt’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_true: following ‘true’ branch (when ‘extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1912:30: branch_true: ...to here
criu-4.2/lib/c/criu.c:1912:30: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1913:20: branch_false: following ‘false’ branch (when ‘_extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_true: following ‘true’ branch (when ‘join_ns_arr’ is NULL)...
criu-4.2/lib/c/criu.c:1928:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1928:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1928:17: danger: ‘_extra_opt’ leaks here; was allocated at [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
# 1926|   	join_ns_arr = realloc(opts->rpc->join_ns, n_join_ns * sizeof(join_ns));
# 1927|   	if (!join_ns_arr) {
# 1928|-> 		perror("Can't allocate memory for join_ns_arr");
# 1929|   		goto err;
# 1930|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1011]
criu-4.2/lib/c/criu.c:1928:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns_file’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1905:20: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_true: following ‘true’ branch (when ‘join_ns_arr’ is NULL)...
criu-4.2/lib/c/criu.c:1928:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1928:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1928:17: danger: ‘_ns_file’ leaks here; was allocated at [(7)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/6)
# 1926|   	join_ns_arr = realloc(opts->rpc->join_ns, n_join_ns * sizeof(join_ns));
# 1927|   	if (!join_ns_arr) {
# 1928|-> 		perror("Can't allocate memory for join_ns_arr");
# 1929|   		goto err;
# 1930|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1012]
criu-4.2/lib/c/criu.c:1928:17: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1894:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_true: following ‘true’ branch (when ‘join_ns_arr’ is NULL)...
criu-4.2/lib/c/criu.c:1928:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1928:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1928:17: danger: ‘_ns’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1926|   	join_ns_arr = realloc(opts->rpc->join_ns, n_join_ns * sizeof(join_ns));
# 1927|   	if (!join_ns_arr) {
# 1928|-> 		perror("Can't allocate memory for join_ns_arr");
# 1929|   		goto err;
# 1930|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1013]
criu-4.2/lib/c/criu.c:1928:17: warning[-Wanalyzer-malloc-leak]: leak of ‘join_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1919:19: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_true: following ‘true’ branch (when ‘join_ns_arr’ is NULL)...
criu-4.2/lib/c/criu.c:1928:17: branch_true: ...to here
criu-4.2/lib/c/criu.c:1928:17: throw: if ‘perror’ throws an exception...
criu-4.2/lib/c/criu.c:1928:17: danger: ‘join_ns’ leaks here; was allocated at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
# 1926|   	join_ns_arr = realloc(opts->rpc->join_ns, n_join_ns * sizeof(join_ns));
# 1927|   	if (!join_ns_arr) {
# 1928|-> 		perror("Can't allocate memory for join_ns_arr");
# 1929|   		goto err;
# 1930|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1014]
criu-4.2/lib/c/criu.c:1932:9: warning[-Wanalyzer-malloc-leak]: leak of ‘_extra_opt’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_true: following ‘true’ branch (when ‘extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1912:30: branch_true: ...to here
criu-4.2/lib/c/criu.c:1912:30: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1913:20: branch_false: following ‘false’ branch (when ‘_extra_opt’ is non-NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_false: following ‘false’ branch (when ‘join_ns_arr’ is non-NULL)...
criu-4.2/lib/c/criu.c:1932:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1932:9: throw: if ‘join_namespace__init’ throws an exception...
criu-4.2/lib/c/criu.c:1932:9: danger: ‘_extra_opt’ leaks here; was allocated at [(11)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/10)
# 1930|   	}
# 1931|   
# 1932|-> 	join_namespace__init(join_ns);
# 1933|   	join_ns->ns = _ns;
# 1934|   	join_ns->ns_file = _ns_file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1015]
criu-4.2/lib/c/criu.c:1932:9: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns_file’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1905:20: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_false: following ‘false’ branch (when ‘join_ns_arr’ is non-NULL)...
criu-4.2/lib/c/criu.c:1932:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1932:9: throw: if ‘join_namespace__init’ throws an exception...
criu-4.2/lib/c/criu.c:1932:9: danger: ‘_ns_file’ leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
# 1930|   	}
# 1931|   
# 1932|-> 	join_namespace__init(join_ns);
# 1933|   	join_ns->ns = _ns;
# 1934|   	join_ns->ns_file = _ns_file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1016]
criu-4.2/lib/c/criu.c:1932:9: warning[-Wanalyzer-malloc-leak]: leak of ‘_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1894:15: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_false: following ‘false’ branch (when ‘join_ns_arr’ is non-NULL)...
criu-4.2/lib/c/criu.c:1932:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1932:9: throw: if ‘join_namespace__init’ throws an exception...
criu-4.2/lib/c/criu.c:1932:9: danger: ‘_ns’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1930|   	}
# 1931|   
# 1932|-> 	join_namespace__init(join_ns);
# 1933|   	join_ns->ns = _ns;
# 1934|   	join_ns->ns_file = _ns_file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1017]
criu-4.2/lib/c/criu.c:1932:9: warning[-Wanalyzer-malloc-leak]: leak of ‘join_ns_arr’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_false: following ‘false’ branch (when ‘join_ns_arr’ is non-NULL)...
criu-4.2/lib/c/criu.c:1932:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1932:9: throw: if ‘join_namespace__init’ throws an exception...
criu-4.2/lib/c/criu.c:1932:9: danger: ‘join_ns_arr’ leaks here; was allocated at [(13)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/12)
# 1930|   	}
# 1931|   
# 1932|-> 	join_namespace__init(join_ns);
# 1933|   	join_ns->ns = _ns;
# 1934|   	join_ns->ns_file = _ns_file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1018]
criu-4.2/lib/c/criu.c:1932:9: warning[-Wanalyzer-malloc-leak]: leak of ‘join_ns’
criu-4.2/lib/c/criu.c:1889:12: branch_false: following ‘false’ branch (when ‘ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1894:15: branch_false: ...to here
criu-4.2/lib/c/criu.c:1895:12: branch_false: following ‘false’ branch (when ‘_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1900:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1900:12: branch_false: following ‘false’ branch (when ‘ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1905:20: branch_false: ...to here
criu-4.2/lib/c/criu.c:1906:12: branch_false: following ‘false’ branch (when ‘_ns_file’ is non-NULL)...
criu-4.2/lib/c/criu.c:1911:12: branch_false: ...to here
criu-4.2/lib/c/criu.c:1911:12: branch_false: following ‘false’ branch (when ‘extra_opt’ is NULL)...
criu-4.2/lib/c/criu.c:1919:19: branch_false: ...to here
criu-4.2/lib/c/criu.c:1919:19: acquire_memory: allocated here
criu-4.2/lib/c/criu.c:1920:12: branch_false: following ‘false’ branch (when ‘join_ns’ is non-NULL)...
criu-4.2/lib/c/criu.c:1925:21: branch_false: ...to here
criu-4.2/lib/c/criu.c:1927:12: branch_false: following ‘false’ branch (when ‘join_ns_arr’ is non-NULL)...
criu-4.2/lib/c/criu.c:1932:9: branch_false: ...to here
criu-4.2/lib/c/criu.c:1932:9: throw: if ‘join_namespace__init’ throws an exception...
criu-4.2/lib/c/criu.c:1932:9: danger: ‘join_ns’ leaks here; was allocated at [(11)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/10)
# 1930|   	}
# 1931|   
# 1932|-> 	join_namespace__init(join_ns);
# 1933|   	join_ns->ns = _ns;
# 1934|   	join_ns->ns_file = _ns_file;

Error: COMPILER_WARNING: [#def1019] [important]
criu-4.2/plugins/cuda/cuda_plugin.c:1:10: error[fatal error]: criu-log.h: No such file or directory
#    1|-> #include "criu-log.h"
#    2|   #include "plugin.h"
#    3|   #include "util.h"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1020]
criu-4.2/soccr/soccr.c:94:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’
criu-4.2/soccr/soccr.c:124:21: enter_function: entry to ‘libsoccr_pause’
criu-4.2/soccr/soccr.c:128:15: acquire_memory: allocated here
criu-4.2/soccr/soccr.c:129:12: branch_false: following ‘false’ branch (when ‘ret’ is non-NULL)...
criu-4.2/soccr/soccr.c:134:13: branch_false: ...to here
criu-4.2/soccr/soccr.c:134:13: call_function: calling ‘tcp_repair_on’ from ‘libsoccr_pause’
#   92|   	ret = setsockopt(fd, SOL_TCP, TCP_REPAIR, &aux, sizeof(aux));
#   93|   	if (ret < 0)
#   94|-> 		logerr("Can't turn TCP repair mode ON");
#   95|   
#   96|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1021]
criu-4.2/soccr/soccr.c:356:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
criu-4.2/soccr/soccr.c:337:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/soccr/soccr.c:340:9: branch_false: ...to here
criu-4.2/soccr/soccr.c:342:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
criu-4.2/soccr/soccr.c:345:12: branch_false: ...to here
criu-4.2/soccr/soccr.c:345:12: branch_true: following ‘true’ branch (when ‘len != 0’)...
criu-4.2/soccr/soccr.c:350:30: branch_true: ...to here
criu-4.2/soccr/soccr.c:350:23: acquire_memory: allocated here
criu-4.2/soccr/soccr.c:351:20: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
criu-4.2/soccr/soccr.c:356:23: branch_false: ...to here
criu-4.2/soccr/soccr.c:356:23: throw: if ‘recv’ throws an exception...
criu-4.2/soccr/soccr.c:356:23: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  354|   		}
#  355|   
#  356|-> 		ret = recv(sk, buf, len + 1, MSG_PEEK | MSG_DONTWAIT);
#  357|   		if (ret != len)
#  358|   			goto err_recv;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-134.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecriu-4.2-11.fc44
store-results-to/tmp/tmpwiv_zemz/criu-4.2-11.fc44.tar.xz
time-created2026-01-08 15:53:33
time-finished2026-01-08 15:57:08
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpwiv_zemz/criu-4.2-11.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpwiv_zemz/criu-4.2-11.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9