flashrom-1.6.0-2.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-140): [#def1]
/usr/share/bash-completion/completions/flashrom.bash:29:16: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   27|   			local IFS=$'\n'
#   28|   			compopt -o filenames
#   29|-> 			COMPREPLY=( $(compgen -f -- $cur) )
#   30|   			return 0
#   31|   			;;

Error: SHELLCHECK_WARNING (CWE-140): [#def2]
/usr/share/bash-completion/completions/flashrom.bash:36:16: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   34|   			;;
#   35|   		'-p'|'--programmer')
#   36|-> 			COMPREPLY=( $(compgen -W "asm106x atavia buspirate_spi ch341a_spi ch347_spi dediprog developerbox_spi digilent_spi dirtyjtag_spi drkaiser dummy ft2232_spi gfxnvidia internal it8212 jlink_spi linux_mtd linux_spi nic3com nicintel nicintel_eeprom nicintel_spi nicrealtek ogp_spi pickit2_spi pony_spi raiden_debug_spi rayer_spi satamv satasii serprog spidriver stlinkv3_spi usbblaster_spi " -- $cur) )
#   37|   			return 0
#   38|   			;;

Error: SHELLCHECK_WARNING (CWE-140): [#def3]
/usr/share/bash-completion/completions/flashrom.bash:73:14: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   71|   		--progress
#   72|   		--programmer"
#   73|-> 	COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
#   74|   	return 0
#   75|   }

Error: SHELLCHECK_WARNING (CWE-477): [#def4]
/usr/share/doc/flashrom/doc/sphinx-wrapper.sh:24:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   22|   	PATH_TARGET="${OUTPUT_HOME}/${MAN_OUTPUT}"
#   23|   	PATH_ACTUAL="${OUTPUT_HOME}/${MAN_OUTPUT#man}"
#   24|-> 	if [ -d "${PATH_ACTUAL}" -a ! -L "${PATH_ACTUAL}" ]; then
#   25|   		rm -rf "${PATH_TARGET}"
#   26|   		mv "${PATH_ACTUAL}" "${PATH_TARGET}"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
flashrom-v1.6.0/asm106x.c:147:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/asm106x.c:138:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/asm106x.c:141:16: branch_false: ...to here
flashrom-v1.6.0/asm106x.c:141:16: acquire_memory: allocated here
flashrom-v1.6.0/asm106x.c:142:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/asm106x.c:146:9: branch_false: ...to here
flashrom-v1.6.0/asm106x.c:147:16: throw: if ‘register_spi_master’ throws an exception...
flashrom-v1.6.0/asm106x.c:147:16: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  145|   	}
#  146|   	data->pci = pci;
#  147|-> 	return register_spi_master(&asm106x_spi_master, data);
#  148|   }
#  149|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
flashrom-v1.6.0/bitbang_spi.c:172:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/bitbang_spi.c:155:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/bitbang_spi.c:155:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/bitbang_spi.c:158:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/bitbang_spi.c:164:48: branch_false: ...to here
flashrom-v1.6.0/bitbang_spi.c:164:48: acquire_memory: allocated here
flashrom-v1.6.0/bitbang_spi.c:165:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/bitbang_spi.c:168:9: branch_false: ...to here
flashrom-v1.6.0/bitbang_spi.c:169:12: branch_false: following ‘false’ branch (when ‘spi_data’ is NULL)...
flashrom-v1.6.0/bitbang_spi.c:172:9: branch_false: ...to here
flashrom-v1.6.0/bitbang_spi.c:172:9: throw: if ‘register_spi_master’ throws an exception...
flashrom-v1.6.0/bitbang_spi.c:172:9: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  170|   		data->spi_data = spi_data;
#  171|   
#  172|-> 	register_spi_master(&mst, data);
#  173|   
#  174|   	/* Only mess with the bus if we're sure nobody else uses it. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
flashrom-v1.6.0/board_enable.c:2578:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tempstr’
flashrom-v1.6.0/board_enable.c:2566:25: acquire_memory: allocated here
flashrom-v1.6.0/board_enable.c:2570:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/board_enable.c:2576:19: branch_false: ...to here
flashrom-v1.6.0/board_enable.c:2578:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/board_enable.c:2578:9: danger: ‘tempstr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2576|   	*vendor = strdup(tempstr);
# 2577|   	*model = strdup(tempstr2);
# 2578|-> 	msg_pspew("-p internal:mainboard: vendor=\"%s\", model=\"%s\"\n", tempstr, tempstr2);
# 2579|   	free(tempstr);
# 2580|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
flashrom-v1.6.0/buspirate_spi.c:41:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:441:15: call_function: calling ‘buspirate_serialport_setup’ from ‘buspirate_spi_init’
#   39|   {
#   40|   	/* 115200bps, 8 databits, no parity, 1 stopbit */
#   41|-> 	sp_fd = sp_openserport(dev, BP_DEFAULTBAUD);
#   42|   	if (sp_fd == SER_INV_FD)
#   43|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
flashrom-v1.6.0/buspirate_spi.c:85:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#   83|   	int ret = 0;
#   84|   
#   85|-> 	msg_pspew("%s: write %i, read %i ", __func__, writecnt, readcnt);
#   86|   	if (!writecnt && !readcnt) {
#   87|   		msg_perr("Zero length command!\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
flashrom-v1.6.0/buspirate_spi.c:85:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_data’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:449:39: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#   83|   	int ret = 0;
#   84|   
#   85|-> 	msg_pspew("%s: write %i, read %i ", __func__, writecnt, readcnt);
#   86|   	if (!writecnt && !readcnt) {
#   87|   		msg_perr("Zero length command!\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
flashrom-v1.6.0/buspirate_spi.c:91:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#   89|   	}
#   90|   	if (writecnt)
#   91|-> 		msg_pspew("Sending");
#   92|   	for (i = 0; i < writecnt; i++)
#   93|   		msg_pspew(" 0x%02x", buf[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
flashrom-v1.6.0/buspirate_spi.c:91:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_data’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:449:39: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#   89|   	}
#   90|   	if (writecnt)
#   91|-> 		msg_pspew("Sending");
#   92|   	for (i = 0; i < writecnt; i++)
#   93|   		msg_pspew(" 0x%02x", buf[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
flashrom-v1.6.0/buspirate_spi.c:93:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#   91|   		msg_pspew("Sending");
#   92|   	for (i = 0; i < writecnt; i++)
#   93|-> 		msg_pspew(" 0x%02x", buf[i]);
#   94|   #ifdef FAKE_COMMUNICATION
#   95|   	/* Placate the caller for now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
flashrom-v1.6.0/buspirate_spi.c:93:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_data’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:449:39: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#   91|   		msg_pspew("Sending");
#   92|   	for (i = 0; i < writecnt; i++)
#   93|-> 		msg_pspew(" 0x%02x", buf[i]);
#   94|   #ifdef FAKE_COMMUNICATION
#   95|   	/* Placate the caller for now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
flashrom-v1.6.0/buspirate_spi.c:103:23: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#  101|   #else
#  102|   	if (writecnt)
#  103|-> 		ret = serialport_write(buf, writecnt);
#  104|   	if (ret)
#  105|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
flashrom-v1.6.0/buspirate_spi.c:103:23: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_data’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:449:39: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#  101|   #else
#  102|   	if (writecnt)
#  103|-> 		ret = serialport_write(buf, writecnt);
#  104|   	if (ret)
#  105|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
flashrom-v1.6.0/buspirate_spi.c:115:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#  113|   	for (i = 0; i < readcnt; i++)
#  114|   		msg_pspew(" 0x%02x", buf[i]);
#  115|-> 	msg_pspew("\n");
#  116|   	return 0;
#  117|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
flashrom-v1.6.0/buspirate_spi.c:115:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_data’
flashrom-v1.6.0/buspirate_spi.c:315:12: enter_function: entry to ‘buspirate_spi_init’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:449:39: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_false: following ‘false’ branch (when ‘bp_data’ is non-NULL)...
flashrom-v1.6.0/buspirate_spi.c:455:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:463:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
flashrom-v1.6.0/buspirate_spi.c:465:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:467:23: call_function: calling ‘buspirate_sendrecv’ from ‘buspirate_spi_init’
#  113|   	for (i = 0; i < readcnt; i++)
#  114|   		msg_pspew(" 0x%02x", buf[i]);
#  115|-> 	msg_pspew("\n");
#  116|   	return 0;
#  117|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
flashrom-v1.6.0/buspirate_spi.c:451:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp_commbuf’
flashrom-v1.6.0/buspirate_spi.c:336:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/buspirate_spi.c:336:20: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:336:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:345:15: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:433:22: acquire_memory: allocated here
flashrom-v1.6.0/buspirate_spi.c:434:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:439:9: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/buspirate_spi.c:449:39: branch_false: ...to here
flashrom-v1.6.0/buspirate_spi.c:450:12: branch_true: following ‘true’ branch (when ‘bp_data’ is NULL)...
flashrom-v1.6.0/buspirate_spi.c:451:17: branch_true: ...to here
flashrom-v1.6.0/buspirate_spi.c:451:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/buspirate_spi.c:451:17: danger: ‘bp_commbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  449|   	struct bp_spi_data *bp_data = calloc(1, sizeof(*bp_data));
#  450|   	if (!bp_data) {
#  451|-> 		msg_perr("Unable to allocate space for SPI master data\n");
#  452|   		free(bp_commbuf);
#  453|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def20]
flashrom-v1.6.0/ch341a_spi.c:234:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘state_in[i]’
flashrom-v1.6.0/ch341a_spi.c:147:12: branch_true: following ‘true’ branch (when ‘writecnt != 0’)...
flashrom-v1.6.0/ch341a_spi.c:148:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:150:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:151:25: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:224:9: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:227:12: branch_true: following ‘true’ branch (when ‘writecnt != 0’)...
flashrom-v1.6.0/ch341a_spi.c:227:31: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:231:12: branch_true: following ‘true’ branch (when ‘readcnt != 0’)...
flashrom-v1.6.0/ch341a_spi.c:231:12: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:233:29: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:234:29: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:234:29: danger: use of uninitialized value ‘state_in[i]’ here
#  232|   		unsigned int i;
#  233|   		for (i = 0; i < USB_IN_TRANSFERS; i++) {
#  234|-> 			if (state_in[i] == TRANS_ACTIVE)
#  235|   				if (libusb_cancel_transfer(data->transfer_ins[i]) != 0)
#  236|   					state_in[i] = TRANS_ERR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
flashrom-v1.6.0/ch341a_spi.c:442:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:442:24: throw: if ‘libusb_open_device_with_vid_pid’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:442:24: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  440|   	uint16_t vid = devs_ch341a_spi[0].vendor_id;
#  441|   	uint16_t pid = devs_ch341a_spi[0].device_id;
#  442|-> 	data->handle = libusb_open_device_with_vid_pid(NULL, vid, pid);
#  443|   	if (data->handle == NULL) {
#  444|   		msg_perr("Couldn't open device %04x:%04x.\n", vid, pid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
flashrom-v1.6.0/ch341a_spi.c:444:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:444:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:444:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:444:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  442|   	data->handle = libusb_open_device_with_vid_pid(NULL, vid, pid);
#  443|   	if (data->handle == NULL) {
#  444|-> 		msg_perr("Couldn't open device %04x:%04x.\n", vid, pid);
#  445|   		goto free_data;
#  446|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
flashrom-v1.6.0/ch341a_spi.c:448:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:448:15: throw: if ‘libusb_detach_kernel_driver’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:448:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  446|   	}
#  447|   
#  448|-> 	ret = libusb_detach_kernel_driver(data->handle, 0);
#  449|   	if (ret != 0 && ret != LIBUSB_ERROR_NOT_FOUND)
#  450|   		msg_pwarn("Cannot detach the existing USB driver. Claiming the interface may fail. %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
flashrom-v1.6.0/ch341a_spi.c:450:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:449:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:450:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:450:17: throw: if ‘libusb_error_name’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:450:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  448|   	ret = libusb_detach_kernel_driver(data->handle, 0);
#  449|   	if (ret != 0 && ret != LIBUSB_ERROR_NOT_FOUND)
#  450|-> 		msg_pwarn("Cannot detach the existing USB driver. Claiming the interface may fail. %s\n",
#  451|   			libusb_error_name(ret));
#  452|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
flashrom-v1.6.0/ch341a_spi.c:453:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:453:15: throw: if ‘libusb_claim_interface’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:453:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  451|   			libusb_error_name(ret));
#  452|   
#  453|-> 	ret = libusb_claim_interface(data->handle, 0);
#  454|   	if (ret != 0) {
#  455|   		msg_perr("Failed to claim interface 0: '%s'\n", libusb_error_name(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
flashrom-v1.6.0/ch341a_spi.c:455:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:455:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:455:17: throw: if ‘libusb_error_name’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:455:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  453|   	ret = libusb_claim_interface(data->handle, 0);
#  454|   	if (ret != 0) {
#  455|-> 		msg_perr("Failed to claim interface 0: '%s'\n", libusb_error_name(ret));
#  456|   		goto close_handle;
#  457|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
flashrom-v1.6.0/ch341a_spi.c:460:21: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:21: throw: if ‘libusb_get_device’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:460:21: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  458|   
#  459|   	struct libusb_device *dev;
#  460|-> 	if (!(dev = libusb_get_device(data->handle))) {
#  461|   		msg_perr("Failed to get device from device handle.\n");
#  462|   		goto close_handle;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
flashrom-v1.6.0/ch341a_spi.c:461:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:461:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:461:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:461:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  459|   	struct libusb_device *dev;
#  460|   	if (!(dev = libusb_get_device(data->handle))) {
#  461|-> 		msg_perr("Failed to get device from device handle.\n");
#  462|   		goto close_handle;
#  463|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
flashrom-v1.6.0/ch341a_spi.c:466:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:466:15: throw: if ‘libusb_get_device_descriptor’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:466:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  464|   
#  465|   	struct libusb_device_descriptor desc;
#  466|-> 	ret = libusb_get_device_descriptor(dev, &desc);
#  467|   	if (ret < 0) {
#  468|   		msg_perr("Failed to get device descriptor: '%s'\n", libusb_error_name(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
flashrom-v1.6.0/ch341a_spi.c:468:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:468:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:468:17: throw: if ‘libusb_error_name’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:468:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  466|   	ret = libusb_get_device_descriptor(dev, &desc);
#  467|   	if (ret < 0) {
#  468|-> 		msg_perr("Failed to get device descriptor: '%s'\n", libusb_error_name(ret));
#  469|   		goto release_interface;
#  470|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
flashrom-v1.6.0/ch341a_spi.c:472:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:472:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:472:9: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  470|   	}
#  471|   
#  472|-> 	msg_pdbg("Device revision is %d.%01d.%01d\n",
#  473|   		(desc.bcdDevice >> 8) & 0x00FF,
#  474|   		(desc.bcdDevice >> 4) & 0x000F,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
flashrom-v1.6.0/ch341a_spi.c:478:30: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:478:30: throw: if ‘libusb_alloc_transfer’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:478:30: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  476|   
#  477|   	/* Allocate and pre-fill transfer structures. */
#  478|-> 	data->transfer_out = libusb_alloc_transfer(0);
#  479|   	if (!data->transfer_out) {
#  480|   		msg_perr("Failed to alloc libusb OUT transfer\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
flashrom-v1.6.0/ch341a_spi.c:480:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:480:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:480:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:480:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  478|   	data->transfer_out = libusb_alloc_transfer(0);
#  479|   	if (!data->transfer_out) {
#  480|-> 		msg_perr("Failed to alloc libusb OUT transfer\n");
#  481|   		goto release_interface;
#  482|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
flashrom-v1.6.0/ch341a_spi.c:485:41: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:484:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:485:41: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:485:41: throw: if ‘libusb_alloc_transfer’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:485:41: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  483|   	int i;
#  484|   	for (i = 0; i < USB_IN_TRANSFERS; i++) {
#  485|-> 		data->transfer_ins[i] = libusb_alloc_transfer(0);
#  486|   		if (data->transfer_ins[i] == NULL) {
#  487|   			msg_perr("Failed to alloc libusb IN transfer %d\n", i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
flashrom-v1.6.0/ch341a_spi.c:487:25: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:484:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:485:41: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:486:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:487:25: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:487:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:487:25: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  485|   		data->transfer_ins[i] = libusb_alloc_transfer(0);
#  486|   		if (data->transfer_ins[i] == NULL) {
#  487|-> 			msg_perr("Failed to alloc libusb IN transfer %d\n", i);
#  488|   			goto dealloc_transfers;
#  489|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
flashrom-v1.6.0/ch341a_spi.c:505:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:484:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:485:41: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:486:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:484:43: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:484:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:485:41: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:486:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:487:25: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:502:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:503:21: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:503:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:505:17: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:505:17: throw: if ‘libusb_free_transfer’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:505:17: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  503|   		if (data->transfer_ins[i] == NULL)
#  504|   			break;
#  505|-> 		libusb_free_transfer(data->transfer_ins[i]);
#  506|   	}
#  507|   	libusb_free_transfer(data->transfer_out);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
flashrom-v1.6.0/ch341a_spi.c:507:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:472:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:479:12: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:484:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:485:41: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:486:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:487:25: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:502:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
flashrom-v1.6.0/ch341a_spi.c:503:21: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:503:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:507:9: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:507:9: throw: if ‘libusb_free_transfer’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:507:9: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  505|   		libusb_free_transfer(data->transfer_ins[i]);
#  506|   	}
#  507|-> 	libusb_free_transfer(data->transfer_out);
#  508|   release_interface:
#  509|   	libusb_release_interface(data->handle, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
flashrom-v1.6.0/ch341a_spi.c:509:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:454:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:460:39: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:460:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:466:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:467:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch341a_spi.c:468:17: branch_true: ...to here
flashrom-v1.6.0/ch341a_spi.c:509:9: throw: if ‘libusb_release_interface’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:509:9: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  507|   	libusb_free_transfer(data->transfer_out);
#  508|   release_interface:
#  509|-> 	libusb_release_interface(data->handle, 0);
#  510|   close_handle:
#  511|   	libusb_attach_kernel_driver(data->handle, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
flashrom-v1.6.0/ch341a_spi.c:511:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:511:9: throw: if ‘libusb_attach_kernel_driver’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:511:9: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  509|   	libusb_release_interface(data->handle, 0);
#  510|   close_handle:
#  511|-> 	libusb_attach_kernel_driver(data->handle, 0);
#  512|   	libusb_close(data->handle);
#  513|   free_data:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
flashrom-v1.6.0/ch341a_spi.c:512:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ch341a_spi.c:422:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:431:9: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:434:40: acquire_memory: allocated here
flashrom-v1.6.0/ch341a_spi.c:435:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ch341a_spi.c:442:24: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:443:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch341a_spi.c:448:15: branch_false: ...to here
flashrom-v1.6.0/ch341a_spi.c:512:9: throw: if ‘libusb_close’ throws an exception...
flashrom-v1.6.0/ch341a_spi.c:512:9: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  510|   close_handle:
#  511|   	libusb_attach_kernel_driver(data->handle, 0);
#  512|-> 	libusb_close(data->handle);
#  513|   free_data:
#  514|   	free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
flashrom-v1.6.0/ch347_spi.c:87:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:377:9: call_function: calling ‘ch347_spi_shutdown’ from ‘ch347_spi_init’
#   85|   	struct ch347_spi_data *ch347_data = data;
#   86|   	int spi_interface = ch347_data->interface;
#   87|-> 	libusb_release_interface(ch347_data->handle, spi_interface);
#   88|   	libusb_attach_kernel_driver(ch347_data->handle, spi_interface);
#   89|   	libusb_close(ch347_data->handle);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
flashrom-v1.6.0/ch347_spi.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:377:9: call_function: calling ‘ch347_spi_shutdown’ from ‘ch347_spi_init’
#   86|   	int spi_interface = ch347_data->interface;
#   87|   	libusb_release_interface(ch347_data->handle, spi_interface);
#   88|-> 	libusb_attach_kernel_driver(ch347_data->handle, spi_interface);
#   89|   	libusb_close(ch347_data->handle);
#   90|   	libusb_exit(NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
flashrom-v1.6.0/ch347_spi.c:89:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:377:9: call_function: calling ‘ch347_spi_shutdown’ from ‘ch347_spi_init’
#   87|   	libusb_release_interface(ch347_data->handle, spi_interface);
#   88|   	libusb_attach_kernel_driver(ch347_data->handle, spi_interface);
#   89|-> 	libusb_close(ch347_data->handle);
#   90|   	libusb_exit(NULL);
#   91|   	free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
flashrom-v1.6.0/ch347_spi.c:90:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:377:9: call_function: calling ‘ch347_spi_shutdown’ from ‘ch347_spi_init’
#   88|   	libusb_attach_kernel_driver(ch347_data->handle, spi_interface);
#   89|   	libusb_close(ch347_data->handle);
#   90|-> 	libusb_exit(NULL);
#   91|   	free(data);
#   92|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
flashrom-v1.6.0/ch347_spi.c:257:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:368:13: call_function: calling ‘ch347_spi_config’ from ‘ch347_spi_init’
#  255|   	};
#  256|   
#  257|-> 	ret = libusb_bulk_transfer(ch347_data->handle, WRITE_EP, buff, sizeof(buff), NULL, 1000);
#  258|   	if (ret < 0) {
#  259|   		msg_perr("Could not configure SPI interface\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
flashrom-v1.6.0/ch347_spi.c:259:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:368:13: call_function: calling ‘ch347_spi_config’ from ‘ch347_spi_init’
#  257|   	ret = libusb_bulk_transfer(ch347_data->handle, WRITE_EP, buff, sizeof(buff), NULL, 1000);
#  258|   	if (ret < 0) {
#  259|-> 		msg_perr("Could not configure SPI interface\n");
#  260|   	}
#  261|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
flashrom-v1.6.0/ch347_spi.c:265:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:368:13: call_function: calling ‘ch347_spi_config’ from ‘ch347_spi_init’
#  263|   	 * invalid config data, if so the code should check
#  264|   	 */
#  265|-> 	ret = libusb_bulk_transfer(ch347_data->handle, READ_EP, buff, sizeof(buff), NULL, 1000);
#  266|   	if (ret < 0) {
#  267|   		msg_perr("Could not receive configure SPI command response\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
flashrom-v1.6.0/ch347_spi.c:267:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:284:12: enter_function: entry to ‘ch347_spi_init’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:368:13: call_function: calling ‘ch347_spi_config’ from ‘ch347_spi_init’
#  265|   	ret = libusb_bulk_transfer(ch347_data->handle, READ_EP, buff, sizeof(buff), NULL, 1000);
#  266|   	if (ret < 0) {
#  267|-> 		msg_perr("Could not receive configure SPI command response\n");
#  268|   	}
#  269|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
flashrom-v1.6.0/ch347_spi.c:297:23: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:297:23: throw: if ‘libusb_init’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:297:23: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  295|   	}
#  296|   
#  297|-> 	int32_t ret = libusb_init(NULL);
#  298|   	if (ret < 0) {
#  299|   		msg_perr("Could not initialize libusb!\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
flashrom-v1.6.0/ch347_spi.c:299:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:299:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:299:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:299:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  297|   	int32_t ret = libusb_init(NULL);
#  298|   	if (ret < 0) {
#  299|-> 		msg_perr("Could not initialize libusb!\n");
#  300|   		free(ch347_data);
#  301|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
flashrom-v1.6.0/ch347_spi.c:307:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:307:9: throw: if ‘libusb_set_option’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:307:9: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  305|   	libusb_set_debug(NULL, 3);
#  306|   #else
#  307|-> 	libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_INFO);
#  308|   #endif
#  309|   	while (devs_ch347_spi[index].vendor_id != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
flashrom-v1.6.0/ch347_spi.c:312:38: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:312:38: throw: if ‘libusb_open_device_with_vid_pid’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:312:38: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  310|   		vid = devs_ch347_spi[index].vendor_id;
#  311|   		pid = devs_ch347_spi[index].device_id;
#  312|-> 		ch347_data->handle = libusb_open_device_with_vid_pid(NULL, vid, pid);
#  313|   		if (ch347_data->handle) {
#  314|   			ch347_data->interface = ch347_interface[index];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
flashrom-v1.6.0/ch347_spi.c:320:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:313:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:317:17: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:313:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:317:17: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:320:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:320:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:320:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  318|   	}
#  319|   	if (!ch347_data->handle) {
#  320|-> 		msg_perr("Couldn't find CH347.\n");
#  321|   		free(ch347_data);
#  322|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
flashrom-v1.6.0/ch347_spi.c:325:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:325:15: throw: if ‘libusb_detach_kernel_driver’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:325:15: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  323|   	}
#  324|   
#  325|-> 	ret = libusb_detach_kernel_driver(ch347_data->handle, ch347_data->interface);
#  326|   	if (ret != 0 && ret != LIBUSB_ERROR_NOT_FOUND)
#  327|   		msg_pwarn("Cannot detach the existing USB driver. Claiming the interface may fail. %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
flashrom-v1.6.0/ch347_spi.c:327:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:326:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:327:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:327:17: throw: if ‘libusb_error_name’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:327:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  325|   	ret = libusb_detach_kernel_driver(ch347_data->handle, ch347_data->interface);
#  326|   	if (ret != 0 && ret != LIBUSB_ERROR_NOT_FOUND)
#  327|-> 		msg_pwarn("Cannot detach the existing USB driver. Claiming the interface may fail. %s\n",
#  328|   			libusb_error_name(ret));
#  329|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
flashrom-v1.6.0/ch347_spi.c:330:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:330:15: throw: if ‘libusb_claim_interface’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:330:15: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  328|   			libusb_error_name(ret));
#  329|   
#  330|-> 	ret = libusb_claim_interface(ch347_data->handle, ch347_data->interface);
#  331|   	if (ret != 0) {
#  332|   		msg_perr("Failed to claim interface %d: '%s'\n", ch347_data->interface, libusb_error_name(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
flashrom-v1.6.0/ch347_spi.c:332:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:332:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:332:17: throw: if ‘libusb_error_name’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:332:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  330|   	ret = libusb_claim_interface(ch347_data->handle, ch347_data->interface);
#  331|   	if (ret != 0) {
#  332|-> 		msg_perr("Failed to claim interface %d: '%s'\n", ch347_data->interface, libusb_error_name(ret));
#  333|   		goto error_exit;
#  334|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
flashrom-v1.6.0/ch347_spi.c:337:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:21: throw: if ‘libusb_get_device’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:337:21: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
#  335|   
#  336|   	struct libusb_device *dev;
#  337|-> 	if (!(dev = libusb_get_device(ch347_data->handle))) {
#  338|   		msg_perr("Failed to get device from device handle.\n");
#  339|   		goto error_exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
flashrom-v1.6.0/ch347_spi.c:338:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:338:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:338:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:338:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
#  336|   	struct libusb_device *dev;
#  337|   	if (!(dev = libusb_get_device(ch347_data->handle))) {
#  338|-> 		msg_perr("Failed to get device from device handle.\n");
#  339|   		goto error_exit;
#  340|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
flashrom-v1.6.0/ch347_spi.c:343:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:343:15: throw: if ‘libusb_get_device_descriptor’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:343:15: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
#  341|   
#  342|   	struct libusb_device_descriptor desc;
#  343|-> 	ret = libusb_get_device_descriptor(dev, &desc);
#  344|   	if (ret < 0) {
#  345|   		msg_perr("Failed to get device descriptor: '%s'\n", libusb_error_name(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
flashrom-v1.6.0/ch347_spi.c:345:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:345:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:345:17: throw: if ‘libusb_error_name’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:345:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
#  343|   	ret = libusb_get_device_descriptor(dev, &desc);
#  344|   	if (ret < 0) {
#  345|-> 		msg_perr("Failed to get device descriptor: '%s'\n", libusb_error_name(ret));
#  346|   		goto error_exit;
#  347|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
flashrom-v1.6.0/ch347_spi.c:349:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:349:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:349:9: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
#  347|   	}
#  348|   
#  349|-> 	msg_pdbg("Device revision is %d.%01d.%01d\n",
#  350|   		(desc.bcdDevice >> 8) & 0x00FF,
#  351|   		(desc.bcdDevice >> 4) & 0x000F,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
flashrom-v1.6.0/ch347_spi.c:355:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:355:15: throw: if ‘extract_programmer_param_str’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:355:15: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/0)
#  353|   
#  354|   	/* set CH347 clock division */
#  355|-> 	arg = extract_programmer_param_str(cfg, "spispeed");
#  356|   	if (arg) {
#  357|   		for (speed_index = 0; spispeeds[speed_index].name; speed_index++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
flashrom-v1.6.0/ch347_spi.c:364:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:363:13: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:364:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:364:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:364:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
#  362|   	}
#  363|   	if (!spispeeds[speed_index].name || !arg) {
#  364|-> 		msg_perr("Unknown value of spispeed parameter, using default 15MHz clock spi.\n");
#  365|   		speed_index = 2;
#  366|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
flashrom-v1.6.0/ch347_spi.c:371:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:368:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:371:17: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:371:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:371:17: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/0)
#  369|   		goto error_exit;
#  370|   	} else {
#  371|-> 		msg_pinfo("CH347 SPI clock set to %sHz.\n", spispeeds[speed_index].name);
#  372|   	}
#  373|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
flashrom-v1.6.0/ch347_spi.c:374:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ch347_data’
flashrom-v1.6.0/ch347_spi.c:291:45: acquire_memory: allocated here
flashrom-v1.6.0/ch347_spi.c:292:12: branch_false: following ‘false’ branch (when ‘ch347_data’ is non-NULL)...
flashrom-v1.6.0/ch347_spi.c:297:23: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:307:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:309:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/ch347_spi.c:311:17: branch_true: ...to here
flashrom-v1.6.0/ch347_spi.c:319:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:325:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:331:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:337:39: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:337:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:343:15: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:344:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:349:9: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:368:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ch347_spi.c:371:17: branch_false: ...to here
flashrom-v1.6.0/ch347_spi.c:374:16: throw: if ‘register_spi_master’ throws an exception...
flashrom-v1.6.0/ch347_spi.c:374:16: danger: ‘ch347_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
#  372|   	}
#  373|   
#  374|-> 	return register_spi_master(&spi_master_ch347_spi, ch347_data);
#  375|   
#  376|   error_exit:

Error: CPPCHECK_WARNING (CWE-190): [#def67]
flashrom-v1.6.0/chipset_enable.c:495: error[integerOverflow]: Signed integer overflow for expression '(0x1ff0+i)*0x80000'.
#  493|   	for (i = 7; i >= 0; i--) {
#  494|   		int tmp = (fwh_conf >> (i * 4)) & 0xf;
#  495|-> 		msg_pdbg("0x%08x/0x%08x FWH IDSEL: 0x%x\n",
#  496|   			 (0x1ff8 + i) * 0x80000,
#  497|   			 (0x1ff0 + i) * 0x80000,

Error: CPPCHECK_WARNING (CWE-190): [#def68]
flashrom-v1.6.0/chipset_enable.c:495: error[integerOverflow]: Signed integer overflow for expression '(0x1ff8+i)*0x80000'.
#  493|   	for (i = 7; i >= 0; i--) {
#  494|   		int tmp = (fwh_conf >> (i * 4)) & 0xf;
#  495|-> 		msg_pdbg("0x%08x/0x%08x FWH IDSEL: 0x%x\n",
#  496|   			 (0x1ff8 + i) * 0x80000,
#  497|   			 (0x1ff0 + i) * 0x80000,

Error: CPPCHECK_WARNING (CWE-190): [#def69]
flashrom-v1.6.0/chipset_enable.c:510: error[integerOverflow]: Signed integer overflow for expression '(0xff0+i)*0x100000'.
#  508|   		for (i = 3; i >= 0; i--) {
#  509|   			int tmp = (fwh_conf >> (i * 4)) & 0xf;
#  510|-> 			msg_pdbg("0x%08x/0x%08x FWH IDSEL: 0x%x\n",
#  511|   				 (0xff4 + i) * 0x100000,
#  512|   				 (0xff0 + i) * 0x100000,

Error: CPPCHECK_WARNING (CWE-190): [#def70]
flashrom-v1.6.0/chipset_enable.c:510: error[integerOverflow]: Signed integer overflow for expression '(0xff4+i)*0x100000'.
#  508|   		for (i = 3; i >= 0; i--) {
#  509|   			int tmp = (fwh_conf >> (i * 4)) & 0xf;
#  510|-> 			msg_pdbg("0x%08x/0x%08x FWH IDSEL: 0x%x\n",
#  511|   				 (0xff4 + i) * 0x100000,
#  512|   				 (0xff0 + i) * 0x100000,

Error: CPPCHECK_WARNING (CWE-190): [#def71]
flashrom-v1.6.0/chipset_enable.c:528: error[integerOverflow]: Signed integer overflow for expression '(0x1ff0+i)*0x80000'.
#  526|   	for (i = 7; i >= 0; i--) {
#  527|   		int tmp = (fwh_conf >> (i + 0x8)) & 0x1;
#  528|-> 		msg_pdbg("0x%08x/0x%08x FWH decode %sabled\n",
#  529|   			 (0x1ff8 + i) * 0x80000,
#  530|   			 (0x1ff0 + i) * 0x80000,

Error: CPPCHECK_WARNING (CWE-190): [#def72]
flashrom-v1.6.0/chipset_enable.c:528: error[integerOverflow]: Signed integer overflow for expression '(0x1ff8+i)*0x80000'.
#  526|   	for (i = 7; i >= 0; i--) {
#  527|   		int tmp = (fwh_conf >> (i + 0x8)) & 0x1;
#  528|-> 		msg_pdbg("0x%08x/0x%08x FWH decode %sabled\n",
#  529|   			 (0x1ff8 + i) * 0x80000,
#  530|   			 (0x1ff0 + i) * 0x80000,

Error: CPPCHECK_WARNING (CWE-190): [#def73]
flashrom-v1.6.0/chipset_enable.c:540: error[integerOverflow]: Signed integer overflow for expression '(0xff0+i)*0x100000'.
#  538|   	for (i = 3; i >= 0; i--) {
#  539|   		int tmp = (fwh_conf >> i) & 0x1;
#  540|-> 		msg_pdbg("0x%08x/0x%08x FWH decode %sabled\n",
#  541|   			 (0xff4 + i) * 0x100000,
#  542|   			 (0xff0 + i) * 0x100000,

Error: CPPCHECK_WARNING (CWE-190): [#def74]
flashrom-v1.6.0/chipset_enable.c:540: error[integerOverflow]: Signed integer overflow for expression '(0xff4+i)*0x100000'.
#  538|   	for (i = 3; i >= 0; i--) {
#  539|   		int tmp = (fwh_conf >> i) & 0x1;
#  540|-> 		msg_pdbg("0x%08x/0x%08x FWH decode %sabled\n",
#  541|   			 (0xff4 + i) * 0x100000,
#  542|   			 (0xff0 + i) * 0x100000,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
flashrom-v1.6.0/cli_classic.c:645:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
flashrom-v1.6.0/cli_classic.c:639:30: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:640:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:645:15: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:645:15: throw: if ‘flashrom_image_read’ throws an exception...
flashrom-v1.6.0/cli_classic.c:645:15: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  643|   	}
#  644|   
#  645|-> 	ret = flashrom_image_read(flash, buf, size);
#  646|   	if (ret > 0)
#  647|   		goto free_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
flashrom-v1.6.0/cli_classic.c:676:17: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/cli_classic.c:672:38: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:673:38: branch_true: following ‘true’ branch (when ‘referencefile’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:673:54: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: following ‘false’ branch (when ‘newcontents’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:675:30: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:675:13: branch_true: following ‘true’ branch...
flashrom-v1.6.0/cli_classic.c:676:17: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:676:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/cli_classic.c:676:17: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  674|   
#  675|   	if (!newcontents || (referencefile && !refcontents)) {
#  676|-> 		msg_gerr("Out of memory!\n");
#  677|   		goto _free_ret;
#  678|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
flashrom-v1.6.0/cli_classic.c:676:17: warning[-Wanalyzer-malloc-leak]: leak of ‘refcontents’
flashrom-v1.6.0/cli_classic.c:673:38: branch_true: following ‘true’ branch (when ‘referencefile’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:673:54: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:673:54: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:675:12: branch_true: following ‘true’ branch (when ‘newcontents’ is NULL)...
flashrom-v1.6.0/cli_classic.c:676:17: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:676:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/cli_classic.c:676:17: danger: ‘refcontents’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  674|   
#  675|   	if (!newcontents || (referencefile && !refcontents)) {
#  676|-> 		msg_gerr("Out of memory!\n");
#  677|   		goto _free_ret;
#  678|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
flashrom-v1.6.0/cli_classic.c:682:21: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/cli_classic.c:672:38: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:673:38: branch_false: following ‘false’ branch (when ‘referencefile’ is NULL)...
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/cli_classic.c:681:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:682:21: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:682:21: throw: if ‘read_buf_from_file’ throws an exception...
flashrom-v1.6.0/cli_classic.c:682:21: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  680|   	/* Read '-w' argument first... */
#  681|   	if (filename) {
#  682|-> 		if (read_buf_from_file(newcontents, flash_size, filename))
#  683|   			goto _free_ret;
#  684|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
flashrom-v1.6.0/cli_classic.c:682:21: warning[-Wanalyzer-malloc-leak]: leak of ‘refcontents’
flashrom-v1.6.0/cli_classic.c:673:38: branch_true: following ‘true’ branch (when ‘referencefile’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:673:54: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:673:54: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: following ‘false’ branch (when ‘newcontents’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:675:30: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:675:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/cli_classic.c:681:12: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:681:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:682:21: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:682:21: throw: if ‘read_buf_from_file’ throws an exception...
flashrom-v1.6.0/cli_classic.c:682:21: danger: ‘refcontents’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  680|   	/* Read '-w' argument first... */
#  681|   	if (filename) {
#  682|-> 		if (read_buf_from_file(newcontents, flash_size, filename))
#  683|   			goto _free_ret;
#  684|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
flashrom-v1.6.0/cli_classic.c:689:40: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/cli_classic.c:672:38: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:673:38: branch_false: following ‘false’ branch (when ‘referencefile’ is NULL)...
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/cli_classic.c:681:12: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
flashrom-v1.6.0/cli_classic.c:689:40: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:689:40: throw: if ‘get_layout’ throws an exception...
flashrom-v1.6.0/cli_classic.c:689:40: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  687|   	 * args if needed.
#  688|   	 */
#  689|-> 	if (read_buf_from_include_args(get_layout(flash), newcontents))
#  690|   		goto _free_ret;
#  691|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
flashrom-v1.6.0/cli_classic.c:689:40: warning[-Wanalyzer-malloc-leak]: leak of ‘refcontents’
flashrom-v1.6.0/cli_classic.c:673:38: branch_true: following ‘true’ branch (when ‘referencefile’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:673:54: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:673:54: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:675:12: branch_false: following ‘false’ branch (when ‘newcontents’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:675:30: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:675:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/cli_classic.c:681:12: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:681:12: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
flashrom-v1.6.0/cli_classic.c:689:40: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:689:40: throw: if ‘get_layout’ throws an exception...
flashrom-v1.6.0/cli_classic.c:689:40: danger: ‘refcontents’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  687|   	 * args if needed.
#  688|   	 */
#  689|-> 	if (read_buf_from_include_args(get_layout(flash), newcontents))
#  690|   		goto _free_ret;
#  691|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
flashrom-v1.6.0/cli_classic.c:718:21: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/cli_classic.c:710:38: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:711:12: branch_false: following ‘false’ branch (when ‘newcontents’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:717:12: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:717:12: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:718:21: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:718:21: throw: if ‘read_buf_from_file’ throws an exception...
flashrom-v1.6.0/cli_classic.c:718:21: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  716|   	/* Read '-v' argument first... */
#  717|   	if (filename) {
#  718|-> 		if (read_buf_from_file(newcontents, flash_size, filename))
#  719|   			goto _free_ret;
#  720|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
flashrom-v1.6.0/cli_classic.c:725:40: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/cli_classic.c:710:38: acquire_memory: allocated here
flashrom-v1.6.0/cli_classic.c:711:12: branch_false: following ‘false’ branch (when ‘newcontents’ is non-NULL)...
flashrom-v1.6.0/cli_classic.c:717:12: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:717:12: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
flashrom-v1.6.0/cli_classic.c:725:40: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:725:40: throw: if ‘get_layout’ throws an exception...
flashrom-v1.6.0/cli_classic.c:725:40: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  723|   	 * args if needed.
#  724|   	 */
#  725|-> 	if (read_buf_from_include_args(get_layout(flash), newcontents))
#  726|   		goto _free_ret;
#  727|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def84]
flashrom-v1.6.0/cli_classic.c:937:53: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*options.pparam’
flashrom-v1.6.0/cli_classic.c:790:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
flashrom-v1.6.0/cli_classic.c:792:17: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:922:28: branch_false: following ‘false’ branch...
flashrom-v1.6.0/cli_classic.c:922:28: branch_false: ...to here
flashrom-v1.6.0/cli_classic.c:930:37: branch_true: following ‘true’ branch...
flashrom-v1.6.0/cli_classic.c:931:40: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:936:67: acquire_memory: this call could return NULL
flashrom-v1.6.0/cli_classic.c:937:53: danger: ‘strdup(optarg + ((long unsigned int)namelen + 1))’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  935|   					case ':':
#  936|   						options->pparam = strdup(optarg + namelen + 1);
#  937|-> 						if (!strlen(options->pparam)) {
#  938|   							free(options->pparam);
#  939|   							options->pparam = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def85]
flashrom-v1.6.0/cli_classic.c:937:53: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options.pparam’
flashrom-v1.6.0/cli_classic.c:1043:5: enter_function: entry to ‘main’
flashrom-v1.6.0/cli_classic.c:1120:9: call_function: calling ‘parse_options’ from ‘main’
#  935|   					case ':':
#  936|   						options->pparam = strdup(optarg + namelen + 1);
#  937|-> 						if (!strlen(options->pparam)) {
#  938|   							free(options->pparam);
#  939|   							options->pparam = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
flashrom-v1.6.0/cli_classic.c:982:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*options.logfile’
flashrom-v1.6.0/cli_classic.c:790:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
flashrom-v1.6.0/cli_classic.c:792:17: branch_true: ...to here
flashrom-v1.6.0/cli_classic.c:981:44: acquire_memory: this call could return NULL
flashrom-v1.6.0/cli_classic.c:982:29: danger: ‘strdup(optarg)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  980|   
#  981|   			options->logfile = strdup(optarg);
#  982|-> 			if (options->logfile[0] == '\0') {
#  983|   				cli_classic_abort_usage("No log filename specified.\n");
#  984|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
flashrom-v1.6.0/cli_classic.c:982:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options.logfile’
flashrom-v1.6.0/cli_classic.c:1043:5: enter_function: entry to ‘main’
flashrom-v1.6.0/cli_classic.c:1120:9: call_function: calling ‘parse_options’ from ‘main’
#  980|   
#  981|   			options->logfile = strdup(optarg);
#  982|-> 			if (options->logfile[0] == '\0') {
#  983|   				cli_classic_abort_usage("No log filename specified.\n");
#  984|   			}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def88]
flashrom-v1.6.0/cli_output.c:175:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
flashrom-v1.6.0/cli_output.c:164:9: acquire_resource: ‘va_copy’ called here
flashrom-v1.6.0/cli_output.c:169:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/cli_output.c:170:23: branch_true: ...to here
flashrom-v1.6.0/cli_output.c:174:20: branch_true: following ‘true’ branch (when ‘level != 5’)...
flashrom-v1.6.0/cli_output.c:175:25: branch_true: ...to here
flashrom-v1.6.0/cli_output.c:175:25: throw: if ‘fflush’ throws an exception...
flashrom-v1.6.0/cli_output.c:175:25: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  173|   		 * time-critical operations. Don't slow them down by flushing. */
#  174|   		if (level != FLASHROM_MSG_SPEW)
#  175|-> 			fflush(output_type);
#  176|   	}
#  177|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def89]
flashrom-v1.6.0/cli_output.c:182:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
flashrom-v1.6.0/cli_output.c:164:9: acquire_resource: ‘va_copy’ called here
flashrom-v1.6.0/cli_output.c:178:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/cli_output.c:181:20: branch_true: following ‘true’ branch (when ‘level != 5’)...
flashrom-v1.6.0/cli_output.c:182:25: branch_true: ...to here
flashrom-v1.6.0/cli_output.c:182:25: throw: if ‘fflush’ throws an exception...
flashrom-v1.6.0/cli_output.c:182:25: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  180|   		update_line_state(fmt);
#  181|   		if (level != FLASHROM_MSG_SPEW)
#  182|-> 			fflush(logfile);
#  183|   	}
#  184|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
flashrom-v1.6.0/dediprog.c:1208:15: warning[-Wanalyzer-malloc-leak]: leak of ‘dp_data’
flashrom-v1.6.0/dediprog.c:1199:41: acquire_memory: allocated here
flashrom-v1.6.0/dediprog.c:1200:12: branch_false: following ‘false’ branch (when ‘dp_data’ is non-NULL)...
flashrom-v1.6.0/dediprog.c:1205:9: branch_false: ...to here
flashrom-v1.6.0/dediprog.c:1208:15: throw: if ‘libusb_init’ throws an exception...
flashrom-v1.6.0/dediprog.c:1208:15: danger: ‘dp_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1206|   
# 1207|   	/* Here comes the USB stuff. */
# 1208|-> 	ret = libusb_init(&dp_data->usb_ctx);
# 1209|   	if (ret) {
# 1210|   		msg_perr("Could not initialize libusb!\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
flashrom-v1.6.0/developerbox_spi.c:175:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/developerbox_spi.c:151:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/developerbox_spi.c:156:26: branch_false: ...to here
flashrom-v1.6.0/developerbox_spi.c:162:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/developerbox_spi.c:167:40: branch_false: ...to here
flashrom-v1.6.0/developerbox_spi.c:167:40: acquire_memory: allocated here
flashrom-v1.6.0/developerbox_spi.c:168:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/developerbox_spi.c:172:9: branch_false: ...to here
flashrom-v1.6.0/developerbox_spi.c:175:13: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/developerbox_spi.c:175:13: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  173|   	data->cp210x_handle = cp210x_handle;
#  174|   
#  175|-> 	if (register_shutdown(developerbox_spi_shutdown, data)) {
#  176|   		free(data);
#  177|   		goto err_exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
flashrom-v1.6.0/dirtyjtag_spi.c:77:19: warning[-Wanalyzer-malloc-leak]: leak of ‘rxtx_buffer’
flashrom-v1.6.0/dirtyjtag_spi.c:128:12: enter_function: entry to ‘dirtyjtag_djtag1_spi_send_command’
flashrom-v1.6.0/dirtyjtag_spi.c:136:32: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:137:12: branch_false: following ‘false’ branch (when ‘rxtx_buffer’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:142:9: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:143:28: branch_true: following ‘true’ branch (when ‘i < num_xfer’)...
flashrom-v1.6.0/dirtyjtag_spi.c:144:30: branch_true: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:155:21: call_function: calling ‘dirtyjtag_send’ from ‘dirtyjtag_djtag1_spi_send_command’
#   75|   {
#   76|   	int transferred;
#   77|-> 	int ret = libusb_bulk_transfer(djtag_data->libusb_handle,
#   78|   		dirtyjtag_write_endpoint,
#   79|   		data,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
flashrom-v1.6.0/dirtyjtag_spi.c:84:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rxtx_buffer’
flashrom-v1.6.0/dirtyjtag_spi.c:128:12: enter_function: entry to ‘dirtyjtag_djtag1_spi_send_command’
flashrom-v1.6.0/dirtyjtag_spi.c:136:32: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:137:12: branch_false: following ‘false’ branch (when ‘rxtx_buffer’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:142:9: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:143:28: branch_true: following ‘true’ branch (when ‘i < num_xfer’)...
flashrom-v1.6.0/dirtyjtag_spi.c:144:30: branch_true: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:155:21: call_function: calling ‘dirtyjtag_send’ from ‘dirtyjtag_djtag1_spi_send_command’
#   82|   		dirtyjtag_timeout);
#   83|   	if (ret != 0) {
#   84|-> 		msg_perr("%s: failed to send query command\n", __func__);
#   85|   		return -1;
#   86|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
flashrom-v1.6.0/dirtyjtag_spi.c:88:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rxtx_buffer’
flashrom-v1.6.0/dirtyjtag_spi.c:128:12: enter_function: entry to ‘dirtyjtag_djtag1_spi_send_command’
flashrom-v1.6.0/dirtyjtag_spi.c:136:32: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:137:12: branch_false: following ‘false’ branch (when ‘rxtx_buffer’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:142:9: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:143:28: branch_true: following ‘true’ branch (when ‘i < num_xfer’)...
flashrom-v1.6.0/dirtyjtag_spi.c:144:30: branch_true: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:155:21: call_function: calling ‘dirtyjtag_send’ from ‘dirtyjtag_djtag1_spi_send_command’
#   86|   	}
#   87|   	if (transferred != (int)len) {
#   88|-> 		msg_perr("%s: failed to send whole packet\n", __func__);
#   89|   		return -1;
#   90|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
flashrom-v1.6.0/dirtyjtag_spi.c:98:19: warning[-Wanalyzer-malloc-leak]: leak of ‘rxtx_buffer’
flashrom-v1.6.0/dirtyjtag_spi.c:128:12: enter_function: entry to ‘dirtyjtag_djtag1_spi_send_command’
flashrom-v1.6.0/dirtyjtag_spi.c:136:32: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:137:12: branch_false: following ‘false’ branch (when ‘rxtx_buffer’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:142:9: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:143:28: branch_true: following ‘true’ branch (when ‘i < num_xfer’)...
flashrom-v1.6.0/dirtyjtag_spi.c:144:30: branch_true: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:155:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/dirtyjtag_spi.c:158:21: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:158:21: call_function: calling ‘dirtyjtag_receive’ from ‘dirtyjtag_djtag1_spi_send_command’
#   96|   {
#   97|   	int transferred;
#   98|-> 	int ret = libusb_bulk_transfer(djtag_data->libusb_handle,
#   99|   		dirtyjtag_read_endpoint,
#  100|   		data,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
flashrom-v1.6.0/dirtyjtag_spi.c:105:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rxtx_buffer’
flashrom-v1.6.0/dirtyjtag_spi.c:128:12: enter_function: entry to ‘dirtyjtag_djtag1_spi_send_command’
flashrom-v1.6.0/dirtyjtag_spi.c:136:32: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:137:12: branch_false: following ‘false’ branch (when ‘rxtx_buffer’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:142:9: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:143:28: branch_true: following ‘true’ branch (when ‘i < num_xfer’)...
flashrom-v1.6.0/dirtyjtag_spi.c:144:30: branch_true: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:155:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/dirtyjtag_spi.c:158:21: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:158:21: call_function: calling ‘dirtyjtag_receive’ from ‘dirtyjtag_djtag1_spi_send_command’
#  103|   		dirtyjtag_timeout);
#  104|   	if (ret != 0) {
#  105|-> 		msg_perr("%s: Failed to read SPI commands\n", __func__);
#  106|   		return -1;
#  107|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
flashrom-v1.6.0/dirtyjtag_spi.c:110:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rxtx_buffer’
flashrom-v1.6.0/dirtyjtag_spi.c:128:12: enter_function: entry to ‘dirtyjtag_djtag1_spi_send_command’
flashrom-v1.6.0/dirtyjtag_spi.c:136:32: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:137:12: branch_false: following ‘false’ branch (when ‘rxtx_buffer’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:142:9: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:143:28: branch_true: following ‘true’ branch (when ‘i < num_xfer’)...
flashrom-v1.6.0/dirtyjtag_spi.c:144:30: branch_true: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:155:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/dirtyjtag_spi.c:158:21: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:158:21: call_function: calling ‘dirtyjtag_receive’ from ‘dirtyjtag_djtag1_spi_send_command’
#  108|   
#  109|   	if (expected != -1 && transferred != expected) {
#  110|-> 		msg_perr("%s: failed to meet expected\n", __func__);
#  111|   		return -1;
#  112|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
flashrom-v1.6.0/dirtyjtag_spi.c:213:19: warning[-Wanalyzer-malloc-leak]: leak of ‘djtag_data’
flashrom-v1.6.0/dirtyjtag_spi.c:207:22: acquire_memory: allocated here
flashrom-v1.6.0/dirtyjtag_spi.c:208:12: branch_false: following ‘false’ branch (when ‘djtag_data’ is non-NULL)...
flashrom-v1.6.0/dirtyjtag_spi.c:213:31: branch_false: ...to here
flashrom-v1.6.0/dirtyjtag_spi.c:213:19: throw: if ‘libusb_init’ throws an exception...
flashrom-v1.6.0/dirtyjtag_spi.c:213:19: danger: ‘djtag_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  211|   	}
#  212|   
#  213|-> 	int ret = libusb_init(&djtag_data->libusb_ctx);
#  214|   	if (ret < 0) {
#  215|   		msg_perr("%s: couldn't initialize libusb!\n", __func__);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
flashrom-v1.6.0/drkaiser.c:106:30: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/drkaiser.c:85:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/drkaiser.c:88:16: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:89:12: branch_false: following ‘false’ branch (when ‘addr != 0’)...
flashrom-v1.6.0/drkaiser.c:93:15: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:94:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/drkaiser.c:97:38: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:97:38: acquire_memory: allocated here
flashrom-v1.6.0/drkaiser.c:98:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/drkaiser.c:102:9: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:106:30: throw: if ‘pci_read_word’ throws an exception...
flashrom-v1.6.0/drkaiser.c:106:30: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  104|   
#  105|   	/* Write magic register to enable flash write. */
#  106|-> 	data->flash_access = pci_read_word(dev, PCI_MAGIC_DRKAISER_ADDR);
#  107|   	pci_write_word(dev, PCI_MAGIC_DRKAISER_ADDR, PCI_MAGIC_DRKAISER_VALUE);
#  108|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
flashrom-v1.6.0/drkaiser.c:107:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/drkaiser.c:85:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/drkaiser.c:88:16: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:89:12: branch_false: following ‘false’ branch (when ‘addr != 0’)...
flashrom-v1.6.0/drkaiser.c:93:15: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:94:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/drkaiser.c:97:38: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:97:38: acquire_memory: allocated here
flashrom-v1.6.0/drkaiser.c:98:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/drkaiser.c:102:9: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:107:9: throw: if ‘pci_write_word’ throws an exception...
flashrom-v1.6.0/drkaiser.c:107:9: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  105|   	/* Write magic register to enable flash write. */
#  106|   	data->flash_access = pci_read_word(dev, PCI_MAGIC_DRKAISER_ADDR);
#  107|-> 	pci_write_word(dev, PCI_MAGIC_DRKAISER_ADDR, PCI_MAGIC_DRKAISER_VALUE);
#  108|   
#  109|   	max_rom_decode.parallel = 128 * 1024;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
flashrom-v1.6.0/drkaiser.c:111:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/drkaiser.c:85:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/drkaiser.c:88:16: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:89:12: branch_false: following ‘false’ branch (when ‘addr != 0’)...
flashrom-v1.6.0/drkaiser.c:93:15: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:94:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/drkaiser.c:97:38: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:97:38: acquire_memory: allocated here
flashrom-v1.6.0/drkaiser.c:98:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/drkaiser.c:102:9: branch_false: ...to here
flashrom-v1.6.0/drkaiser.c:111:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/drkaiser.c:111:16: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  109|   	max_rom_decode.parallel = 128 * 1024;
#  110|   
#  111|-> 	return register_par_master(&par_master_drkaiser, BUS_PARALLEL, data);
#  112|   }
#  113|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
flashrom-v1.6.0/dummyflasher.c:1013:19: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1394:12: enter_function: entry to ‘dummy_init’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1411:13: call_function: calling ‘init_data’ from ‘dummy_init’
# 1011|   	int size = -1;  /* size for VARIABLE_SIZE chip device */
# 1012|   
# 1013|-> 	bustext = extract_programmer_param_str(cfg, "bus");
# 1014|   	msg_pdbg("Requested buses are: %s\n", bustext ? bustext : "default");
# 1015|   	if (!bustext)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
flashrom-v1.6.0/dummyflasher.c:1014:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1394:12: enter_function: entry to ‘dummy_init’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1411:13: call_function: calling ‘init_data’ from ‘dummy_init’
# 1012|   
# 1013|   	bustext = extract_programmer_param_str(cfg, "bus");
# 1014|-> 	msg_pdbg("Requested buses are: %s\n", bustext ? bustext : "default");
# 1015|   	if (!bustext)
# 1016|   		bustext = strdup("parallel+lpc+fwh+spi+prog");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
flashrom-v1.6.0/dummyflasher.c:1018:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bustext’
flashrom-v1.6.0/dummyflasher.c:1015:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/dummyflasher.c:1016:27: branch_true: ...to here
flashrom-v1.6.0/dummyflasher.c:1016:27: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1018:9: throw: if ‘tolower_string’ throws an exception...
flashrom-v1.6.0/dummyflasher.c:1018:9: danger: ‘bustext’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1016|   		bustext = strdup("parallel+lpc+fwh+spi+prog");
# 1017|   	/* Convert the parameters to lowercase. */
# 1018|-> 	tolower_string(bustext);
# 1019|   
# 1020|   	*dummy_buses_supported = BUS_NONE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
flashrom-v1.6.0/dummyflasher.c:1018:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1394:12: enter_function: entry to ‘dummy_init’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1411:13: call_function: calling ‘init_data’ from ‘dummy_init’
# 1016|   		bustext = strdup("parallel+lpc+fwh+spi+prog");
# 1017|   	/* Convert the parameters to lowercase. */
# 1018|-> 	tolower_string(bustext);
# 1019|   
# 1020|   	*dummy_buses_supported = BUS_NONE;

Error: CPPCHECK_WARNING (CWE-476): [#def106]
flashrom-v1.6.0/dummyflasher.c:1021: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bustext
# 1019|   
# 1020|   	*dummy_buses_supported = BUS_NONE;
# 1021|-> 	if (strstr(bustext, "parallel")) {
# 1022|   		*dummy_buses_supported |= BUS_PARALLEL;
# 1023|   		msg_pdbg("Enabling support for %s flash.\n", "parallel");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
flashrom-v1.6.0/dummyflasher.c:1023:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1394:12: enter_function: entry to ‘dummy_init’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1411:13: call_function: calling ‘init_data’ from ‘dummy_init’
# 1021|   	if (strstr(bustext, "parallel")) {
# 1022|   		*dummy_buses_supported |= BUS_PARALLEL;
# 1023|-> 		msg_pdbg("Enabling support for %s flash.\n", "parallel");
# 1024|   	}
# 1025|   	if (strstr(bustext, "lpc")) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
flashrom-v1.6.0/dummyflasher.c:1027:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1394:12: enter_function: entry to ‘dummy_init’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1411:13: call_function: calling ‘init_data’ from ‘dummy_init’
# 1025|   	if (strstr(bustext, "lpc")) {
# 1026|   		*dummy_buses_supported |= BUS_LPC;
# 1027|-> 		msg_pdbg("Enabling support for %s flash.\n", "LPC");
# 1028|   	}
# 1029|   	if (strstr(bustext, "fwh")) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
flashrom-v1.6.0/dummyflasher.c:1031:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1394:12: enter_function: entry to ‘dummy_init’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1411:13: call_function: calling ‘init_data’ from ‘dummy_init’
# 1029|   	if (strstr(bustext, "fwh")) {
# 1030|   		*dummy_buses_supported |= BUS_FWH;
# 1031|-> 		msg_pdbg("Enabling support for %s flash.\n", "FWH");
# 1032|   	}
# 1033|   	if (strstr(bustext, "spi")) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
flashrom-v1.6.0/dummyflasher.c:1408:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/dummyflasher.c:1399:33: acquire_memory: allocated here
flashrom-v1.6.0/dummyflasher.c:1400:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/dummyflasher.c:1405:9: branch_false: ...to here
flashrom-v1.6.0/dummyflasher.c:1408:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/dummyflasher.c:1408:9: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1406|   	data->spi_write_256_chunksize = 256;
# 1407|   
# 1408|-> 	msg_pspew("%s\n", __func__);
# 1409|   
# 1410|   	enum chipbustype dummy_buses_supported;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
flashrom-v1.6.0/erasure_layout.c:383:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:383:17: throw: if ‘read_flash’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:383:17: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  381|   			goto _end;
#  382|   		}
#  383|-> 		read_flash(flashctx, curcontents + region_start, region_start, start_buf_len);
#  384|   		memcpy(old_start_buf, newcontents + region_start, start_buf_len);
#  385|   		memcpy(newcontents + region_start, curcontents + region_start, start_buf_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
flashrom-v1.6.0/erasure_layout.c:391:25: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_true: following ‘true’ branch (when ‘old_end_buf’ is NULL)...
flashrom-v1.6.0/erasure_layout.c:391:25: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:391:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:391:25: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  389|   		old_end_buf = (uint8_t *)malloc(end_buf_len);
#  390|   		if (!old_end_buf) {
#  391|-> 			msg_cerr("Not enough memory!\n");
#  392|   			ret = -1;
#  393|   			goto _end;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
flashrom-v1.6.0/erasure_layout.c:395:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_end_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_false: following ‘false’ branch (when ‘start_buf_len == 0’)...
flashrom-v1.6.0/erasure_layout.c:387:12: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:389:42: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:395:17: throw: if ‘read_flash’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:395:17: danger: ‘old_end_buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  393|   			goto _end;
#  394|   		}
#  395|-> 		read_flash(flashctx, curcontents + end_offset, end_offset, end_buf_len);
#  396|   		memcpy(old_end_buf, newcontents + end_offset, end_buf_len);
#  397|   		memcpy(newcontents + end_offset, curcontents + end_offset, end_buf_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
flashrom-v1.6.0/erasure_layout.c:395:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:395:17: throw: if ‘read_flash’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:395:17: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  393|   			goto _end;
#  394|   		}
#  395|-> 		read_flash(flashctx, curcontents + end_offset, end_offset, end_buf_len);
#  396|   		memcpy(old_end_buf, newcontents + end_offset, end_buf_len);
#  397|   		memcpy(newcontents + end_offset, curcontents + end_offset, end_buf_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
flashrom-v1.6.0/erasure_layout.c:403:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_end_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_false: following ‘false’ branch (when ‘start_buf_len == 0’)...
flashrom-v1.6.0/erasure_layout.c:387:12: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:389:42: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:403:17: throw: if ‘get_flash_region’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:403:17: danger: ‘old_end_buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  401|   	for (unsigned int addr = region_start; addr <= region_end; addr += len) {
#  402|   		struct flash_region region;
#  403|-> 		get_flash_region(flashctx, addr, &region);
#  404|   		len = min(region_end, region.end) - addr + 1;
#  405|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
flashrom-v1.6.0/erasure_layout.c:403:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:403:17: throw: if ‘get_flash_region’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:403:17: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
#  401|   	for (unsigned int addr = region_start; addr <= region_end; addr += len) {
#  402|   		struct flash_region region;
#  403|-> 		get_flash_region(flashctx, addr, &region);
#  404|   		len = min(region_end, region.end) - addr + 1;
#  405|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
flashrom-v1.6.0/erasure_layout.c:404:23: warning[-Wanalyzer-malloc-leak]: leak of ‘old_end_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_false: following ‘false’ branch (when ‘start_buf_len == 0’)...
flashrom-v1.6.0/erasure_layout.c:387:12: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:389:42: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:404:23: throw: if ‘min’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:404:23: danger: ‘old_end_buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  402|   		struct flash_region region;
#  403|   		get_flash_region(flashctx, addr, &region);
#  404|-> 		len = min(region_end, region.end) - addr + 1;
#  405|   
#  406|   		if (region.write_prot) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
flashrom-v1.6.0/erasure_layout.c:404:23: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:404:23: throw: if ‘min’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:404:23: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10)
#  402|   		struct flash_region region;
#  403|   		get_flash_region(flashctx, addr, &region);
#  404|-> 		len = min(region_end, region.end) - addr + 1;
#  405|   
#  406|   		if (region.write_prot) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
flashrom-v1.6.0/erasure_layout.c:407:25: warning[-Wanalyzer-malloc-leak]: leak of ‘old_end_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_false: following ‘false’ branch (when ‘start_buf_len == 0’)...
flashrom-v1.6.0/erasure_layout.c:387:12: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:389:42: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:406:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:407:25: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:407:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:407:25: danger: ‘old_end_buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
#  405|   
#  406|   		if (region.write_prot) {
#  407|-> 			msg_gdbg("%s: cannot erase inside %s "
#  408|   				"region (%#08"PRIx32"..%#08"PRIx32"), skipping range (%#08x..%#08x).\n",
#  409|   				 __func__, region.name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
flashrom-v1.6.0/erasure_layout.c:407:25: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:406:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:407:25: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:407:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:407:25: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
#  405|   
#  406|   		if (region.write_prot) {
#  407|-> 			msg_gdbg("%s: cannot erase inside %s "
#  408|   				"region (%#08"PRIx32"..%#08"PRIx32"), skipping range (%#08x..%#08x).\n",
#  409|   				 __func__, region.name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
flashrom-v1.6.0/erasure_layout.c:416:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_end_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_false: following ‘false’ branch (when ‘start_buf_len == 0’)...
flashrom-v1.6.0/erasure_layout.c:387:12: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:389:42: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:416:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:416:17: danger: ‘old_end_buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  414|   		}
#  415|   
#  416|-> 		msg_gdbg("%s: %s region (%#08"PRIx32"..%#08"PRIx32") is "
#  417|   			"writable, erasing range (%#08x..%#08x).\n",
#  418|   			 __func__, region.name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
flashrom-v1.6.0/erasure_layout.c:416:17: warning[-Wanalyzer-malloc-leak]: leak of ‘old_start_buf’
flashrom-v1.6.0/erasure_layout.c:359:5: enter_function: entry to ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: call_function: calling ‘align_region’ from ‘erase_write’
flashrom-v1.6.0/erasure_layout.c:365:9: return_function: returning to ‘erase_write’ from ‘align_region’
flashrom-v1.6.0/erasure_layout.c:376:12: branch_true: following ‘true’ branch (when ‘start_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:377:44: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:377:44: acquire_memory: allocated here
flashrom-v1.6.0/erasure_layout.c:378:20: branch_false: following ‘false’ branch (when ‘old_start_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:383:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:387:12: branch_true: following ‘true’ branch (when ‘end_buf_len != 0’)...
flashrom-v1.6.0/erasure_layout.c:388:27: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:390:20: branch_false: following ‘false’ branch (when ‘old_end_buf’ is non-NULL)...
flashrom-v1.6.0/erasure_layout.c:395:17: branch_false: ...to here
flashrom-v1.6.0/erasure_layout.c:401:48: branch_true: following ‘true’ branch...
flashrom-v1.6.0/erasure_layout.c:403:17: branch_true: ...to here
flashrom-v1.6.0/erasure_layout.c:416:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/erasure_layout.c:416:17: danger: ‘old_start_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/10)
#  414|   		}
#  415|   
#  416|-> 		msg_gdbg("%s: %s region (%#08"PRIx32"..%#08"PRIx32") is "
#  417|   			"writable, erasing range (%#08x..%#08x).\n",
#  418|   			 __func__, region.name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
flashrom-v1.6.0/flashrom.c:233:23: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
#  231|   	void *ret = NULL;
#  232|   	if (map_flash_region)
#  233|-> 		ret = map_flash_region(descr, phys_addr, len);
#  234|   	msg_gspew("%s: mapping %s from 0x%0*" PRIxPTR " to 0x%0*" PRIxPTR "\n",
#  235|   		__func__, descr, PRIxPTR_WIDTH, phys_addr, PRIxPTR_WIDTH, (uintptr_t) ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
flashrom-v1.6.0/flashrom.c:234:9: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
#  232|   	if (map_flash_region)
#  233|   		ret = map_flash_region(descr, phys_addr, len);
#  234|-> 	msg_gspew("%s: mapping %s from 0x%0*" PRIxPTR " to 0x%0*" PRIxPTR "\n",
#  235|   		__func__, descr, PRIxPTR_WIDTH, phys_addr, PRIxPTR_WIDTH, (uintptr_t) ret);
#  236|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
flashrom-v1.6.0/flashrom.c:381:31: warning[-Wanalyzer-malloc-leak]: leak of ‘region.name’
flashrom-v1.6.0/flashrom.c:1036:5: enter_function: entry to ‘write_flash’
flashrom-v1.6.0/flashrom.c:1045:41: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1047:17: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1047:17: call_function: calling ‘get_flash_region’ from ‘write_flash’
#  379|   		region->name = strdup("");
#  380|   		region->start = 0;
#  381|-> 		region->end = flashrom_flash_getsize(flash) - 1;
#  382|   		region->read_prot = false;
#  383|   		region->write_prot = false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
flashrom-v1.6.0/flashrom.c:599:28: warning[-Wanalyzer-malloc-leak]: leak of ‘region.name’
flashrom-v1.6.0/flashrom.c:1503:12: enter_function: entry to ‘verify_by_layout’
flashrom-v1.6.0/flashrom.c:1512:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1514:33: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1517:21: call_function: calling ‘read_flash’ from ‘verify_by_layout’
#  597|   		get_flash_region(flash, addr, &region);
#  598|   
#  599|-> 		read_len = min(start + len, region.end + 1) - addr;
#  600|   		uint8_t *rbuf = buf + addr - start;
#  601|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
flashrom-v1.6.0/flashrom.c:619:17: warning[-Wanalyzer-malloc-leak]: leak of ‘region.name’
flashrom-v1.6.0/flashrom.c:1503:12: enter_function: entry to ‘verify_by_layout’
flashrom-v1.6.0/flashrom.c:1512:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1514:33: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1517:21: call_function: calling ‘read_flash’ from ‘verify_by_layout’
#  617|   			return -1;
#  618|   		}
#  619|-> 		msg_gdbg("%s: %s region (%#08"PRIx32"..%#08"PRIx32") is readable, reading range (%#08x..%#08x).\n",
#  620|   			 __func__, region.name, region.start, region.end, addr, addr + read_len - 1);
#  621|   		free(region.name);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def128]
flashrom-v1.6.0/flashrom.c:624:27: warning[-Wanalyzer-jump-through-null]: jump through null pointer
flashrom-v1.6.0/flashrom.c:1503:12: enter_function: entry to ‘verify_by_layout’
flashrom-v1.6.0/flashrom.c:1512:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1514:33: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1517:21: call_function: calling ‘read_flash’ from ‘verify_by_layout’
#  622|   
#  623|   		read_func_t *read_func = lookup_read_func_ptr(flash->chip);
#  624|-> 		int ret = read_func(flash, rbuf, addr, read_len);
#  625|   		if (ret) {
#  626|   			msg_gerr("%s: failed to read (%#08x..%#08x).\n", __func__, addr, addr + read_len - 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
flashrom-v1.6.0/flashrom.c:714:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
#  712|   	unsigned int i, j, limit;
#  713|   	for (j = 0; j < len / gran; j++) {
#  714|-> 		limit = min (gran, len - j * gran);
#  715|   		/* Are 'have' and 'want' identical? */
#  716|   		if (!memcmp(have + j * gran, want + j * gran, limit))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
flashrom-v1.6.0/flashrom.c:714:25: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
#  712|   	unsigned int i, j, limit;
#  713|   	for (j = 0; j < len / gran; j++) {
#  714|-> 		limit = min (gran, len - j * gran);
#  715|   		/* Are 'have' and 'want' identical? */
#  716|   		if (!memcmp(have + j * gran, want + j * gran, limit))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
flashrom-v1.6.0/flashrom.c:963:31: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’
flashrom-v1.6.0/flashrom.c:956:15: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:957:12: branch_false: following ‘false’ branch (when ‘ret’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:957:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:960:34: branch_true: following ‘true’ branch (when ‘i != 5’)...
flashrom-v1.6.0/flashrom.c:962:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:962:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:963:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:963:31: throw: if ‘strcat_realloc’ throws an exception...
flashrom-v1.6.0/flashrom.c:963:31: danger: ‘ret’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  961|   	{
#  962|   		if (bustype & bustypes[i].type) {
#  963|-> 			ptr = strcat_realloc(ret, bustypes[i].name);
#  964|   			if (!ptr) {
#  965|   				free(ret);

Error: GCC_ANALYZER_WARNING (CWE-124): [#def132]
flashrom-v1.6.0/flashrom.c:973:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite
flashrom-v1.6.0/flashrom.c:957:12: branch_false: following ‘false’ branch (when ‘ret’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:957:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:960:34: branch_true: following ‘true’ branch (when ‘i != 5’)...
flashrom-v1.6.0/flashrom.c:962:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:962:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:960:60: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:962:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:960:60: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:973:9: danger: out-of-bounds write at byte -2 but region starts at byte 0
#  971|   
#  972|   	/* Kill last comma. */
#  973|-> 	ret[strlen(ret) - 2] = '\0';
#  974|   	ptr = realloc(ret, strlen(ret) + 1);
#  975|   	if (!ptr)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
flashrom-v1.6.0/flashrom.c:1049:29: warning[-Wanalyzer-malloc-leak]: leak of ‘region.name’
flashrom-v1.6.0/flashrom.c:1036:5: enter_function: entry to ‘write_flash’
flashrom-v1.6.0/flashrom.c:1045:41: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1047:17: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1047:17: call_function: calling ‘get_flash_region’ from ‘write_flash’
flashrom-v1.6.0/flashrom.c:1047:17: return_function: returning to ‘write_flash’ from ‘get_flash_region’
flashrom-v1.6.0/flashrom.c:1049:29: throw: if ‘min’ throws an exception...
flashrom-v1.6.0/flashrom.c:1049:29: danger: ‘region.name’ leaks here; was allocated at [(6)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/5)
# 1047|   		get_flash_region(flash, addr, &region);
# 1048|   
# 1049|-> 		write_len = min(start + len, region.end + 1) - addr;
# 1050|   		const uint8_t *rbuf = buf + addr - start;
# 1051|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
flashrom-v1.6.0/flashrom.c:1059:17: warning[-Wanalyzer-malloc-leak]: leak of ‘region.name’
flashrom-v1.6.0/flashrom.c:1036:5: enter_function: entry to ‘write_flash’
flashrom-v1.6.0/flashrom.c:1045:41: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1047:17: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1047:17: call_function: calling ‘get_flash_region’ from ‘write_flash’
flashrom-v1.6.0/flashrom.c:1047:17: return_function: returning to ‘write_flash’ from ‘get_flash_region’
flashrom-v1.6.0/flashrom.c:1052:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1059:17: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1059:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1059:17: danger: ‘region.name’ leaks here; was allocated at [(6)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/5)
# 1057|   		}
# 1058|   
# 1059|-> 		msg_gdbg("%s: %s region (%#08"PRIx32"..%#08"PRIx32") is writable, writing range (%#08x..%#08x).\n",
# 1060|   			 __func__, region.name, region.start, region.end, addr, addr + write_len - 1);
# 1061|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
flashrom-v1.6.0/flashrom.c:1207:9: warning[-Wanalyzer-malloc-leak]: leak of ‘flashbuses_to_text(*flash_58(D)->chip.bustype)’
flashrom-v1.6.0/flashrom.c:1117:5: enter_function: entry to ‘probe_flash’
flashrom-v1.6.0/flashrom.c:1200:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1203:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1203:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1206:34: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1206:15: call_function: calling ‘flashbuses_to_text’ from ‘probe_flash’
flashrom-v1.6.0/flashrom.c:1206:15: return_function: returning to ‘probe_flash’ from ‘flashbuses_to_text’
flashrom-v1.6.0/flashrom.c:1207:9: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1207:9: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1207:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1207:9: danger: ‘flashbuses_to_text(*flash_58(D)->chip.bustype)’ leaks here; was allocated at [(10)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/9)
# 1205|   
# 1206|   	tmp = flashbuses_to_text(flash->chip->bustype);
# 1207|-> 	msg_cinfo("%s %s flash chip \"%s\" (%d kB, %s) ", force ? "Assuming" : "Found",
# 1208|   		  flash->chip->vendor, flash->chip->name, flash->chip->total_size, tmp ? tmp : "?");
# 1209|   	free(tmp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
flashrom-v1.6.0/flashrom.c:1237:60: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1429:9: call_function: calling ‘setup_progress_from_layout’ from ‘erase_by_layout’
# 1235|   		return;
# 1236|   
# 1237|-> 	const struct flashrom_layout *const flash_layout = get_layout(flashctx);
# 1238|   
# 1239|   	size_t total = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
flashrom-v1.6.0/flashrom.c:1237:60: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1429:9: call_function: calling ‘setup_progress_from_layout’ from ‘erase_by_layout’
# 1235|   		return;
# 1236|   
# 1237|-> 	const struct flashrom_layout *const flash_layout = get_layout(flashctx);
# 1238|   
# 1239|   	size_t total = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
flashrom-v1.6.0/flashrom.c:1241:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1429:9: call_function: calling ‘setup_progress_from_layout’ from ‘erase_by_layout’
# 1239|   	size_t total = 0;
# 1240|   	const struct romentry *entry = NULL;
# 1241|-> 	while ((entry = layout_next_included(flash_layout, entry))) {
# 1242|   		const struct flash_region *region = &entry->region;
# 1243|   		total += region->end - region->start + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
flashrom-v1.6.0/flashrom.c:1241:25: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1429:9: call_function: calling ‘setup_progress_from_layout’ from ‘erase_by_layout’
# 1239|   	size_t total = 0;
# 1240|   	const struct romentry *entry = NULL;
# 1241|-> 	while ((entry = layout_next_included(flash_layout, entry))) {
# 1242|   		const struct flash_region *region = &entry->region;
# 1243|   		total += region->end - region->start + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
flashrom-v1.6.0/flashrom.c:1246:9: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1429:9: call_function: calling ‘setup_progress_from_layout’ from ‘erase_by_layout’
# 1244|   	}
# 1245|   
# 1246|-> 	init_progress(flashctx, stage, total);
# 1247|   }
# 1248|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
flashrom-v1.6.0/flashrom.c:1246:9: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1429:9: call_function: calling ‘setup_progress_from_layout’ from ‘erase_by_layout’
# 1244|   	}
# 1245|   
# 1246|-> 	init_progress(flashctx, stage, total);
# 1247|   }
# 1248|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
flashrom-v1.6.0/flashrom.c:1258:54: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1256|   		return;
# 1257|   
# 1258|-> 	const struct flashrom_layout *flash_layout = get_layout(flashctx);
# 1259|   	const size_t page_size = flashctx->chip->page_size;
# 1260|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
flashrom-v1.6.0/flashrom.c:1258:54: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1256|   		return;
# 1257|   
# 1258|-> 	const struct flashrom_layout *flash_layout = get_layout(flashctx);
# 1259|   	const size_t page_size = flashctx->chip->page_size;
# 1260|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
flashrom-v1.6.0/flashrom.c:1264:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1262|   
# 1263|   	const struct romentry *entry = NULL;
# 1264|-> 	while ((entry = layout_next_included(flash_layout, entry))) {
# 1265|   		const struct flash_region *region = &entry->region;
# 1266|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
flashrom-v1.6.0/flashrom.c:1264:25: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1262|   
# 1263|   	const struct romentry *entry = NULL;
# 1264|-> 	while ((entry = layout_next_included(flash_layout, entry))) {
# 1265|   		const struct flash_region *region = &entry->region;
# 1266|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
flashrom-v1.6.0/flashrom.c:1270:52: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1268|   			size_t offset;
# 1269|   			for (offset = region->start; offset <= region->end; offset += page_size) {
# 1270|-> 				const size_t len = min(page_size, region->end + 1 - offset);
# 1271|   
# 1272|   				if (need_erase(have, want, len, flashctx->chip->gran, ERASED_VALUE(flashctx)))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
flashrom-v1.6.0/flashrom.c:1270:52: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1268|   			size_t offset;
# 1269|   			for (offset = region->start; offset <= region->end; offset += page_size) {
# 1270|-> 				const size_t len = min(page_size, region->end + 1 - offset);
# 1271|   
# 1272|   				if (need_erase(have, want, len, flashctx->chip->gran, ERASED_VALUE(flashctx)))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
flashrom-v1.6.0/flashrom.c:1295:9: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1293|   	}
# 1294|   
# 1295|-> 	init_progress(flashctx, stage, total);
# 1296|   }
# 1297|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
flashrom-v1.6.0/flashrom.c:1295:9: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1404:12: enter_function: entry to ‘erase_by_layout’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1430:9: call_function: calling ‘setup_progress_from_layout_and_diff’ from ‘erase_by_layout’
# 1293|   	}
# 1294|   
# 1295|-> 	init_progress(flashctx, stage, total);
# 1296|   }
# 1297|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
flashrom-v1.6.0/flashrom.c:1411:9: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1411:9: throw: if ‘create_erase_layout’ throws an exception...
flashrom-v1.6.0/flashrom.c:1411:9: danger: ‘curcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
# 1409|   	uint8_t* newcontents = malloc(flash_size);
# 1410|   	struct erase_layout *erase_layout;
# 1411|-> 	create_erase_layout(flashctx, &erase_layout);
# 1412|   	int ret = 0;
# 1413|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
flashrom-v1.6.0/flashrom.c:1411:9: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1411:9: throw: if ‘create_erase_layout’ throws an exception...
flashrom-v1.6.0/flashrom.c:1411:9: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
# 1409|   	uint8_t* newcontents = malloc(flash_size);
# 1410|   	struct erase_layout *erase_layout;
# 1411|-> 	create_erase_layout(flashctx, &erase_layout);
# 1412|   	int ret = 0;
# 1413|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
flashrom-v1.6.0/flashrom.c:1432:60: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1432:60: throw: if ‘get_layout’ throws an exception...
flashrom-v1.6.0/flashrom.c:1432:60: danger: ‘curcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
# 1430|   	setup_progress_from_layout_and_diff(flashctx, curcontents, newcontents, FLASHROM_PROGRESS_ERASE);
# 1431|   
# 1432|-> 	const struct flashrom_layout *const flash_layout = get_layout(flashctx);
# 1433|   	const struct romentry *entry = NULL;
# 1434|   	while ((entry = layout_next_included(flash_layout, entry))) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
flashrom-v1.6.0/flashrom.c:1432:60: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1432:60: throw: if ‘get_layout’ throws an exception...
flashrom-v1.6.0/flashrom.c:1432:60: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
# 1430|   	setup_progress_from_layout_and_diff(flashctx, curcontents, newcontents, FLASHROM_PROGRESS_ERASE);
# 1431|   
# 1432|-> 	const struct flashrom_layout *const flash_layout = get_layout(flashctx);
# 1433|   	const struct romentry *entry = NULL;
# 1434|   	while ((entry = layout_next_included(flash_layout, entry))) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
flashrom-v1.6.0/flashrom.c:1434:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1434:25: throw: if ‘layout_next_included’ throws an exception...
flashrom-v1.6.0/flashrom.c:1434:25: danger: ‘curcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
# 1432|   	const struct flashrom_layout *const flash_layout = get_layout(flashctx);
# 1433|   	const struct romentry *entry = NULL;
# 1434|-> 	while ((entry = layout_next_included(flash_layout, entry))) {
# 1435|   		ret = erase_write(flashctx, entry->region.start, entry->region.end, curcontents, newcontents, erase_layout, &all_skipped);
# 1436|   		if (ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
flashrom-v1.6.0/flashrom.c:1434:25: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1434:25: throw: if ‘layout_next_included’ throws an exception...
flashrom-v1.6.0/flashrom.c:1434:25: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
# 1432|   	const struct flashrom_layout *const flash_layout = get_layout(flashctx);
# 1433|   	const struct romentry *entry = NULL;
# 1434|-> 	while ((entry = layout_next_included(flash_layout, entry))) {
# 1435|   		ret = erase_write(flashctx, entry->region.start, entry->region.end, curcontents, newcontents, erase_layout, &all_skipped);
# 1436|   		if (ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
flashrom-v1.6.0/flashrom.c:1435:23: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1408:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1434:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1435:23: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1435:23: throw: if ‘erase_write’ throws an exception...
flashrom-v1.6.0/flashrom.c:1435:23: danger: ‘curcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
# 1433|   	const struct romentry *entry = NULL;
# 1434|   	while ((entry = layout_next_included(flash_layout, entry))) {
# 1435|-> 		ret = erase_write(flashctx, entry->region.start, entry->region.end, curcontents, newcontents, erase_layout, &all_skipped);
# 1436|   		if (ret) {
# 1437|   			ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
flashrom-v1.6.0/flashrom.c:1435:23: warning[-Wanalyzer-malloc-leak]: leak of ‘newcontents’
flashrom-v1.6.0/flashrom.c:1409:32: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1415:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1421:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1421:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1426:30: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1434:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1435:23: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1435:23: throw: if ‘erase_write’ throws an exception...
flashrom-v1.6.0/flashrom.c:1435:23: danger: ‘newcontents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0)
# 1433|   	const struct romentry *entry = NULL;
# 1434|   	while ((entry = layout_next_included(flash_layout, entry))) {
# 1435|-> 		ret = erase_write(flashctx, entry->region.start, entry->region.end, curcontents, newcontents, erase_layout, &all_skipped);
# 1436|   		if (ret) {
# 1437|   			ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
flashrom-v1.6.0/flashrom.c:1686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1990:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_write’
# 1684|   
# 1685|   	if (!programmer_may_write && (write_it || erase_it)) {
# 1686|-> 		msg_perr("Write/erase is not working yet on your programmer in "
# 1687|   			 "its current configuration.\n");
# 1688|   		/* --force is the wrong approach, but it's the best we can do

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
flashrom-v1.6.0/flashrom.c:1693:17: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1990:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_write’
# 1691|   		if (!force)
# 1692|   			return 1;
# 1693|-> 		msg_cerr("Continuing anyway.\n");
# 1694|   	}
# 1695|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
flashrom-v1.6.0/flashrom.c:1699:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
# 1697|   		/* Everything needs read. */
# 1698|   		if (chip->tested.read == BAD) {
# 1699|-> 			msg_cerr("Read is not working on this chip. ");
# 1700|   			if (!force)
# 1701|   				return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
flashrom-v1.6.0/flashrom.c:1702:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
# 1700|   			if (!force)
# 1701|   				return 1;
# 1702|-> 			msg_cerr("Continuing anyway.\n");
# 1703|   		}
# 1704|   		if (!lookup_read_func_ptr(chip)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def162]
flashrom-v1.6.0/flashrom.c:1705:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
# 1703|   		}
# 1704|   		if (!lookup_read_func_ptr(chip)) {
# 1705|-> 			msg_cerr("flashrom has no read function for this "
# 1706|   				 "flash chip.\n");
# 1707|   			return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
flashrom-v1.6.0/flashrom.c:1713:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1990:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_write’
# 1711|   		/* Write needs erase. */
# 1712|   		if (chip->tested.erase == NA) {
# 1713|-> 			msg_cerr("Erase is not possible on this chip.\n");
# 1714|   			return 1;
# 1715|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
flashrom-v1.6.0/flashrom.c:1717:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1990:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_write’
# 1715|   		}
# 1716|   		if (chip->tested.erase == BAD) {
# 1717|-> 			msg_cerr("Erase is not working on this chip. ");
# 1718|   			if (!force)
# 1719|   				return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
flashrom-v1.6.0/flashrom.c:1720:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1990:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_write’
# 1718|   			if (!force)
# 1719|   				return 1;
# 1720|-> 			msg_cerr("Continuing anyway.\n");
# 1721|   		}
# 1722|   		if(count_usable_erasers(flash) == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def166]
flashrom-v1.6.0/flashrom.c:1825:17: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
# 1823|   {
# 1824|   	if (chip_safety_check(flash, flash->flags.force, read_it, write_it, erase_it, verify_it)) {
# 1825|-> 		msg_cerr("Aborting.\n");
# 1826|   		return 1;
# 1827|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def167]
flashrom-v1.6.0/flashrom.c:1829:13: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
# 1827|   	}
# 1828|   
# 1829|-> 	if (layout_sanity_checks(flash)) {
# 1830|   		msg_cerr("Requested regions can not be handled. Aborting.\n");
# 1831|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
flashrom-v1.6.0/flashrom.c:1830:17: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:2104:5: enter_function: entry to ‘flashrom_image_verify’
flashrom-v1.6.0/flashrom.c:2109:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:2113:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2113:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:2114:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:2121:13: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:2121:13: call_function: calling ‘prepare_flash_access’ from ‘flashrom_image_verify’
# 1828|   
# 1829|   	if (layout_sanity_checks(flash)) {
# 1830|-> 		msg_cerr("Requested regions can not be handled. Aborting.\n");
# 1831|   		return 1;
# 1832|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def169]
flashrom-v1.6.0/flashrom.c:1974:17: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_true: following ‘true’ branch (when ‘verify_all != 0’)...
flashrom-v1.6.0/flashrom.c:1972:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch (when ‘curcontents’ is non-NULL)...
flashrom-v1.6.0/flashrom.c:1973:44: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:13: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1974:17: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1974:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1974:17: danger: ‘curcontents’ leaks here; was allocated at [(3)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/2)
# 1972|   		oldcontents = malloc(flash_size);
# 1973|   	if (!curcontents || (verify_all && !oldcontents)) {
# 1974|-> 		msg_gerr("Out of memory!\n");
# 1975|   		goto _free_ret;
# 1976|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def170]
flashrom-v1.6.0/flashrom.c:1974:17: warning[-Wanalyzer-malloc-leak]: leak of ‘oldcontents’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1971:12: branch_true: following ‘true’ branch (when ‘verify_all != 0’)...
flashrom-v1.6.0/flashrom.c:1972:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1972:31: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1973:12: branch_true: following ‘true’ branch (when ‘curcontents’ is NULL)...
flashrom-v1.6.0/flashrom.c:1974:17: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1974:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1974:17: danger: ‘oldcontents’ leaks here; was allocated at [(5)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/4)
# 1972|   		oldcontents = malloc(flash_size);
# 1973|   	if (!curcontents || (verify_all && !oldcontents)) {
# 1974|-> 		msg_gerr("Out of memory!\n");
# 1975|   		goto _free_ret;
# 1976|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
flashrom-v1.6.0/flashrom.c:1979:41: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1979:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1979:41: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1979:41: throw: if ‘cb_check_image’ throws an exception...
flashrom-v1.6.0/flashrom.c:1979:41: danger: ‘curcontents’ leaks here; was allocated at [(4)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/3)
# 1977|   
# 1978|   #if CONFIG_INTERNAL == 1
# 1979|-> 	if (is_internal_programmer() && cb_check_image(newcontents, flash_size) < 0) {
# 1980|   		if (flashctx->flags.force_boardmismatch) {
# 1981|   			msg_pinfo("Proceeding anyway because user forced us to.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
flashrom-v1.6.0/flashrom.c:1979:41: warning[-Wanalyzer-malloc-leak]: leak of ‘oldcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1971:12: branch_true: following ‘true’ branch (when ‘verify_all != 0’)...
flashrom-v1.6.0/flashrom.c:1972:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1972:31: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1979:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1979:41: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1979:41: throw: if ‘cb_check_image’ throws an exception...
flashrom-v1.6.0/flashrom.c:1979:41: danger: ‘oldcontents’ leaks here; was allocated at [(6)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/5)
# 1977|   
# 1978|   #if CONFIG_INTERNAL == 1
# 1979|-> 	if (is_internal_programmer() && cb_check_image(newcontents, flash_size) < 0) {
# 1980|   		if (flashctx->flags.force_boardmismatch) {
# 1981|   			msg_pinfo("Proceeding anyway because user forced us to.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
flashrom-v1.6.0/flashrom.c:1981:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1979:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1980:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1981:25: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1981:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1981:25: danger: ‘curcontents’ leaks here; was allocated at [(4)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/3)
# 1979|   	if (is_internal_programmer() && cb_check_image(newcontents, flash_size) < 0) {
# 1980|   		if (flashctx->flags.force_boardmismatch) {
# 1981|-> 			msg_pinfo("Proceeding anyway because user forced us to.\n");
# 1982|   		} else {
# 1983|   			msg_perr("Aborting. You can override this with "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def174]
flashrom-v1.6.0/flashrom.c:1981:25: warning[-Wanalyzer-malloc-leak]: leak of ‘oldcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1971:12: branch_true: following ‘true’ branch (when ‘verify_all != 0’)...
flashrom-v1.6.0/flashrom.c:1972:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1972:31: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1979:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1980:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1981:25: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1981:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1981:25: danger: ‘oldcontents’ leaks here; was allocated at [(6)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/5)
# 1979|   	if (is_internal_programmer() && cb_check_image(newcontents, flash_size) < 0) {
# 1980|   		if (flashctx->flags.force_boardmismatch) {
# 1981|-> 			msg_pinfo("Proceeding anyway because user forced us to.\n");
# 1982|   		} else {
# 1983|   			msg_perr("Aborting. You can override this with "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
flashrom-v1.6.0/flashrom.c:1983:25: warning[-Wanalyzer-malloc-leak]: leak of ‘curcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1969:38: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1971:12: branch_false: following ‘false’ branch (when ‘verify_all == 0’)...
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1979:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1980:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1983:25: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1983:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1983:25: danger: ‘curcontents’ leaks here; was allocated at [(4)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/3)
# 1981|   			msg_pinfo("Proceeding anyway because user forced us to.\n");
# 1982|   		} else {
# 1983|-> 			msg_perr("Aborting. You can override this with "
# 1984|   				 "-p internal:boardmismatch=force.\n");
# 1985|   			goto _free_ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
flashrom-v1.6.0/flashrom.c:1983:25: warning[-Wanalyzer-malloc-leak]: leak of ‘oldcontents’
flashrom-v1.6.0/flashrom.c:1953:5: enter_function: entry to ‘flashrom_image_write’
flashrom-v1.6.0/flashrom.c:1962:12: branch_false: following ‘false’ branch (when ‘flash_size == buffer_len’)...
flashrom-v1.6.0/flashrom.c:1969:38: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1971:12: branch_true: following ‘true’ branch (when ‘verify_all != 0’)...
flashrom-v1.6.0/flashrom.c:1972:31: branch_true: ...to here
flashrom-v1.6.0/flashrom.c:1972:31: acquire_memory: allocated here
flashrom-v1.6.0/flashrom.c:1973:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1979:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/flashrom.c:1980:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/flashrom.c:1983:25: branch_false: ...to here
flashrom-v1.6.0/flashrom.c:1983:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/flashrom.c:1983:25: danger: ‘oldcontents’ leaks here; was allocated at [(6)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/5)
# 1981|   			msg_pinfo("Proceeding anyway because user forced us to.\n");
# 1982|   		} else {
# 1983|-> 			msg_perr("Aborting. You can override this with "
# 1984|   				 "-p internal:boardmismatch=force.\n");
# 1985|   			goto _free_ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
flashrom-v1.6.0/fmap.c:169:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
flashrom-v1.6.0/fmap.c:158:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/fmap.c:163:15: branch_false: ...to here
flashrom-v1.6.0/fmap.c:163:15: acquire_memory: allocated here
flashrom-v1.6.0/fmap.c:164:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
flashrom-v1.6.0/fmap.c:169:15: branch_false: ...to here
flashrom-v1.6.0/fmap.c:169:15: throw: if ‘read_flash’ throws an exception...
flashrom-v1.6.0/fmap.c:169:15: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  167|   	}
#  168|   
#  169|-> 	ret = read_flash(flashctx, buf + rom_offset, rom_offset, len);
#  170|   	if (ret) {
#  171|   		msg_pdbg("Cannot read ROM contents.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
flashrom-v1.6.0/fmap.c:242:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fmap’
flashrom-v1.6.0/fmap.c:195:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/fmap.c:198:12: branch_false: ...to here
flashrom-v1.6.0/fmap.c:198:12: branch_false: following ‘false’ branch (when ‘len > 55’)...
flashrom-v1.6.0/fmap.c:201:13: branch_false: ...to here
flashrom-v1.6.0/fmap.c:201:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/fmap.c:204:16: branch_false: ...to here
flashrom-v1.6.0/fmap.c:204:16: acquire_memory: allocated here
flashrom-v1.6.0/fmap.c:205:12: branch_false: following ‘false’ branch (when ‘fmap’ is non-NULL)...
flashrom-v1.6.0/fmap.c:215:9: branch_false: ...to here
flashrom-v1.6.0/fmap.c:227:38: branch_true: following ‘true’ branch (when ‘stride >= min_stride’)...
flashrom-v1.6.0/fmap.c:228:20: branch_true: ...to here
flashrom-v1.6.0/fmap.c:228:20: branch_false: following ‘false’ branch (when ‘stride <= len’)...
flashrom-v1.6.0/fmap.c:228:20: branch_false: ...to here
flashrom-v1.6.0/fmap.c:232:22: branch_true: following ‘true’ branch...
flashrom-v1.6.0/fmap.c:234:39: branch_true: ...to here
flashrom-v1.6.0/fmap.c:236:28: branch_false: following ‘false’ branch...
flashrom-v1.6.0/fmap.c:242:29: branch_false: ...to here
flashrom-v1.6.0/fmap.c:242:29: throw: if ‘read_flash’ throws an exception...
flashrom-v1.6.0/fmap.c:242:29: danger: ‘fmap’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  240|   			/* Read errors are considered non-fatal since we may
#  241|   			 * encounter locked regions and want to continue. */
#  242|-> 			if (read_flash(flashctx, (uint8_t *)fmap, offset, sig_len)) {
#  243|   				/*
#  244|   				 * Print in verbose mode only to avoid excessive

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
flashrom-v1.6.0/gfxnvidia.c:133:30: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/gfxnvidia.c:110:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/gfxnvidia.c:113:33: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:114:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/gfxnvidia.c:117:9: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:121:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/gfxnvidia.c:124:39: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:124:39: acquire_memory: allocated here
flashrom-v1.6.0/gfxnvidia.c:125:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/gfxnvidia.c:129:9: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:133:30: throw: if ‘pci_read_long’ throws an exception...
flashrom-v1.6.0/gfxnvidia.c:133:30: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  131|   
#  132|   	/* Allow access to flash interface (will disable screen). */
#  133|-> 	data->flash_access = pci_read_long(dev, REG_FLASH_ACCESS);
#  134|   	reg32 = data->flash_access & ~BIT_FLASH_ACCESS;
#  135|   	pci_write_long(dev, REG_FLASH_ACCESS, reg32);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
flashrom-v1.6.0/gfxnvidia.c:135:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/gfxnvidia.c:110:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/gfxnvidia.c:113:33: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:114:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/gfxnvidia.c:117:9: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:121:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/gfxnvidia.c:124:39: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:124:39: acquire_memory: allocated here
flashrom-v1.6.0/gfxnvidia.c:125:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/gfxnvidia.c:129:9: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:135:9: throw: if ‘pci_write_long’ throws an exception...
flashrom-v1.6.0/gfxnvidia.c:135:9: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  133|   	data->flash_access = pci_read_long(dev, REG_FLASH_ACCESS);
#  134|   	reg32 = data->flash_access & ~BIT_FLASH_ACCESS;
#  135|-> 	pci_write_long(dev, REG_FLASH_ACCESS, reg32);
#  136|   
#  137|   	/* Write/erase doesn't work. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
flashrom-v1.6.0/gfxnvidia.c:139:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/gfxnvidia.c:110:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/gfxnvidia.c:113:33: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:114:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/gfxnvidia.c:117:9: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:121:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/gfxnvidia.c:124:39: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:124:39: acquire_memory: allocated here
flashrom-v1.6.0/gfxnvidia.c:125:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/gfxnvidia.c:129:9: branch_false: ...to here
flashrom-v1.6.0/gfxnvidia.c:139:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/gfxnvidia.c:139:16: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  137|   	/* Write/erase doesn't work. */
#  138|   	programmer_may_write = false;
#  139|-> 	return register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, data);
#  140|   }
#  141|   

Error: GCC_ANALYZER_WARNING (CWE-465): [#def182]
flashrom-v1.6.0/helpers.c:55:12: warning[-Wanalyzer-deref-before-check]: check of ‘dest’ for NULL after already dereferencing it
#   53|   {
#   54|   	dest = realloc(dest, strlen(dest) + strlen(src) + 1);
#   55|-> 	if (!dest) {
#   56|   		msg_gerr("Out of memory!\n");
#   57|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def183]
flashrom-v1.6.0/helpers_fileio.c:51:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘image’
flashrom-v1.6.0/helpers_fileio.c:40:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
flashrom-v1.6.0/helpers_fileio.c:43:25: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:43:25: acquire_resource: opened here
flashrom-v1.6.0/helpers_fileio.c:44:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:50:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:50:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:51:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:51:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:51:17: danger: ‘image’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   49|   	struct stat image_stat;
#   50|   	if (fstat(fileno(image), &image_stat) != 0) {
#   51|-> 		msg_gerr("Error: getting metadata of file \"%s\" failed: %s\n", filename, strerror(errno));
#   52|   		ret = 1;
#   53|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
flashrom-v1.6.0/helpers_fileio.c:51:17: warning[-Wanalyzer-malloc-leak]: leak of ‘image’
flashrom-v1.6.0/helpers_fileio.c:40:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
flashrom-v1.6.0/helpers_fileio.c:43:25: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:43:25: acquire_memory: allocated here
flashrom-v1.6.0/helpers_fileio.c:44:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:50:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:50:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:51:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:51:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:51:17: danger: ‘image’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   49|   	struct stat image_stat;
#   50|   	if (fstat(fileno(image), &image_stat) != 0) {
#   51|-> 		msg_gerr("Error: getting metadata of file \"%s\" failed: %s\n", filename, strerror(errno));
#   52|   		ret = 1;
#   53|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def185]
flashrom-v1.6.0/helpers_fileio.c:56:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘image’
flashrom-v1.6.0/helpers_fileio.c:40:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
flashrom-v1.6.0/helpers_fileio.c:43:25: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:43:25: acquire_resource: opened here
flashrom-v1.6.0/helpers_fileio.c:44:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:50:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:50:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:55:14: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:55:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:56:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:56:17: danger: ‘image’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   54|   	}
#   55|   	if ((image_stat.st_size != (intmax_t)size) && strcmp(filename, "-")) {
#   56|-> 		msg_gerr("Error: Image size (%jd B) doesn't match the expected size (%lu B)!\n",
#   57|   			 (intmax_t)image_stat.st_size, size);
#   58|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
flashrom-v1.6.0/helpers_fileio.c:56:17: warning[-Wanalyzer-malloc-leak]: leak of ‘image’
flashrom-v1.6.0/helpers_fileio.c:40:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
flashrom-v1.6.0/helpers_fileio.c:43:25: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:43:25: acquire_memory: allocated here
flashrom-v1.6.0/helpers_fileio.c:44:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:50:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:50:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:55:14: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:55:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:56:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:56:17: danger: ‘image’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   54|   	}
#   55|   	if ((image_stat.st_size != (intmax_t)size) && strcmp(filename, "-")) {
#   56|-> 		msg_gerr("Error: Image size (%jd B) doesn't match the expected size (%lu B)!\n",
#   57|   			 (intmax_t)image_stat.st_size, size);
#   58|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def187]
flashrom-v1.6.0/helpers_fileio.c:64:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘image’
flashrom-v1.6.0/helpers_fileio.c:40:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
flashrom-v1.6.0/helpers_fileio.c:43:25: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:43:25: acquire_resource: opened here
flashrom-v1.6.0/helpers_fileio.c:44:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:50:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:50:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:55:14: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:63:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:64:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:64:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:64:17: danger: ‘image’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#   62|   	unsigned long numbytes = fread(buf, 1, size, image);
#   63|   	if (numbytes != size) {
#   64|-> 		msg_gerr("Error: Failed to read complete file. Got %ld bytes, "
#   65|   			 "wanted %ld!\n", numbytes, size);
#   66|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
flashrom-v1.6.0/helpers_fileio.c:64:17: warning[-Wanalyzer-malloc-leak]: leak of ‘image’
flashrom-v1.6.0/helpers_fileio.c:40:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
flashrom-v1.6.0/helpers_fileio.c:43:25: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:43:25: acquire_memory: allocated here
flashrom-v1.6.0/helpers_fileio.c:44:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:50:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:50:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:55:14: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:63:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:64:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:64:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:64:17: danger: ‘image’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#   62|   	unsigned long numbytes = fread(buf, 1, size, image);
#   63|   	if (numbytes != size) {
#   64|-> 		msg_gerr("Error: Failed to read complete file. Got %ld bytes, "
#   65|   			 "wanted %ld!\n", numbytes, size);
#   66|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def189]
flashrom-v1.6.0/helpers_fileio.c:102:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
flashrom-v1.6.0/helpers_fileio.c:91:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:95:22: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:95:22: acquire_resource: opened here
flashrom-v1.6.0/helpers_fileio.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:100:34: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:101:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:102:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:102:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:102:17: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  100|   	unsigned long numbytes = fwrite(buf, 1, size, image);
#  101|   	if (numbytes != size) {
#  102|-> 		msg_gerr("Error: file %s could not be written completely.\n", filename);
#  103|   		ret = 1;
#  104|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def190]
flashrom-v1.6.0/helpers_fileio.c:102:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’
flashrom-v1.6.0/helpers_fileio.c:91:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:95:22: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:95:22: acquire_memory: allocated here
flashrom-v1.6.0/helpers_fileio.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:100:34: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:101:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:102:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:102:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:102:17: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  100|   	unsigned long numbytes = fwrite(buf, 1, size, image);
#  101|   	if (numbytes != size) {
#  102|-> 		msg_gerr("Error: file %s could not be written completely.\n", filename);
#  103|   		ret = 1;
#  104|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def191]
flashrom-v1.6.0/helpers_fileio.c:106:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
flashrom-v1.6.0/helpers_fileio.c:91:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:95:22: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:95:22: acquire_resource: opened here
flashrom-v1.6.0/helpers_fileio.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:100:34: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:101:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:106:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:106:13: throw: if ‘fflush’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:106:13: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  104|   		goto out;
#  105|   	}
#  106|-> 	if (fflush(image)) {
#  107|   		msg_gerr("Error: flushing file \"%s\" failed: %s\n", filename, strerror(errno));
#  108|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
flashrom-v1.6.0/helpers_fileio.c:106:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’
flashrom-v1.6.0/helpers_fileio.c:91:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:95:22: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:95:22: acquire_memory: allocated here
flashrom-v1.6.0/helpers_fileio.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:100:34: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:101:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:106:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:106:13: throw: if ‘fflush’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:106:13: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  104|   		goto out;
#  105|   	}
#  106|-> 	if (fflush(image)) {
#  107|   		msg_gerr("Error: flushing file \"%s\" failed: %s\n", filename, strerror(errno));
#  108|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def193]
flashrom-v1.6.0/helpers_fileio.c:107:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
flashrom-v1.6.0/helpers_fileio.c:91:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:95:22: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:95:22: acquire_resource: opened here
flashrom-v1.6.0/helpers_fileio.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:100:34: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:101:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:106:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:106:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:107:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:107:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:107:17: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  105|   	}
#  106|   	if (fflush(image)) {
#  107|-> 		msg_gerr("Error: flushing file \"%s\" failed: %s\n", filename, strerror(errno));
#  108|   		ret = 1;
#  109|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
flashrom-v1.6.0/helpers_fileio.c:107:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’
flashrom-v1.6.0/helpers_fileio.c:91:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
flashrom-v1.6.0/helpers_fileio.c:95:22: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:95:22: acquire_memory: allocated here
flashrom-v1.6.0/helpers_fileio.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:100:34: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:101:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/helpers_fileio.c:106:13: branch_false: ...to here
flashrom-v1.6.0/helpers_fileio.c:106:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/helpers_fileio.c:107:17: branch_true: ...to here
flashrom-v1.6.0/helpers_fileio.c:107:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/helpers_fileio.c:107:17: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  105|   	}
#  106|   	if (fflush(image)) {
#  107|-> 		msg_gerr("Error: flushing file \"%s\" failed: %s\n", filename, strerror(errno));
#  108|   		ret = 1;
#  109|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
flashrom-v1.6.0/hwaccess_physmap.c:308:21: warning[-Wanalyzer-malloc-leak]: leak of ‘d’
flashrom-v1.6.0/hwaccess_physmap.c:263:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/hwaccess_physmap.c:268:12: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:276:12: branch_false: following ‘false’ branch (when ‘virt_addr != 18446744073709551615’)...
flashrom-v1.6.0/hwaccess_physmap.c:298:12: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:298:12: branch_true: following ‘true’ branch (when ‘autocleanup != 0’)...
flashrom-v1.6.0/hwaccess_physmap.c:299:47: branch_true: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:299:47: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:300:20: branch_false: following ‘false’ branch (when ‘d’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:306:17: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:308:21: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:308:21: danger: ‘d’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  306|   		d->virt_addr = virt_addr;
#  307|   		d->len = len;
#  308|-> 		if (register_shutdown(undo_physmap, d) != 0) {
#  309|   			msg_perr("%s: Could not register shutdown function!\n", __func__);
#  310|   			physunmap_unaligned(virt_addr, len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
flashrom-v1.6.0/hwaccess_physmap.c:530:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:530:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:530:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:530:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:530:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:530:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  528|   void rmmio_writeb(uint8_t val, void *addr)
#  529|   {
#  530|-> 	register_undo_mmio_writeb(addr);
#  531|   	mmio_writeb(val, addr);
#  532|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
flashrom-v1.6.0/hwaccess_physmap.c:536:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:536:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:536:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:536:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:536:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:536:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  534|   void rmmio_writew(uint16_t val, void *addr)
#  535|   {
#  536|-> 	register_undo_mmio_writew(addr);
#  537|   	mmio_writew(val, addr);
#  538|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
flashrom-v1.6.0/hwaccess_physmap.c:542:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:542:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:542:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:542:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:542:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:542:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  540|   void rmmio_writel(uint32_t val, void *addr)
#  541|   {
#  542|-> 	register_undo_mmio_writel(addr);
#  543|   	mmio_writel(val, addr);
#  544|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
flashrom-v1.6.0/hwaccess_physmap.c:548:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:548:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:548:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:548:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:548:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:548:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  546|   void rmmio_le_writeb(uint8_t val, void *addr)
#  547|   {
#  548|-> 	register_undo_mmio_writeb(addr);
#  549|   	mmio_le_writeb(val, addr);
#  550|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
flashrom-v1.6.0/hwaccess_physmap.c:554:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:554:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:554:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:554:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:554:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:554:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  552|   void rmmio_le_writew(uint16_t val, void *addr)
#  553|   {
#  554|-> 	register_undo_mmio_writew(addr);
#  555|   	mmio_le_writew(val, addr);
#  556|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
flashrom-v1.6.0/hwaccess_physmap.c:560:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:560:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:560:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:560:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:560:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:560:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  558|   void rmmio_le_writel(uint32_t val, void *addr)
#  559|   {
#  560|-> 	register_undo_mmio_writel(addr);
#  561|   	mmio_le_writel(val, addr);
#  562|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
flashrom-v1.6.0/hwaccess_physmap.c:566:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:566:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:566:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:566:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:566:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:566:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  564|   void rmmio_valb(void *addr)
#  565|   {
#  566|-> 	register_undo_mmio_writeb(addr);
#  567|   }
#  568|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
flashrom-v1.6.0/hwaccess_physmap.c:571:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:571:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:571:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:571:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:571:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:571:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  569|   void rmmio_valw(void *addr)
#  570|   {
#  571|-> 	register_undo_mmio_writew(addr);
#  572|   }
#  573|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
flashrom-v1.6.0/hwaccess_physmap.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_mmio_write_data’
flashrom-v1.6.0/hwaccess_physmap.c:576:9: acquire_memory: allocated here
flashrom-v1.6.0/hwaccess_physmap.c:576:9: branch_false: following ‘false’ branch (when ‘undo_mmio_write_data’ is non-NULL)...
flashrom-v1.6.0/hwaccess_physmap.c:576:9: branch_false: ...to here
flashrom-v1.6.0/hwaccess_physmap.c:576:9: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/hwaccess_physmap.c:576:9: danger: ‘undo_mmio_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  574|   void rmmio_vall(void *addr)
#  575|   {
#  576|-> 	register_undo_mmio_writel(addr);
#  577|   }

Error: CPPCHECK_WARNING (CWE-758): [#def205]
flashrom-v1.6.0/ichspi.c:1988: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1986|   
# 1987|   	msg_gspew("PR%u is 0x%08"PRIx32"", i, old);
# 1988|-> 	new = old & ~((1 << PR_RP_OFF) | (1 << PR_WP_OFF));
# 1989|   	if (read_prot)
# 1990|   		new |= (1 << PR_RP_OFF);

Error: CPPCHECK_WARNING (CWE-758): [#def206]
flashrom-v1.6.0/ichspi.c:1992: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1990|   		new |= (1 << PR_RP_OFF);
# 1991|   	if (write_prot)
# 1992|-> 		new |= (1 << PR_WP_OFF);
# 1993|   	if (old == new) {
# 1994|   		msg_gspew(" already.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
flashrom-v1.6.0/it8212.c:97:31: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/it8212.c:76:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it8212.c:80:33: branch_false: ...to here
flashrom-v1.6.0/it8212.c:81:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/it8212.c:84:15: branch_false: ...to here
flashrom-v1.6.0/it8212.c:85:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it8212.c:88:36: branch_false: ...to here
flashrom-v1.6.0/it8212.c:88:36: acquire_memory: allocated here
flashrom-v1.6.0/it8212.c:89:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/it8212.c:93:9: branch_false: ...to here
flashrom-v1.6.0/it8212.c:97:31: throw: if ‘pci_read_long’ throws an exception...
flashrom-v1.6.0/it8212.c:97:31: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   95|   
#   96|   	/* Enable ROM BAR decoding. */
#   97|-> 	data->decode_access = pci_read_long(dev, PCI_ROM_ADDRESS);
#   98|   	pci_write_long(dev, PCI_ROM_ADDRESS, io_base_addr | 0x01);
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
flashrom-v1.6.0/it8212.c:98:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/it8212.c:76:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it8212.c:80:33: branch_false: ...to here
flashrom-v1.6.0/it8212.c:81:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/it8212.c:84:15: branch_false: ...to here
flashrom-v1.6.0/it8212.c:85:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it8212.c:88:36: branch_false: ...to here
flashrom-v1.6.0/it8212.c:88:36: acquire_memory: allocated here
flashrom-v1.6.0/it8212.c:89:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/it8212.c:93:9: branch_false: ...to here
flashrom-v1.6.0/it8212.c:98:9: throw: if ‘pci_write_long’ throws an exception...
flashrom-v1.6.0/it8212.c:98:9: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#   96|   	/* Enable ROM BAR decoding. */
#   97|   	data->decode_access = pci_read_long(dev, PCI_ROM_ADDRESS);
#   98|-> 	pci_write_long(dev, PCI_ROM_ADDRESS, io_base_addr | 0x01);
#   99|   
#  100|   	max_rom_decode.parallel = IT8212_MEMMAP_SIZE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
flashrom-v1.6.0/it8212.c:101:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/it8212.c:76:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it8212.c:80:33: branch_false: ...to here
flashrom-v1.6.0/it8212.c:81:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/it8212.c:84:15: branch_false: ...to here
flashrom-v1.6.0/it8212.c:85:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it8212.c:88:36: branch_false: ...to here
flashrom-v1.6.0/it8212.c:88:36: acquire_memory: allocated here
flashrom-v1.6.0/it8212.c:89:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/it8212.c:93:9: branch_false: ...to here
flashrom-v1.6.0/it8212.c:101:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/it8212.c:101:16: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#   99|   
#  100|   	max_rom_decode.parallel = IT8212_MEMMAP_SIZE;
#  101|-> 	return register_par_master(&par_master_it8212, BUS_PARALLEL, data);
#  102|   }
#  103|   const struct programmer_entry programmer_it8212 = {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
flashrom-v1.6.0/it87spi.c:439:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/it87spi.c:366:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it87spi.c:366:12: branch_false: ...to here
flashrom-v1.6.0/it87spi.c:399:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it87spi.c:426:9: branch_false: ...to here
flashrom-v1.6.0/it87spi.c:429:41: acquire_memory: allocated here
flashrom-v1.6.0/it87spi.c:430:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/it87spi.c:435:9: branch_false: ...to here
flashrom-v1.6.0/it87spi.c:438:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/it87spi.c:439:17: branch_true: ...to here
flashrom-v1.6.0/it87spi.c:439:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/it87spi.c:439:17: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  437|   
#  438|   	if (internal_buses_supported & BUS_SPI)
#  439|-> 		msg_pdbg("Overriding chipset SPI with IT87 SPI.\n");
#  440|   	/* FIXME: Add the SPI bus or replace the other buses with it? */
#  441|   	return register_spi_master(&spi_master_it87xx, data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
flashrom-v1.6.0/it87spi.c:441:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/it87spi.c:366:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it87spi.c:366:12: branch_false: ...to here
flashrom-v1.6.0/it87spi.c:399:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/it87spi.c:426:9: branch_false: ...to here
flashrom-v1.6.0/it87spi.c:429:41: acquire_memory: allocated here
flashrom-v1.6.0/it87spi.c:430:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/it87spi.c:435:9: branch_false: ...to here
flashrom-v1.6.0/it87spi.c:441:16: throw: if ‘register_spi_master’ throws an exception...
flashrom-v1.6.0/it87spi.c:441:16: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  439|   		msg_pdbg("Overriding chipset SPI with IT87 SPI.\n");
#  440|   	/* FIXME: Add the SPI bus or replace the other buses with it? */
#  441|-> 	return register_spi_master(&spi_master_it87xx, data);
#  442|   }
#  443|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
flashrom-v1.6.0/jlink_spi.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
flashrom-v1.6.0/jlink_spi.c:137:12: branch_false: following ‘false’ branch (when ‘length <= 4096’)...
flashrom-v1.6.0/jlink_spi.c:140:18: branch_false: ...to here
flashrom-v1.6.0/jlink_spi.c:140:18: acquire_memory: allocated here
flashrom-v1.6.0/jlink_spi.c:142:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
flashrom-v1.6.0/jlink_spi.c:148:9: branch_false: ...to here
flashrom-v1.6.0/jlink_spi.c:148:9: throw: if ‘reverse_bytes’ throws an exception...
flashrom-v1.6.0/jlink_spi.c:148:9: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  146|   
#  147|   	/* Reverse all bytes because the device transfers data LSB first. */
#  148|-> 	reverse_bytes(buffer, writearr, writecnt);
#  149|   
#  150|   	memset(buffer + writecnt, 0x00, readcnt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
flashrom-v1.6.0/layout.c:144:25: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp_name’
flashrom-v1.6.0/layout.c:123:12: branch_false: following ‘false’ branch (when ‘arg’ is non-NULL)...
flashrom-v1.6.0/layout.c:129:17: branch_false: ...to here
flashrom-v1.6.0/layout.c:130:12: branch_true: following ‘true’ branch (when ‘colon’ is non-NULL)...
flashrom-v1.6.0/layout.c:130:23: branch_true: ...to here
flashrom-v1.6.0/layout.c:130:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/layout.c:136:41: branch_false: ...to here
flashrom-v1.6.0/layout.c:136:28: acquire_memory: allocated here
flashrom-v1.6.0/layout.c:137:20: branch_false: following ‘false’ branch (when ‘tmp_name’ is non-NULL)...
flashrom-v1.6.0/layout.c:142:35: branch_false: ...to here
flashrom-v1.6.0/layout.c:143:20: branch_true: following ‘true’ branch (when ‘tmp_file’ is NULL)...
flashrom-v1.6.0/layout.c:144:25: branch_true: ...to here
flashrom-v1.6.0/layout.c:144:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:144:25: danger: ‘tmp_name’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  142|   		tmp_file = strdup(colon + 1);
#  143|   		if (!tmp_file) {
#  144|-> 			msg_gerr("Out of memory\n");
#  145|   			goto error;
#  146|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def214]
flashrom-v1.6.0/layout.c:173:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘name’ where non-null expected
flashrom-v1.6.0/layout.c:163:5: enter_function: entry to ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: call_function: calling ‘parse_include_args’ from ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: return_function: returning to ‘register_include_arg’ from ‘parse_include_args’
flashrom-v1.6.0/layout.c:169:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:172:14: branch_true: ...to here
flashrom-v1.6.0/layout.c:172:27: branch_true: following ‘true’ branch (when ‘tmp’ is non-NULL)...
flashrom-v1.6.0/layout.c:173:22: branch_true: ...to here
flashrom-v1.6.0/layout.c:173:22: danger: argument 2 (‘name’) from [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8) could be NULL where non-null expected
#  171|   
#  172|   	for (tmp = *args; tmp; tmp = tmp->next) {
#  173|-> 		if (!strcmp(tmp->name, name)) {
#  174|   			msg_gerr("Duplicate region name: \"%s\".\n", name);
#  175|   			goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
flashrom-v1.6.0/layout.c:174:25: warning[-Wanalyzer-malloc-leak]: leak of ‘file’
flashrom-v1.6.0/layout.c:163:5: enter_function: entry to ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: call_function: calling ‘parse_include_args’ from ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: return_function: returning to ‘register_include_arg’ from ‘parse_include_args’
flashrom-v1.6.0/layout.c:169:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:172:14: branch_true: ...to here
flashrom-v1.6.0/layout.c:172:27: branch_true: following ‘true’ branch (when ‘tmp’ is non-NULL)...
flashrom-v1.6.0/layout.c:173:22: branch_true: ...to here
flashrom-v1.6.0/layout.c:173:20: branch_true: following ‘true’ branch (when the strings are equal)...
flashrom-v1.6.0/layout.c:174:25: branch_true: ...to here
flashrom-v1.6.0/layout.c:174:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:174:25: danger: ‘file’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  172|   	for (tmp = *args; tmp; tmp = tmp->next) {
#  173|   		if (!strcmp(tmp->name, name)) {
#  174|-> 			msg_gerr("Duplicate region name: \"%s\".\n", name);
#  175|   			goto error;
#  176|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
flashrom-v1.6.0/layout.c:174:25: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
flashrom-v1.6.0/layout.c:163:5: enter_function: entry to ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: call_function: calling ‘parse_include_args’ from ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: return_function: returning to ‘register_include_arg’ from ‘parse_include_args’
flashrom-v1.6.0/layout.c:169:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:172:14: branch_true: ...to here
flashrom-v1.6.0/layout.c:172:27: branch_true: following ‘true’ branch (when ‘tmp’ is non-NULL)...
flashrom-v1.6.0/layout.c:173:22: branch_true: ...to here
flashrom-v1.6.0/layout.c:174:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:174:25: danger: ‘name’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  172|   	for (tmp = *args; tmp; tmp = tmp->next) {
#  173|   		if (!strcmp(tmp->name, name)) {
#  174|-> 			msg_gerr("Duplicate region name: \"%s\".\n", name);
#  175|   			goto error;
#  176|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def217]
flashrom-v1.6.0/layout.c:181:17: warning[-Wanalyzer-malloc-leak]: leak of ‘file’
flashrom-v1.6.0/layout.c:163:5: enter_function: entry to ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: call_function: calling ‘parse_include_args’ from ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: return_function: returning to ‘register_include_arg’ from ‘parse_include_args’
flashrom-v1.6.0/layout.c:169:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:172:14: branch_true: ...to here
flashrom-v1.6.0/layout.c:180:12: branch_true: following ‘true’ branch (when ‘tmp’ is NULL)...
flashrom-v1.6.0/layout.c:181:17: branch_true: ...to here
flashrom-v1.6.0/layout.c:181:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:181:17: danger: ‘file’ leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  179|   	tmp = malloc(sizeof(*tmp));
#  180|   	if (tmp == NULL) {
#  181|-> 		msg_gerr("Out of memory\n");
#  182|   		goto error;
#  183|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
flashrom-v1.6.0/layout.c:181:17: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
flashrom-v1.6.0/layout.c:163:5: enter_function: entry to ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: call_function: calling ‘parse_include_args’ from ‘register_include_arg’
flashrom-v1.6.0/layout.c:169:14: return_function: returning to ‘register_include_arg’ from ‘parse_include_args’
flashrom-v1.6.0/layout.c:169:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:172:14: branch_true: ...to here
flashrom-v1.6.0/layout.c:172:27: branch_false: following ‘false’ branch (when ‘tmp’ is NULL)...
flashrom-v1.6.0/layout.c:179:15: branch_false: ...to here
flashrom-v1.6.0/layout.c:180:12: branch_true: following ‘true’ branch (when ‘tmp’ is NULL)...
flashrom-v1.6.0/layout.c:181:17: branch_true: ...to here
flashrom-v1.6.0/layout.c:181:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:181:17: danger: ‘name’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  179|   	tmp = malloc(sizeof(*tmp));
#  180|   	if (tmp == NULL) {
#  181|-> 		msg_gerr("Out of memory\n");
#  182|   		goto error;
#  183|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def219]
flashrom-v1.6.0/layout.c:199: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: filename
#  197|   static char *sanitise_filename(char *filename)
#  198|   {
#  199|-> 	for (unsigned i = 0; filename[i]; i++) {
#  200|   		if (isspace((unsigned char)filename[i]))
#  201|   			filename[i] = '_';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def220]
flashrom-v1.6.0/layout.c:199:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘filename’
flashrom-v1.6.0/layout.c:374:6: enter_function: entry to ‘prepare_layout_for_extraction’
flashrom-v1.6.0/layout.c:379:25: call_function: inlined call to ‘mutable_layout_next’ from ‘prepare_layout_for_extraction’
flashrom-v1.6.0/layout.c:379:16: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:380:17: branch_true: ...to here
flashrom-v1.6.0/layout.c:382:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:383:64: branch_true: ...to here
flashrom-v1.6.0/layout.c:383:39: acquire_memory: this call could return NULL
flashrom-v1.6.0/layout.c:383:39: call_function: calling ‘sanitise_filename’ from ‘prepare_layout_for_extraction’
#  197|   static char *sanitise_filename(char *filename)
#  198|   {
#  199|-> 	for (unsigned i = 0; filename[i]; i++) {
#  200|   		if (isspace((unsigned char)filename[i]))
#  201|   			filename[i] = '_';

Error: CPPCHECK_WARNING (CWE-476): [#def221]
flashrom-v1.6.0/layout.c:200: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: filename
#  198|   {
#  199|   	for (unsigned i = 0; filename[i]; i++) {
#  200|-> 		if (isspace((unsigned char)filename[i]))
#  201|   			filename[i] = '_';
#  202|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
flashrom-v1.6.0/layout.c:453:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
flashrom-v1.6.0/layout.c:436:12: branch_false: following ‘false’ branch (when ‘entry’ is non-NULL)...
flashrom-v1.6.0/layout.c:440:35: branch_false: ...to here
flashrom-v1.6.0/layout.c:446:51: acquire_memory: allocated here
flashrom-v1.6.0/layout.c:450:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/layout.c:453:9: branch_false: ...to here
flashrom-v1.6.0/layout.c:453:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:453:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  451|   		goto _err_ret;
#  452|   
#  453|-> 	msg_gdbg("Added layout entry %08zx - %08zx named %s\n", start, end, name);
#  454|   	layout->head = entry;
#  455|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
flashrom-v1.6.0/layout.c:453:9: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
flashrom-v1.6.0/layout.c:435:40: acquire_memory: allocated here
flashrom-v1.6.0/layout.c:436:12: branch_false: following ‘false’ branch (when ‘entry’ is non-NULL)...
flashrom-v1.6.0/layout.c:440:35: branch_false: ...to here
flashrom-v1.6.0/layout.c:450:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/layout.c:453:9: branch_false: ...to here
flashrom-v1.6.0/layout.c:453:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:453:9: danger: ‘entry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  451|   		goto _err_ret;
#  452|   
#  453|-> 	msg_gdbg("Added layout entry %08zx - %08zx named %s\n", start, end, name);
#  454|   	layout->head = entry;
#  455|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
flashrom-v1.6.0/layout.c:458:9: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
flashrom-v1.6.0/layout.c:435:40: acquire_memory: allocated here
flashrom-v1.6.0/layout.c:436:12: branch_false: following ‘false’ branch (when ‘entry’ is non-NULL)...
flashrom-v1.6.0/layout.c:440:35: branch_false: ...to here
flashrom-v1.6.0/layout.c:450:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/layout.c:451:17: branch_true: ...to here
flashrom-v1.6.0/layout.c:458:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/layout.c:458:9: danger: ‘entry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  456|   
#  457|   _err_ret:
#  458|-> 	msg_gerr("Error adding layout entry: %s\n", strerror(errno));
#  459|   	free(entry);
#  460|   	return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
flashrom-v1.6.0/libflashrom.c:111:23: warning[-Wanalyzer-malloc-leak]: leak of ‘desc’
flashrom-v1.6.0/libflashrom.c:467:5: enter_function: entry to ‘flashrom_layout_read_from_ifd’
flashrom-v1.6.0/libflashrom.c:476:28: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:477:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/libflashrom.c:480:9: branch_false: ...to here
flashrom-v1.6.0/libflashrom.c:480:9: call_function: calling ‘print’ from ‘flashrom_layout_read_from_ifd’
#  109|   		va_list args;
#  110|   		va_start(args, fmt);
#  111|-> 		ret = global_log_callback(level, fmt, args);
#  112|   		va_end(args);
#  113|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def226]
flashrom-v1.6.0/libflashrom.c:111:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
flashrom-v1.6.0/libflashrom.c:107:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:110:17: acquire_resource: ‘va_start’ called here
flashrom-v1.6.0/libflashrom.c:111:23: throw: if the called function throws an exception...
flashrom-v1.6.0/libflashrom.c:111:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  109|   		va_list args;
#  110|   		va_start(args, fmt);
#  111|-> 		ret = global_log_callback(level, fmt, args);
#  112|   		va_end(args);
#  113|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
flashrom-v1.6.0/libflashrom.c:390:37: warning[-Wanalyzer-malloc-leak]: leak of ‘matched_names’
flashrom-v1.6.0/libflashrom.c:383:38: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:385:25: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:385:25: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:387:24: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:388:50: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:389:64: branch_true: following ‘true’ branch (when ‘all_matched_count == 0’)...
flashrom-v1.6.0/libflashrom.c:390:37: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:390:37: throw: if ‘probe_flash’ throws an exception...
flashrom-v1.6.0/libflashrom.c:390:37: danger: ‘matched_names’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  388|   			struct flashrom_flashctx second_flashctx = { 0, }; // used for second and more matches
#  389|   			struct flashctx *context_for_probing = (all_matched_count > 0) ? &second_flashctx : flashctx;
#  390|-> 			startchip = probe_flash(&registered_masters[i], startchip, context_for_probing, 0, chip_name);
#  391|   
#  392|   			if (startchip < 0)

Error: CPPCHECK_WARNING (CWE-476): [#def228]
flashrom-v1.6.0/libflashrom.c:395: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matched_names
#  393|   				break;
#  394|   
#  395|-> 			matched_names[all_matched_count] = context_for_probing->chip->name;
#  396|   			all_matched_count++;
#  397|   			startchip++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def229]
flashrom-v1.6.0/libflashrom.c:395:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘matched_names’
flashrom-v1.6.0/libflashrom.c:383:38: acquire_memory: this call could return NULL
flashrom-v1.6.0/libflashrom.c:385:25: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:385:25: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:387:24: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:388:50: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:389:64: branch_true: following ‘true’ branch (when ‘all_matched_count == 0’)...
flashrom-v1.6.0/libflashrom.c:390:37: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:395:25: danger: ‘matched_names + (long unsigned int)all_matched_count * 8’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  393|   				break;
#  394|   
#  395|-> 			matched_names[all_matched_count] = context_for_probing->chip->name;
#  396|   			all_matched_count++;
#  397|   			startchip++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
flashrom-v1.6.0/libflashrom.c:401:33: warning[-Wanalyzer-malloc-leak]: leak of ‘matched_names’
flashrom-v1.6.0/libflashrom.c:383:38: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:385:25: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:385:25: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:387:24: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:388:50: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:389:64: branch_true: following ‘true’ branch (when ‘all_matched_count == 0’)...
flashrom-v1.6.0/libflashrom.c:390:37: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:399:28: branch_false: following ‘false’ branch (when ‘all_matched_count == 1’)...
flashrom-v1.6.0/libflashrom.c:414:1: branch_false: ...to here
flashrom-v1.6.0/libflashrom.c:387:24: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:388:50: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:389:64: branch_false: following ‘false’ branch (when ‘all_matched_count != 0’)...
flashrom-v1.6.0/libflashrom.c:389:64: branch_false: ...to here
flashrom-v1.6.0/libflashrom.c:392:28: branch_false: following ‘false’ branch...
flashrom-v1.6.0/libflashrom.c:395:60: branch_false: ...to here
flashrom-v1.6.0/libflashrom.c:399:28: branch_true: following ‘true’ branch (when ‘all_matched_count != 1’)...
flashrom-v1.6.0/libflashrom.c:401:33: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:401:33: throw: if ‘flashrom_layout_release’ throws an exception...
flashrom-v1.6.0/libflashrom.c:401:33: danger: ‘matched_names’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  399|   			if (all_matched_count > 1) {
#  400|   				/* It's used for the second and subsequent probing. */
#  401|-> 				flashrom_layout_release(second_flashctx.default_layout);
#  402|   				free(second_flashctx.chip);
#  403|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def231]
flashrom-v1.6.0/libflashrom.c:407:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘matched_names’
flashrom-v1.6.0/libflashrom.c:383:38: acquire_memory: this call could return NULL
flashrom-v1.6.0/libflashrom.c:407:9: danger: ‘matched_names + (long unsigned int)all_matched_count * 8’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  405|   	}
#  406|   
#  407|-> 	matched_names[all_matched_count] = NULL;
#  408|   	matched_names = realloc(matched_names, (all_matched_count + 1) * sizeof(char*));
#  409|   	*all_matched_names = matched_names;

Error: CPPCHECK_WARNING (CWE-401): [#def232]
flashrom-v1.6.0/libflashrom.c:408: error[memleakOnRealloc]: Common realloc mistake: 'matched_names' nulled but not freed upon failure
#  406|   
#  407|   	matched_names[all_matched_count] = NULL;
#  408|-> 	matched_names = realloc(matched_names, (all_matched_count + 1) * sizeof(char*));
#  409|   	*all_matched_names = matched_names;
#  410|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
flashrom-v1.6.0/libflashrom.c:413:16: warning[-Wanalyzer-malloc-leak]: leak of ‘matched_names’
flashrom-v1.6.0/libflashrom.c:383:38: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:413:16: danger: ‘matched_names’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  411|   	int ret = (startchip == ERROR_FLASHROM_PROBE_INTERNAL_ERROR) ? -1 : (int) all_matched_count;
#  412|   
#  413|-> 	return ret;
#  414|   }
#  415|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
flashrom-v1.6.0/libflashrom.c:477:13: warning[-Wanalyzer-malloc-leak]: leak of ‘desc’
flashrom-v1.6.0/libflashrom.c:476:28: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:477:13: throw: if ‘prepare_flash_access’ throws an exception...
flashrom-v1.6.0/libflashrom.c:477:13: danger: ‘desc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  475|   
#  476|   	void *const desc = malloc(0x1000);
#  477|-> 	if (prepare_flash_access(flashctx, true, false, false, false))
#  478|   		goto _free_ret;
#  479|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
flashrom-v1.6.0/libflashrom.c:481:13: warning[-Wanalyzer-malloc-leak]: leak of ‘desc’
flashrom-v1.6.0/libflashrom.c:476:28: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:477:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/libflashrom.c:480:9: branch_false: ...to here
flashrom-v1.6.0/libflashrom.c:481:13: throw: if ‘read_flash’ throws an exception...
flashrom-v1.6.0/libflashrom.c:481:13: danger: ‘desc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  479|   
#  480|   	msg_cinfo("Reading ich descriptor... ");
#  481|-> 	if (read_flash(flashctx, desc, 0, 0x1000)) {
#  482|   		msg_cerr("Read operation failed!\n");
#  483|   		msg_cinfo("FAILED.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
flashrom-v1.6.0/libflashrom.c:523:17: warning[-Wanalyzer-malloc-leak]: leak of ‘desc’
flashrom-v1.6.0/libflashrom.c:476:28: acquire_memory: allocated here
flashrom-v1.6.0/libflashrom.c:477:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/libflashrom.c:478:17: branch_true: ...to here
flashrom-v1.6.0/libflashrom.c:523:17: throw: if ‘flashrom_layout_release’ throws an exception...
flashrom-v1.6.0/libflashrom.c:523:17: danger: ‘desc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  521|   _free_ret:
#  522|   	if (ret)
#  523|-> 		flashrom_layout_release(chip_layout);
#  524|   	free(desc);
#  525|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
flashrom-v1.6.0/linux_mtd.c:57:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/linux_mtd.c:505:12: enter_function: entry to ‘linux_mtd_init’
flashrom-v1.6.0/linux_mtd.c:513:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_mtd.c:516:27: branch_true: ...to here
flashrom-v1.6.0/linux_mtd.c:517:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:531:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:535:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:535:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:542:9: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:544:16: acquire_memory: allocated here
flashrom-v1.6.0/linux_mtd.c:545:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/linux_mtd.c:551:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:551:13: call_function: calling ‘linux_mtd_setup’ from ‘linux_mtd_init’
#   55|   
#   56|   	if ((fp = fopen(path, "r")) == NULL) {
#   57|-> 		msg_perr("Cannot open %s\n", path);
#   58|   		return 1;
#   59|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def238]
flashrom-v1.6.0/linux_mtd.c:62:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
flashrom-v1.6.0/linux_mtd.c:455:12: enter_function: entry to ‘linux_mtd_setup’
flashrom-v1.6.0/linux_mtd.c:461:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:464:14: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:465:13: call_function: calling ‘read_sysfs_string’ from ‘linux_mtd_setup’
#   60|   
#   61|   	clearerr(fp);
#   62|-> 	bytes_read = fread(buf, 1, (size_t)len, fp);
#   63|   	if (!feof(fp) && ferror(fp)) {
#   64|   		msg_perr("Error occurred when reading %s\n", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
flashrom-v1.6.0/linux_mtd.c:62:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
flashrom-v1.6.0/linux_mtd.c:455:12: enter_function: entry to ‘linux_mtd_setup’
flashrom-v1.6.0/linux_mtd.c:461:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:464:14: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:465:13: call_function: calling ‘read_sysfs_string’ from ‘linux_mtd_setup’
#   60|   
#   61|   	clearerr(fp);
#   62|-> 	bytes_read = fread(buf, 1, (size_t)len, fp);
#   63|   	if (!feof(fp) && ferror(fp)) {
#   64|   		msg_perr("Error occurred when reading %s\n", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def240]
flashrom-v1.6.0/linux_mtd.c:64:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/linux_mtd.c:505:12: enter_function: entry to ‘linux_mtd_init’
flashrom-v1.6.0/linux_mtd.c:513:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_mtd.c:516:27: branch_true: ...to here
flashrom-v1.6.0/linux_mtd.c:517:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:531:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:535:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:535:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:542:9: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:544:16: acquire_memory: allocated here
flashrom-v1.6.0/linux_mtd.c:545:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/linux_mtd.c:551:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:551:13: call_function: calling ‘linux_mtd_setup’ from ‘linux_mtd_init’
#   62|   	bytes_read = fread(buf, 1, (size_t)len, fp);
#   63|   	if (!feof(fp) && ferror(fp)) {
#   64|-> 		msg_perr("Error occurred when reading %s\n", path);
#   65|   		fclose(fp);
#   66|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def241]
flashrom-v1.6.0/linux_mtd.c:469:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/linux_mtd.c:505:12: enter_function: entry to ‘linux_mtd_init’
flashrom-v1.6.0/linux_mtd.c:513:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_mtd.c:516:27: branch_true: ...to here
flashrom-v1.6.0/linux_mtd.c:517:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:531:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:535:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:535:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:542:9: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:544:16: acquire_memory: allocated here
flashrom-v1.6.0/linux_mtd.c:545:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/linux_mtd.c:551:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:551:13: call_function: calling ‘linux_mtd_setup’ from ‘linux_mtd_init’
#  467|   
#  468|   	if (strcmp(buf, "nor")) {
#  469|-> 		msg_perr("MTD device %d type is not \"nor\"\n", dev_num);
#  470|   		goto linux_mtd_setup_exit;
#  471|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def242]
flashrom-v1.6.0/linux_mtd.c:479:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/linux_mtd.c:505:12: enter_function: entry to ‘linux_mtd_init’
flashrom-v1.6.0/linux_mtd.c:513:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_mtd.c:516:27: branch_true: ...to here
flashrom-v1.6.0/linux_mtd.c:517:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:531:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:535:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:535:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_mtd.c:542:9: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:544:16: acquire_memory: allocated here
flashrom-v1.6.0/linux_mtd.c:545:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/linux_mtd.c:551:13: branch_false: ...to here
flashrom-v1.6.0/linux_mtd.c:551:13: call_function: calling ‘linux_mtd_setup’ from ‘linux_mtd_init’
#  477|   	errno = 0;
#  478|   	if (stat(dev_path, &s) < 0) {
#  479|-> 		msg_pdbg("Cannot stat \"%s\": %s\n", dev_path, strerror(errno));
#  480|   		goto linux_mtd_setup_exit;
#  481|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def243]
flashrom-v1.6.0/linux_spi.c:137:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’
flashrom-v1.6.0/linux_spi.c:128:14: acquire_resource: opened here
flashrom-v1.6.0/linux_spi.c:129:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:135:14: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:135:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_spi.c:136:21: branch_true: ...to here
flashrom-v1.6.0/linux_spi.c:136:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_spi.c:137:25: branch_true: ...to here
flashrom-v1.6.0/linux_spi.c:137:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/linux_spi.c:137:25: danger: ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  135|   	if (!fgets(buf, sizeof(buf), fp)) {
#  136|   		if (feof(fp))
#  137|-> 			msg_pwarn("Cannot read %s: file is empty.\n", BUF_SIZE_FROM_SYSFS);
#  138|   		else
#  139|   			msg_pwarn("Cannot read %s: %s.\n", BUF_SIZE_FROM_SYSFS, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def244]
flashrom-v1.6.0/linux_spi.c:137:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’
flashrom-v1.6.0/linux_spi.c:128:14: acquire_memory: allocated here
flashrom-v1.6.0/linux_spi.c:129:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:135:14: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:135:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_spi.c:136:21: branch_true: ...to here
flashrom-v1.6.0/linux_spi.c:136:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_spi.c:137:25: branch_true: ...to here
flashrom-v1.6.0/linux_spi.c:137:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/linux_spi.c:137:25: danger: ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  135|   	if (!fgets(buf, sizeof(buf), fp)) {
#  136|   		if (feof(fp))
#  137|-> 			msg_pwarn("Cannot read %s: file is empty.\n", BUF_SIZE_FROM_SYSFS);
#  138|   		else
#  139|   			msg_pwarn("Cannot read %s: %s.\n", BUF_SIZE_FROM_SYSFS, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def245]
flashrom-v1.6.0/linux_spi.c:139:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’
flashrom-v1.6.0/linux_spi.c:128:14: acquire_resource: opened here
flashrom-v1.6.0/linux_spi.c:129:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:135:14: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:135:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_spi.c:136:21: branch_true: ...to here
flashrom-v1.6.0/linux_spi.c:136:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:139:25: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:139:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/linux_spi.c:139:25: danger: ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  137|   			msg_pwarn("Cannot read %s: file is empty.\n", BUF_SIZE_FROM_SYSFS);
#  138|   		else
#  139|-> 			msg_pwarn("Cannot read %s: %s.\n", BUF_SIZE_FROM_SYSFS, strerror(errno));
#  140|   		goto out;
#  141|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def246]
flashrom-v1.6.0/linux_spi.c:139:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’
flashrom-v1.6.0/linux_spi.c:128:14: acquire_memory: allocated here
flashrom-v1.6.0/linux_spi.c:129:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:135:14: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:135:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/linux_spi.c:136:21: branch_true: ...to here
flashrom-v1.6.0/linux_spi.c:136:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:139:25: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:139:25: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/linux_spi.c:139:25: danger: ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  137|   			msg_pwarn("Cannot read %s: file is empty.\n", BUF_SIZE_FROM_SYSFS);
#  138|   		else
#  139|-> 			msg_pwarn("Cannot read %s: %s.\n", BUF_SIZE_FROM_SYSFS, strerror(errno));
#  140|   		goto out;
#  141|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def247]
flashrom-v1.6.0/linux_spi.c:147:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’
flashrom-v1.6.0/linux_spi.c:128:14: acquire_resource: opened here
flashrom-v1.6.0/linux_spi.c:129:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:135:14: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:135:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:144:9: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:147:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/linux_spi.c:147:17: danger: ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  145|   	tmp = strtol(buf, NULL, 0);
#  146|   	if ((tmp < 0) || errno) {
#  147|-> 		msg_pwarn("Buffer size %ld from %s seems wrong.\n", tmp, BUF_SIZE_FROM_SYSFS);
#  148|   	} else {
#  149|   		msg_pdbg("%s: Using value from %s as max buffer size.\n", __func__, BUF_SIZE_FROM_SYSFS);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
flashrom-v1.6.0/linux_spi.c:147:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’
flashrom-v1.6.0/linux_spi.c:128:14: acquire_memory: allocated here
flashrom-v1.6.0/linux_spi.c:129:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:135:14: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:135:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:144:9: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:147:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/linux_spi.c:147:17: danger: ‘fopen("/sys/module/spidev/parameters/bufsiz", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  145|   	tmp = strtol(buf, NULL, 0);
#  146|   	if ((tmp < 0) || errno) {
#  147|-> 		msg_pwarn("Buffer size %ld from %s seems wrong.\n", tmp, BUF_SIZE_FROM_SYSFS);
#  148|   	} else {
#  149|   		msg_pdbg("%s: Using value from %s as max buffer size.\n", __func__, BUF_SIZE_FROM_SYSFS);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def249]
flashrom-v1.6.0/linux_spi.c:238:16: warning[-Wanalyzer-malloc-leak]: leak of ‘spi_data’
flashrom-v1.6.0/linux_spi.c:164:12: enter_function: entry to ‘linux_spi_init’
flashrom-v1.6.0/linux_spi.c:192:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:200:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:206:9: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:208:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:213:9: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:215:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:221:13: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:221:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/linux_spi.c:227:31: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:227:31: call_function: calling ‘get_max_kernel_buf_size’ from ‘linux_spi_init’
flashrom-v1.6.0/linux_spi.c:227:31: return_function: returning to ‘linux_spi_init’ from ‘get_max_kernel_buf_size’
flashrom-v1.6.0/linux_spi.c:230:20: acquire_memory: allocated here
flashrom-v1.6.0/linux_spi.c:231:12: branch_false: following ‘false’ branch (when ‘spi_data’ is non-NULL)...
flashrom-v1.6.0/linux_spi.c:235:9: branch_false: ...to here
flashrom-v1.6.0/linux_spi.c:238:16: throw: if ‘register_spi_master’ throws an exception...
flashrom-v1.6.0/linux_spi.c:238:16: danger: ‘spi_data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/18)
#  236|   	spi_data->max_kernel_buf_size = max_kernel_buf_size;
#  237|   
#  238|-> 	return register_spi_master(&spi_master_linux, spi_data);
#  239|   
#  240|   init_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def250]
flashrom-v1.6.0/mcp6x_spi.c:182:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/mcp6x_spi.c:128:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/mcp6x_spi.c:138:9: branch_false: ...to here
flashrom-v1.6.0/mcp6x_spi.c:152:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/mcp6x_spi.c:152:12: branch_false: ...to here
flashrom-v1.6.0/mcp6x_spi.c:155:19: branch_false: following ‘false’ branch...
flashrom-v1.6.0/mcp6x_spi.c:158:20: branch_false: ...to here
flashrom-v1.6.0/mcp6x_spi.c:158:19: branch_false: following ‘false’ branch...
flashrom-v1.6.0/mcp6x_spi.c:164:24: branch_false: ...to here
flashrom-v1.6.0/mcp6x_spi.c:165:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/mcp6x_spi.c:168:29: branch_false: ...to here
flashrom-v1.6.0/mcp6x_spi.c:174:39: acquire_memory: allocated here
flashrom-v1.6.0/mcp6x_spi.c:175:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/mcp6x_spi.c:179:9: branch_false: ...to here
flashrom-v1.6.0/mcp6x_spi.c:182:13: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/mcp6x_spi.c:182:13: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  180|   	data->gpiostate = mcp_gpiostate;
#  181|   
#  182|-> 	if (register_shutdown(mcp6x_shutdown, data)) {
#  183|   		free(data);
#  184|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
flashrom-v1.6.0/nic3com.c:147:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nic3com.c:109:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nic3com.c:112:24: branch_false: ...to here
flashrom-v1.6.0/nic3com.c:113:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nic3com.c:116:9: branch_false: ...to here
flashrom-v1.6.0/nic3com.c:136:37: acquire_memory: allocated here
flashrom-v1.6.0/nic3com.c:137:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nic3com.c:141:9: branch_false: ...to here
flashrom-v1.6.0/nic3com.c:147:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/nic3com.c:147:16: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  145|   	max_rom_decode.parallel = 128 * 1024;
#  146|   
#  147|-> 	return register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
#  148|   
#  149|   init_err_cleanup_exit:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def252]
flashrom-v1.6.0/nicintel.c:122:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel.c:83:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel.c:86:16: branch_false: ...to here
flashrom-v1.6.0/nicintel.c:87:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel.c:90:15: branch_false: ...to here
flashrom-v1.6.0/nicintel.c:91:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel.c:94:16: branch_false: ...to here
flashrom-v1.6.0/nicintel.c:95:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel.c:98:23: branch_false: ...to here
flashrom-v1.6.0/nicintel.c:99:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel.c:111:34: branch_false: ...to here
flashrom-v1.6.0/nicintel.c:113:38: acquire_memory: allocated here
flashrom-v1.6.0/nicintel.c:114:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel.c:118:9: branch_false: ...to here
flashrom-v1.6.0/nicintel.c:122:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/nicintel.c:122:16: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  120|   
#  121|   	max_rom_decode.parallel = NICINTEL_MEMMAP_SIZE;
#  122|-> 	return register_par_master(&par_master_nicintel, BUS_PARALLEL, data);
#  123|   }
#  124|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
flashrom-v1.6.0/nicintel_eeprom.c:533:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_eeprom.c:489:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_eeprom.c:492:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_eeprom.c:493:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_eeprom.c:496:22: branch_false: ...to here
flashrom-v1.6.0/nicintel_eeprom.c:496:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_eeprom.c:516:43: branch_false: ...to here
flashrom-v1.6.0/nicintel_eeprom.c:517:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_eeprom.c:523:45: branch_false: ...to here
flashrom-v1.6.0/nicintel_eeprom.c:523:45: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_eeprom.c:524:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_eeprom.c:528:9: branch_false: ...to here
flashrom-v1.6.0/nicintel_eeprom.c:533:16: throw: if ‘register_opaque_master’ throws an exception...
flashrom-v1.6.0/nicintel_eeprom.c:533:16: danger: ‘data’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  531|   	data->done_i210_write = false;
#  532|   
#  533|-> 	return register_opaque_master(mst, data);
#  534|   }
#  535|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def254]
flashrom-v1.6.0/nicintel_spi.c:238:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:315:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:316:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:38: call_function: calling ‘nicintel_spi_82599_enable_flash’ from ‘nicintel_spi_init’
#  236|   	 * left untouched.
#  237|   	 */
#  238|-> 	tmp = pci_mmio_readl(data->spibar + EECD);
#  239|   	tmp &= ~FLASH_WRITES_DISABLED;
#  240|   	tmp |= FLASH_WRITES_ENABLED;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
flashrom-v1.6.0/nicintel_spi.c:241:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:315:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:316:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:38: call_function: calling ‘nicintel_spi_82599_enable_flash’ from ‘nicintel_spi_init’
#  239|   	tmp &= ~FLASH_WRITES_DISABLED;
#  240|   	tmp |= FLASH_WRITES_ENABLED;
#  241|-> 	pci_mmio_writel(tmp, data->spibar + EECD);
#  242|   
#  243|   	/* test if FWE is really set to allow writes */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
flashrom-v1.6.0/nicintel_spi.c:244:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:315:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:316:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:38: call_function: calling ‘nicintel_spi_82599_enable_flash’ from ‘nicintel_spi_init’
#  242|   
#  243|   	/* test if FWE is really set to allow writes */
#  244|-> 	tmp = pci_mmio_readl(data->spibar + EECD);
#  245|   	if ( (tmp & FLASH_WRITES_DISABLED) || !(tmp & FLASH_WRITES_ENABLED) ) {
#  246|   		msg_perr("Enabling flash write access failed.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
flashrom-v1.6.0/nicintel_spi.c:246:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:315:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:316:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:38: call_function: calling ‘nicintel_spi_82599_enable_flash’ from ‘nicintel_spi_init’
#  244|   	tmp = pci_mmio_readl(data->spibar + EECD);
#  245|   	if ( (tmp & FLASH_WRITES_DISABLED) || !(tmp & FLASH_WRITES_ENABLED) ) {
#  246|-> 		msg_perr("Enabling flash write access failed.\n");
#  247|   		return 1;
#  248|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def258]
flashrom-v1.6.0/nicintel_spi.c:250:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:315:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:316:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:316:38: call_function: calling ‘nicintel_spi_82599_enable_flash’ from ‘nicintel_spi_init’
#  248|   	}
#  249|   
#  250|-> 	if (register_shutdown(nicintel_spi_shutdown, data))
#  251|   		return 1;
#  252|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
flashrom-v1.6.0/nicintel_spi.c:266:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:309:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:38: call_function: calling ‘nicintel_spi_i210_enable_flash’ from ‘nicintel_spi_init’
#  264|   	uint32_t tmp;
#  265|   
#  266|-> 	tmp = pci_mmio_readl(data->spibar + FLA);
#  267|   	if (tmp & BIT(FL_LOCKED)) {
#  268|   		msg_perr("Flash is in Secure Mode. Abort.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def260]
flashrom-v1.6.0/nicintel_spi.c:268:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:309:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:38: call_function: calling ‘nicintel_spi_i210_enable_flash’ from ‘nicintel_spi_init’
#  266|   	tmp = pci_mmio_readl(data->spibar + FLA);
#  267|   	if (tmp & BIT(FL_LOCKED)) {
#  268|-> 		msg_perr("Flash is in Secure Mode. Abort.\n");
#  269|   		return 1;
#  270|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def261]
flashrom-v1.6.0/nicintel_spi.c:274:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:309:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:38: call_function: calling ‘nicintel_spi_i210_enable_flash’ from ‘nicintel_spi_init’
#  272|   	if (tmp & BIT(FL_ABORT)) {
#  273|   		tmp |= BIT(FL_CLR_ERR);
#  274|-> 		pci_mmio_writel(tmp, data->spibar + FLA);
#  275|   		tmp = pci_mmio_readl(data->spibar + FLA);
#  276|   		if (!(tmp & BIT(FL_ABORT))) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
flashrom-v1.6.0/nicintel_spi.c:275:23: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:309:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:38: call_function: calling ‘nicintel_spi_i210_enable_flash’ from ‘nicintel_spi_init’
#  273|   		tmp |= BIT(FL_CLR_ERR);
#  274|   		pci_mmio_writel(tmp, data->spibar + FLA);
#  275|-> 		tmp = pci_mmio_readl(data->spibar + FLA);
#  276|   		if (!(tmp & BIT(FL_ABORT))) {
#  277|   			msg_perr("Unable to clear Flash Access Error. Abort\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def263]
flashrom-v1.6.0/nicintel_spi.c:277:25: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:309:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:38: call_function: calling ‘nicintel_spi_i210_enable_flash’ from ‘nicintel_spi_init’
#  275|   		tmp = pci_mmio_readl(data->spibar + FLA);
#  276|   		if (!(tmp & BIT(FL_ABORT))) {
#  277|-> 			msg_perr("Unable to clear Flash Access Error. Abort\n");
#  278|   			return 1;
#  279|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def264]
flashrom-v1.6.0/nicintel_spi.c:282:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:288:12: enter_function: entry to ‘nicintel_spi_init’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:309:38: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:309:38: call_function: calling ‘nicintel_spi_i210_enable_flash’ from ‘nicintel_spi_init’
#  280|   	}
#  281|   
#  282|-> 	if (register_shutdown(nicintel_spi_i210_shutdown, data))
#  283|   		return 1;
#  284|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
flashrom-v1.6.0/nicintel_spi.c:307:32: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:308:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:307:32: throw: if ‘rphysmap’ throws an exception...
flashrom-v1.6.0/nicintel_spi.c:307:32: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  305|   
#  306|   	if ((dev->device_id & 0xfff0) == 0x1530) {
#  307|-> 		data->spibar = rphysmap("Intel I210 Gigabit w/ SPI flash", io_base_addr + 0x12000,
#  308|   					   MEMMAP_SIZE);
#  309|   		if (!data->spibar || nicintel_spi_i210_enable_flash(data)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def266]
flashrom-v1.6.0/nicintel_spi.c:314:32: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_true: following ‘true’ branch...
flashrom-v1.6.0/nicintel_spi.c:315:44: branch_true: ...to here
flashrom-v1.6.0/nicintel_spi.c:314:32: throw: if ‘rphysmap’ throws an exception...
flashrom-v1.6.0/nicintel_spi.c:314:32: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
#  312|   		}
#  313|   	} else if (dev->device_id < 0x10d8) {
#  314|-> 		data->spibar = rphysmap("Intel Gigabit NIC w/ SPI flash", io_base_addr,
#  315|   					   MEMMAP_SIZE);
#  316|   		if (!data->spibar || nicintel_spi_82599_enable_flash(data)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
flashrom-v1.6.0/nicintel_spi.c:321:32: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicintel_spi.c:293:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:296:33: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:297:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicintel_spi.c:300:42: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:300:42: acquire_memory: allocated here
flashrom-v1.6.0/nicintel_spi.c:301:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicintel_spi.c:306:14: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:306:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:313:19: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicintel_spi.c:322:44: branch_false: ...to here
flashrom-v1.6.0/nicintel_spi.c:321:32: throw: if ‘rphysmap’ throws an exception...
flashrom-v1.6.0/nicintel_spi.c:321:32: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  319|   		}
#  320|   	} else {
#  321|-> 		data->spibar = rphysmap("Intel 10 Gigabit NIC w/ SPI flash", io_base_addr + 0x10000,
#  322|   					   MEMMAP_SIZE);
#  323|   		if (!data->spibar || nicintel_spi_82599_enable_flash(data)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def268]
flashrom-v1.6.0/nicrealtek.c:135:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/nicrealtek.c:105:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/nicrealtek.c:108:24: branch_false: ...to here
flashrom-v1.6.0/nicrealtek.c:109:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/nicrealtek.c:113:17: branch_false: ...to here
flashrom-v1.6.0/nicrealtek.c:126:40: acquire_memory: allocated here
flashrom-v1.6.0/nicrealtek.c:127:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/nicrealtek.c:131:9: branch_false: ...to here
flashrom-v1.6.0/nicrealtek.c:135:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/nicrealtek.c:135:16: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  133|   	data->bios_rom_data = bios_rom_data;
#  134|   
#  135|-> 	return register_par_master(&par_master_nicrealtek, BUS_PARALLEL, data);
#  136|   }
#  137|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
flashrom-v1.6.0/ogp_spi.c:165:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/ogp_spi.c:122:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ogp_spi.c:126:21: branch_false: ...to here
flashrom-v1.6.0/ogp_spi.c:144:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ogp_spi.c:147:33: branch_false: ...to here
flashrom-v1.6.0/ogp_spi.c:148:12: branch_false: following ‘false’ branch (when ‘io_base_addr != 0’)...
flashrom-v1.6.0/ogp_spi.c:151:22: branch_false: ...to here
flashrom-v1.6.0/ogp_spi.c:152:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/ogp_spi.c:155:37: branch_false: ...to here
flashrom-v1.6.0/ogp_spi.c:155:37: acquire_memory: allocated here
flashrom-v1.6.0/ogp_spi.c:156:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/ogp_spi.c:160:9: branch_false: ...to here
flashrom-v1.6.0/ogp_spi.c:165:13: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/ogp_spi.c:165:13: danger: ‘data’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  163|   	data->reg__ce = ogp_reg__ce;
#  164|   	data->reg_sck = ogp_reg_sck;
#  165|-> 	if (register_shutdown(ogp_spi_shutdown, data)) {
#  166|   		free(data);
#  167|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
flashrom-v1.6.0/pcidev.c:390:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_pci_write_data’
flashrom-v1.6.0/pcidev.c:390:9: acquire_memory: allocated here
flashrom-v1.6.0/pcidev.c:390:9: branch_false: following ‘false’ branch (when ‘undo_pci_write_data’ is non-NULL)...
flashrom-v1.6.0/pcidev.c:390:9: branch_false: ...to here
flashrom-v1.6.0/pcidev.c:390:9: branch_true: following ‘true’ branch...
flashrom-v1.6.0/pcidev.c:390:9: branch_true: ...to here
flashrom-v1.6.0/pcidev.c:390:9: throw: if ‘pci_get_dev’ throws an exception...
flashrom-v1.6.0/pcidev.c:390:9: danger: ‘undo_pci_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  388|   int rpci_write_byte(struct pci_dev *dev, int reg, uint8_t data)
#  389|   {
#  390|-> 	register_undo_pci_write_byte(dev, reg);
#  391|   	return pci_write_byte(dev, reg, data);
#  392|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
flashrom-v1.6.0/pcidev.c:396:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_pci_write_data’
flashrom-v1.6.0/pcidev.c:396:9: acquire_memory: allocated here
flashrom-v1.6.0/pcidev.c:396:9: branch_false: following ‘false’ branch (when ‘undo_pci_write_data’ is non-NULL)...
flashrom-v1.6.0/pcidev.c:396:9: branch_false: ...to here
flashrom-v1.6.0/pcidev.c:396:9: branch_true: following ‘true’ branch...
flashrom-v1.6.0/pcidev.c:396:9: branch_true: ...to here
flashrom-v1.6.0/pcidev.c:396:9: throw: if ‘pci_get_dev’ throws an exception...
flashrom-v1.6.0/pcidev.c:396:9: danger: ‘undo_pci_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  394|   int rpci_write_word(struct pci_dev *dev, int reg, uint16_t data)
#  395|   {
#  396|-> 	register_undo_pci_write_word(dev, reg);
#  397|   	return pci_write_word(dev, reg, data);
#  398|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
flashrom-v1.6.0/pcidev.c:402:9: warning[-Wanalyzer-malloc-leak]: leak of ‘undo_pci_write_data’
flashrom-v1.6.0/pcidev.c:402:9: acquire_memory: allocated here
flashrom-v1.6.0/pcidev.c:402:9: branch_false: following ‘false’ branch (when ‘undo_pci_write_data’ is non-NULL)...
flashrom-v1.6.0/pcidev.c:402:9: branch_false: ...to here
flashrom-v1.6.0/pcidev.c:402:9: branch_true: following ‘true’ branch...
flashrom-v1.6.0/pcidev.c:402:9: branch_true: ...to here
flashrom-v1.6.0/pcidev.c:402:9: throw: if ‘pci_get_dev’ throws an exception...
flashrom-v1.6.0/pcidev.c:402:9: danger: ‘undo_pci_write_data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  400|   int rpci_write_long(struct pci_dev *dev, int reg, uint32_t data)
#  401|   {
#  402|-> 	register_undo_pci_write_long(dev, reg);
#  403|   	return pci_write_long(dev, reg, data);
#  404|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def273]
flashrom-v1.6.0/pickit2_spi.c:94:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:13: call_function: calling ‘pickit2_get_firmware_version’ from ‘pickit2_spi_init’
#   92|   {
#   93|   	int transferred;
#   94|-> 	return libusb_interrupt_transfer(handle, endpoint, data, CMD_LENGTH, &transferred, DFLT_TIMEOUT);
#   95|   }
#   96|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
flashrom-v1.6.0/pickit2_spi.c:105:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:13: call_function: calling ‘pickit2_get_firmware_version’ from ‘pickit2_spi_init’
#  103|   
#  104|   	if (ret != 0) {
#  105|-> 		msg_perr("Command Get Firmware Version failed!\n");
#  106|   		return 1;
#  107|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def275]
flashrom-v1.6.0/pickit2_spi.c:112:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:13: call_function: calling ‘pickit2_get_firmware_version’ from ‘pickit2_spi_init’
#  110|   
#  111|   	if (ret != 0) {
#  112|-> 		msg_perr("Command Get Firmware Version failed!\n");
#  113|   		return 1;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
flashrom-v1.6.0/pickit2_spi.c:116:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:13: call_function: calling ‘pickit2_get_firmware_version’ from ‘pickit2_spi_init’
#  114|   	}
#  115|   
#  116|-> 	msg_pdbg("PICkit2 Firmware Version: %d.%d\n", (int)command[0], (int)command[1]);
#  117|   	return 0;
#  118|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def277]
flashrom-v1.6.0/pickit2_spi.c:141:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:483:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:483:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:487:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:488:13: call_function: calling ‘pickit2_set_spi_voltage’ from ‘pickit2_spi_init’
#  139|   		return 1;
#  140|   	}
#  141|-> 	msg_pdbg("Setting SPI voltage to %u.%03u V\n", millivolt / 1000,
#  142|   		 millivolt % 1000);
#  143|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
flashrom-v1.6.0/pickit2_spi.c:158:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:483:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:483:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:487:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:488:13: call_function: calling ‘pickit2_set_spi_voltage’ from ‘pickit2_spi_init’
#  156|   
#  157|   	if (ret != 0) {
#  158|-> 		msg_perr("Command Set Voltage failed!\n");
#  159|   		return 1;
#  160|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def279]
flashrom-v1.6.0/pickit2_spi.c:180:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:483:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:483:13: call_function: calling ‘pickit2_set_spi_speed’ from ‘pickit2_spi_init’
#  178|   static int pickit2_set_spi_speed(libusb_device_handle *pickit2_handle, unsigned int spispeed_idx)
#  179|   {
#  180|-> 	msg_pdbg("SPI speed is %sHz\n", spispeeds[spispeed_idx].name);
#  181|   
#  182|   	uint8_t command[CMD_LENGTH] = {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
flashrom-v1.6.0/pickit2_spi.c:193:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:483:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:483:13: call_function: calling ‘pickit2_set_spi_speed’ from ‘pickit2_spi_init’
#  191|   
#  192|   	if (ret != 0) {
#  193|-> 		msg_perr("Command Set SPI Speed failed!\n");
#  194|   		return 1;
#  195|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def281]
flashrom-v1.6.0/pickit2_spi.c:364:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:501:9: call_function: calling ‘pickit2_shutdown’ from ‘pickit2_spi_init’
#  362|   
#  363|   	if (ret != 0) {
#  364|-> 		msg_perr("Command Shutdown failed!\n");
#  365|   		ret = 1;
#  366|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
flashrom-v1.6.0/pickit2_spi.c:367:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:501:9: call_function: calling ‘pickit2_shutdown’ from ‘pickit2_spi_init’
#  365|   		ret = 1;
#  366|   	}
#  367|-> 	if (libusb_release_interface(pickit2_data->pickit2_handle, 0) != 0) {
#  368|   		msg_perr("Could not release USB interface!\n");
#  369|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def283]
flashrom-v1.6.0/pickit2_spi.c:368:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:501:9: call_function: calling ‘pickit2_shutdown’ from ‘pickit2_spi_init’
#  366|   	}
#  367|   	if (libusb_release_interface(pickit2_data->pickit2_handle, 0) != 0) {
#  368|-> 		msg_perr("Could not release USB interface!\n");
#  369|   		ret = 1;
#  370|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
flashrom-v1.6.0/pickit2_spi.c:371:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:501:9: call_function: calling ‘pickit2_shutdown’ from ‘pickit2_spi_init’
#  369|   		ret = 1;
#  370|   	}
#  371|-> 	libusb_close(pickit2_data->pickit2_handle);
#  372|   	libusb_exit(NULL);
#  373|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
flashrom-v1.6.0/pickit2_spi.c:372:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:387:12: enter_function: entry to ‘pickit2_spi_init’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:501:9: call_function: calling ‘pickit2_shutdown’ from ‘pickit2_spi_init’
#  370|   	}
#  371|   	libusb_close(pickit2_data->pickit2_handle);
#  372|-> 	libusb_exit(NULL);
#  373|   
#  374|   	free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def286]
flashrom-v1.6.0/pickit2_spi.c:487:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pickit2_data’
flashrom-v1.6.0/pickit2_spi.c:437:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:445:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:451:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:457:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:457:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:463:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:463:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:470:24: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:470:24: acquire_memory: allocated here
flashrom-v1.6.0/pickit2_spi.c:471:12: branch_false: following ‘false’ branch (when ‘pickit2_data’ is non-NULL)...
flashrom-v1.6.0/pickit2_spi.c:477:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:479:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:483:13: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:483:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pickit2_spi.c:487:9: branch_false: ...to here
flashrom-v1.6.0/pickit2_spi.c:487:9: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/pickit2_spi.c:487:9: danger: ‘pickit2_data’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
#  485|   
#  486|   	/* Command Set SPI Voltage */
#  487|-> 	msg_pdbg("Setting voltage to %i mV.\n", millivolt);
#  488|   	if (pickit2_set_spi_voltage(pickit2_handle, millivolt) != 0)
#  489|   		goto init_err_cleanup_exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
flashrom-v1.6.0/pony_spi.c:194:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/pony_spi.c:172:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/pony_spi.c:176:13: branch_false: ...to here
flashrom-v1.6.0/pony_spi.c:176:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/pony_spi.c:183:38: branch_true: ...to here
flashrom-v1.6.0/pony_spi.c:183:38: acquire_memory: allocated here
flashrom-v1.6.0/pony_spi.c:184:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/pony_spi.c:189:9: branch_false: ...to here
flashrom-v1.6.0/pony_spi.c:194:13: throw: if ‘register_shutdown’ throws an exception...
flashrom-v1.6.0/pony_spi.c:194:13: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  192|   	data->negate_miso = false;
#  193|   
#  194|-> 	if (register_shutdown(pony_spi_shutdown, data) != 0) {
#  195|   		free(data);
#  196|   		serialport_shutdown(NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def288]
flashrom-v1.6.0/satamv.c:200:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/satamv.c:124:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/satamv.c:127:16: branch_false: ...to here
flashrom-v1.6.0/satamv.c:128:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/satamv.c:131:15: branch_false: ...to here
flashrom-v1.6.0/satamv.c:132:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/satamv.c:135:30: branch_false: ...to here
flashrom-v1.6.0/satamv.c:179:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/satamv.c:186:9: branch_false: ...to here
flashrom-v1.6.0/satamv.c:189:36: acquire_memory: allocated here
flashrom-v1.6.0/satamv.c:190:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/satamv.c:194:9: branch_false: ...to here
flashrom-v1.6.0/satamv.c:200:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/satamv.c:200:16: danger: ‘data’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  198|   	 * 4 MByte with additional 3-bit latch. */
#  199|   	max_rom_decode.parallel = 4 * 1024 * 1024;
#  200|-> 	return register_par_master(&par_master_satamv, BUS_PARALLEL, data);
#  201|   }
#  202|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def289]
flashrom-v1.6.0/satasii.c:143:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/satasii.c:110:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/satasii.c:113:9: branch_false: ...to here
flashrom-v1.6.0/satasii.c:117:20: branch_false: following ‘false’ branch (when ‘addr != 0’)...
flashrom-v1.6.0/satasii.c:127:15: branch_false: ...to here
flashrom-v1.6.0/satasii.c:128:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/satasii.c:130:13: branch_false: ...to here
flashrom-v1.6.0/satasii.c:136:37: acquire_memory: allocated here
flashrom-v1.6.0/satasii.c:137:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
flashrom-v1.6.0/satasii.c:141:9: branch_false: ...to here
flashrom-v1.6.0/satasii.c:143:16: throw: if ‘register_par_master’ throws an exception...
flashrom-v1.6.0/satasii.c:143:16: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  141|   	data->bar = bar;
#  142|   
#  143|-> 	return register_par_master(&par_master_satasii, BUS_PARALLEL, data);
#  144|   }
#  145|   const struct programmer_entry programmer_satasii = {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def290]
flashrom-v1.6.0/serial.c:304:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev, 2306)’
flashrom-v1.6.0/serial.c:297:14: acquire_resource: opened here
flashrom-v1.6.0/serial.c:298:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serial.c:304:27: branch_false: ...to here
flashrom-v1.6.0/serial.c:304:27: throw: if ‘fcntl’ throws an exception...
flashrom-v1.6.0/serial.c:304:27: danger: ‘open(dev, 2306)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  302|   
#  303|   	/* Ensure that we use blocking I/O */
#  304|-> 	const int flags = fcntl(fd, F_GETFL);
#  305|   	if (flags == -1) {
#  306|   		msg_perr_strerror("Could not get serial port mode: ");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def291]
flashrom-v1.6.0/serprog.c:117:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
flashrom-v1.6.0/serprog.c:605:12: enter_function: entry to ‘serprog_init’
flashrom-v1.6.0/serprog.c:653:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:659:12: branch_false: ...to here
flashrom-v1.6.0/serprog.c:659:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:661:20: branch_true: following ‘true’ branch (when ‘port’ is non-NULL)...
flashrom-v1.6.0/serprog.c:663:25: branch_true: ...to here
flashrom-v1.6.0/serprog.c:666:21: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:672:21: branch_false: ...to here
flashrom-v1.6.0/serprog.c:672:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:673:55: call_function: inlined call to ‘atoi’ from ‘serprog_init’
flashrom-v1.6.0/serprog.c:673:33: call_function: calling ‘sp_opensocket’ from ‘serprog_init’
#  115|   		return -1;
#  116|   	}
#  117|-> 	hostPtr = gethostbyname(ip);
#  118|   	if (NULL == hostPtr) {
#  119|   		hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def292]
flashrom-v1.6.0/serprog.c:119:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
flashrom-v1.6.0/serprog.c:605:12: enter_function: entry to ‘serprog_init’
flashrom-v1.6.0/serprog.c:653:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:659:12: branch_false: ...to here
flashrom-v1.6.0/serprog.c:659:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:661:20: branch_true: following ‘true’ branch (when ‘port’ is non-NULL)...
flashrom-v1.6.0/serprog.c:663:25: branch_true: ...to here
flashrom-v1.6.0/serprog.c:666:21: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:672:21: branch_false: ...to here
flashrom-v1.6.0/serprog.c:672:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:673:55: call_function: inlined call to ‘atoi’ from ‘serprog_init’
flashrom-v1.6.0/serprog.c:673:33: call_function: calling ‘sp_opensocket’ from ‘serprog_init’
#  117|   	hostPtr = gethostbyname(ip);
#  118|   	if (NULL == hostPtr) {
#  119|-> 		hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);
#  120|   		if (NULL == hostPtr) {
#  121|   			close(sock);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def293]
flashrom-v1.6.0/serprog.c:121:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
flashrom-v1.6.0/serprog.c:605:12: enter_function: entry to ‘serprog_init’
flashrom-v1.6.0/serprog.c:653:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:659:12: branch_false: ...to here
flashrom-v1.6.0/serprog.c:659:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:661:20: branch_true: following ‘true’ branch (when ‘port’ is non-NULL)...
flashrom-v1.6.0/serprog.c:663:25: branch_true: ...to here
flashrom-v1.6.0/serprog.c:666:21: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:672:21: branch_false: ...to here
flashrom-v1.6.0/serprog.c:672:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:673:55: call_function: inlined call to ‘atoi’ from ‘serprog_init’
flashrom-v1.6.0/serprog.c:673:33: call_function: calling ‘sp_opensocket’ from ‘serprog_init’
#  119|   		hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);
#  120|   		if (NULL == hostPtr) {
#  121|-> 			close(sock);
#  122|   			msg_perr("Error: cannot resolve %s\n", ip);
#  123|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def294]
flashrom-v1.6.0/serprog.c:130:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
flashrom-v1.6.0/serprog.c:605:12: enter_function: entry to ‘serprog_init’
flashrom-v1.6.0/serprog.c:653:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:659:12: branch_false: ...to here
flashrom-v1.6.0/serprog.c:659:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:661:20: branch_true: following ‘true’ branch (when ‘port’ is non-NULL)...
flashrom-v1.6.0/serprog.c:663:25: branch_true: ...to here
flashrom-v1.6.0/serprog.c:666:21: branch_false: following ‘false’ branch...
flashrom-v1.6.0/serprog.c:672:21: branch_false: ...to here
flashrom-v1.6.0/serprog.c:672:20: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:673:55: call_function: inlined call to ‘atoi’ from ‘serprog_init’
flashrom-v1.6.0/serprog.c:673:33: call_function: calling ‘sp_opensocket’ from ‘serprog_init’
#  128|   	(void)memcpy(&sp.si.sin_addr, hostPtr->h_addr_list[0], hostPtr->h_length);
#  129|   	if (connect(sock, &sp.s, sizeof(sp.si)) < 0) {
#  130|-> 		close(sock);
#  131|   		msg_perr("Error: serprog cannot connect: %s\n", strerror(errno));
#  132|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def295]
flashrom-v1.6.0/serprog.c:268:29: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
flashrom-v1.6.0/serprog.c:286:12: enter_function: entry to ‘sp_stream_buffer_op’
flashrom-v1.6.0/serprog.c:292:14: acquire_memory: allocated here
flashrom-v1.6.0/serprog.c:293:12: branch_false: following ‘false’ branch (when ‘sp’ is non-NULL)...
flashrom-v1.6.0/serprog.c:297:9: branch_false: ...to here
flashrom-v1.6.0/serprog.c:298:12: branch_false: following ‘false’ branch (when ‘parms’ is NULL)...
flashrom-v1.6.0/serprog.c:301:43: branch_false: ...to here
flashrom-v1.6.0/serprog.c:301:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:302:21: branch_true: ...to here
flashrom-v1.6.0/serprog.c:302:21: call_function: calling ‘sp_flush_stream’ from ‘sp_stream_buffer_op’
#  266|   		do {
#  267|   			unsigned char c;
#  268|-> 			if (serialport_read(&c, 1) != 0) {
#  269|   				msg_perr("Error: cannot read from device (flushing stream)");
#  270|   				return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def296]
flashrom-v1.6.0/serprog.c:269:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
flashrom-v1.6.0/serprog.c:286:12: enter_function: entry to ‘sp_stream_buffer_op’
flashrom-v1.6.0/serprog.c:292:14: acquire_memory: allocated here
flashrom-v1.6.0/serprog.c:293:12: branch_false: following ‘false’ branch (when ‘sp’ is non-NULL)...
flashrom-v1.6.0/serprog.c:297:9: branch_false: ...to here
flashrom-v1.6.0/serprog.c:298:12: branch_false: following ‘false’ branch (when ‘parms’ is NULL)...
flashrom-v1.6.0/serprog.c:301:43: branch_false: ...to here
flashrom-v1.6.0/serprog.c:301:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:302:21: branch_true: ...to here
flashrom-v1.6.0/serprog.c:302:21: call_function: calling ‘sp_flush_stream’ from ‘sp_stream_buffer_op’
#  267|   			unsigned char c;
#  268|   			if (serialport_read(&c, 1) != 0) {
#  269|-> 				msg_perr("Error: cannot read from device (flushing stream)");
#  270|   				return 1;
#  271|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def297]
flashrom-v1.6.0/serprog.c:273:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
flashrom-v1.6.0/serprog.c:286:12: enter_function: entry to ‘sp_stream_buffer_op’
flashrom-v1.6.0/serprog.c:292:14: acquire_memory: allocated here
flashrom-v1.6.0/serprog.c:293:12: branch_false: following ‘false’ branch (when ‘sp’ is non-NULL)...
flashrom-v1.6.0/serprog.c:297:9: branch_false: ...to here
flashrom-v1.6.0/serprog.c:298:12: branch_false: following ‘false’ branch (when ‘parms’ is NULL)...
flashrom-v1.6.0/serprog.c:301:43: branch_false: ...to here
flashrom-v1.6.0/serprog.c:301:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:302:21: branch_true: ...to here
flashrom-v1.6.0/serprog.c:302:21: call_function: calling ‘sp_flush_stream’ from ‘sp_stream_buffer_op’
#  271|   			}
#  272|   			if (c == S_NAK) {
#  273|-> 				msg_perr("Error: NAK to a stream buffer operation\n");
#  274|   				return 1;
#  275|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
flashrom-v1.6.0/serprog.c:277:33: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
flashrom-v1.6.0/serprog.c:286:12: enter_function: entry to ‘sp_stream_buffer_op’
flashrom-v1.6.0/serprog.c:292:14: acquire_memory: allocated here
flashrom-v1.6.0/serprog.c:293:12: branch_false: following ‘false’ branch (when ‘sp’ is non-NULL)...
flashrom-v1.6.0/serprog.c:297:9: branch_false: ...to here
flashrom-v1.6.0/serprog.c:298:12: branch_false: following ‘false’ branch (when ‘parms’ is NULL)...
flashrom-v1.6.0/serprog.c:301:43: branch_false: ...to here
flashrom-v1.6.0/serprog.c:301:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:302:21: branch_true: ...to here
flashrom-v1.6.0/serprog.c:302:21: call_function: calling ‘sp_flush_stream’ from ‘sp_stream_buffer_op’
#  275|   			}
#  276|   			if (c != S_ACK) {
#  277|-> 				msg_perr("Error: Invalid reply 0x%02X from device\n", c);
#  278|   				return 1;
#  279|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
flashrom-v1.6.0/serprog.c:307:13: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
flashrom-v1.6.0/serprog.c:292:14: acquire_memory: allocated here
flashrom-v1.6.0/serprog.c:293:12: branch_false: following ‘false’ branch (when ‘sp’ is non-NULL)...
flashrom-v1.6.0/serprog.c:297:9: branch_false: ...to here
flashrom-v1.6.0/serprog.c:298:12: branch_false: following ‘false’ branch (when ‘parms’ is NULL)...
flashrom-v1.6.0/serprog.c:301:43: branch_false: ...to here
flashrom-v1.6.0/serprog.c:307:13: throw: if ‘serialport_write’ throws an exception...
flashrom-v1.6.0/serprog.c:307:13: danger: ‘sp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  305|   		}
#  306|   	}
#  307|-> 	if (serialport_write(sp, 1 + parmlen) != 0) {
#  308|   		msg_perr("Error: cannot write command\n");
#  309|   		free(sp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
flashrom-v1.6.0/serprog.c:308:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
flashrom-v1.6.0/serprog.c:292:14: acquire_memory: allocated here
flashrom-v1.6.0/serprog.c:293:12: branch_false: following ‘false’ branch (when ‘sp’ is non-NULL)...
flashrom-v1.6.0/serprog.c:297:9: branch_false: ...to here
flashrom-v1.6.0/serprog.c:298:12: branch_false: following ‘false’ branch (when ‘parms’ is NULL)...
flashrom-v1.6.0/serprog.c:301:43: branch_false: ...to here
flashrom-v1.6.0/serprog.c:307:12: branch_true: following ‘true’ branch...
flashrom-v1.6.0/serprog.c:308:17: branch_true: ...to here
flashrom-v1.6.0/serprog.c:308:17: throw: if ‘print’ throws an exception...
flashrom-v1.6.0/serprog.c:308:17: danger: ‘sp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  306|   	}
#  307|   	if (serialport_write(sp, 1 + parmlen) != 0) {
#  308|-> 		msg_perr("Error: cannot write command\n");
#  309|   		free(sp);
#  310|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
flashrom-v1.6.0/sfdp.c:41:15: warning[-Wanalyzer-malloc-leak]: leak of ‘newbuf’
flashrom-v1.6.0/sfdp.c:38:18: acquire_memory: allocated here
flashrom-v1.6.0/sfdp.c:39:12: branch_false: following ‘false’ branch (when ‘newbuf’ is non-NULL)...
flashrom-v1.6.0/sfdp.c:41:15: branch_false: ...to here
flashrom-v1.6.0/sfdp.c:41:15: throw: if ‘spi_send_command’ throws an exception...
flashrom-v1.6.0/sfdp.c:41:15: danger: ‘newbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   39|   	if (!newbuf)
#   40|   		return SPI_PROGRAMMER_ERROR;
#   41|-> 	ret = spi_send_command(flash, sizeof(cmd) - 1, len + 1, cmd, newbuf);
#   42|   	memmove(buf, newbuf + 1, len);
#   43|   	free(newbuf);

Error: CPPCHECK_WARNING (CWE-758): [#def302]
flashrom-v1.6.0/sfdp.c:201: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  199|   	tmp32 |= ((unsigned int)buf[(4 * 1) + 3]) << 24;
#  200|   
#  201|-> 	if (tmp32 & (1 << 31)) {
#  202|   		msg_cdbg("Flash chip size >= 4 Gb/512 MB not supported.\n");
#  203|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-674): [#def303]
flashrom-v1.6.0/spi.c:55:26: warning[-Wanalyzer-infinite-recursion]: infinite recursion
flashrom-v1.6.0/spi.c:61:5: enter_function: initial entry to ‘spi_send_command’
flashrom-v1.6.0/spi.c:65:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/spi.c:67:16: branch_false: ...to here
flashrom-v1.6.0/spi.c:67:16: call_function: calling ‘default_spi_send_command’ from ‘spi_send_command’
#   53|   	int result = 0;
#   54|   	for (; (cmds->writecnt || cmds->readcnt) && !result; cmds++) {
#   55|-> 		result = spi_send_command(flash, cmds->writecnt, cmds->readcnt,
#   56|   					  cmds->writearr, cmds->readarr);
#   57|   	}

Error: GCC_ANALYZER_WARNING (CWE-674): [#def304]
flashrom-v1.6.0/spi.c:67:16: warning[-Wanalyzer-infinite-recursion]: infinite recursion
flashrom-v1.6.0/spi.c:61:5: enter_function: entry to ‘spi_send_command’
flashrom-v1.6.0/spi.c:65:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/spi.c:67:16: branch_false: ...to here
flashrom-v1.6.0/spi.c:67:16: call_function: calling ‘default_spi_send_command’ from ‘spi_send_command’
#   65|   	if (flash->mst->spi.command)
#   66|   		return flash->mst->spi.command(flash, writecnt, readcnt, writearr, readarr);
#   67|-> 	return default_spi_send_command(flash, writecnt, readcnt, writearr, readarr);
#   68|   }
#   69|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def305]
flashrom-v1.6.0/spi25.c:464:9: warning[-Wanalyzer-null-argument]: use of NULL ‘out_bytes’ where non-null expected
flashrom-v1.6.0/spi25.c:554:5: enter_function: entry to ‘spi_block_erase_81’
flashrom-v1.6.0/spi25.c:557:16: call_function: calling ‘spi_write_cmd’ from ‘spi_block_erase_81’
#  462|   		return 1;
#  463|   
#  464|-> 	memcpy(cmd + 1 + addr_len, out_bytes, out_len);
#  465|   	cmds[1].writecnt = 1 + addr_len + out_len;
#  466|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def306]
flashrom-v1.6.0/spi25_statusreg.c:318:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
flashrom-v1.6.0/spi25_statusreg.c:876:12: enter_function: entry to ‘spi_disable_blockprotect_n25q’
flashrom-v1.6.0/spi25_statusreg.c:878:16: call_function: calling ‘spi_disable_blockprotect_generic’ from ‘spi_disable_blockprotect_n25q’
#  316|   	}
#  317|   	*data = status;
#  318|-> 	register_chip_restore(spi_restore_status, flash, data);
#  319|   
#  320|   	msg_cdbg("Some block protection in effect, disabling... ");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def307]
flashrom-v1.6.0/spi95.c:69:18: warning[-Wanalyzer-malloc-leak]: leak of ‘erased_contents’
flashrom-v1.6.0/spi95.c:63:38: acquire_memory: allocated here
flashrom-v1.6.0/spi95.c:64:12: branch_false: following ‘false’ branch (when ‘erased_contents’ is non-NULL)...
flashrom-v1.6.0/spi95.c:68:33: branch_false: ...to here
flashrom-v1.6.0/spi95.c:69:18: throw: if ‘spi_write_chunked’ throws an exception...
flashrom-v1.6.0/spi95.c:69:18: danger: ‘erased_contents’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   67|   	}
#   68|   	memset(erased_contents, ERASED_VALUE(flash), blocklen * sizeof(uint8_t));
#   69|-> 	result = spi_write_chunked(flash, erased_contents, 0, blocklen, flash->chip->page_size);
#   70|   	free(erased_contents);
#   71|   	return result;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def308]
flashrom-v1.6.0/usbblaster_spi.c:223:16: warning[-Wanalyzer-malloc-leak]: leak of ‘usbblaster_data’
flashrom-v1.6.0/usbblaster_spi.c:182:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:185:13: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:185:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:190:13: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:190:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:195:13: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:195:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:200:13: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:200:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:201:13: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:200:13: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:206:9: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:207:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:211:13: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:211:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/usbblaster_spi.c:216:27: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:216:27: acquire_memory: allocated here
flashrom-v1.6.0/usbblaster_spi.c:217:12: branch_false: following ‘false’ branch (when ‘usbblaster_data’ is non-NULL)...
flashrom-v1.6.0/usbblaster_spi.c:221:9: branch_false: ...to here
flashrom-v1.6.0/usbblaster_spi.c:223:16: throw: if ‘register_spi_master’ throws an exception...
flashrom-v1.6.0/usbblaster_spi.c:223:16: danger: ‘usbblaster_data’ leaks here; was allocated at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  221|   	usbblaster_data->ftdic = ftdic;
#  222|   
#  223|-> 	return register_spi_master(&spi_master_usbblaster, usbblaster_data);
#  224|   }
#  225|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def309]
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:203:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:164:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:165:17: branch_true: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:164:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:179:12: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:179:12: branch_false: following ‘false’ branch (when ‘fn’ is non-NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:182:14: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:183:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:185:15: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:186:12: branch_false: following ‘false’ branch (when ‘len >= 0’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:190:27: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:191:12: branch_true: following ‘true’ branch (when ‘buf == 18446744073709551615’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:195:23: branch_true: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:195:23: acquire_memory: allocated here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:196:20: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:198:17: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:199:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:202:9: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:203:9: throw: if ‘close’ throws an exception...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:203:9: danger: ‘buf’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#  201|   	}
#  202|   	printf("The flash image has a size of %d [0x%x] bytes.\n", len, len);
#  203|-> 	close(fd);
#  204|   
#  205|   	if (csn != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def310]
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:261:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:164:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:165:17: branch_true: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:179:12: branch_false: following ‘false’ branch (when ‘fn’ is non-NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:182:14: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:183:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:185:15: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:186:12: branch_false: following ‘false’ branch (when ‘len >= 0’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:190:27: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:191:12: branch_true: following ‘true’ branch (when ‘buf == 18446744073709551615’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:195:23: branch_true: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:195:23: acquire_memory: allocated here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:196:20: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:198:17: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:199:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:202:9: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:205:12: branch_false: following ‘false’ branch (when ‘csn’ is NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:261:15: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:261:15: throw: if ‘read_ich_descriptors_from_dump’ throws an exception...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:261:15: danger: ‘buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  259|   	}
#  260|   
#  261|-> 	ret = read_ich_descriptors_from_dump(buf, len, &cs, &desc);
#  262|   	switch (ret) {
#  263|   	case ICH_RET_OK:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def311]
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:277:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:164:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:165:17: branch_true: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:179:12: branch_false: following ‘false’ branch (when ‘fn’ is non-NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:182:14: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:183:12: branch_false: following ‘false’ branch...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:185:15: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:186:12: branch_false: following ‘false’ branch (when ‘len >= 0’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:190:27: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:191:12: branch_true: following ‘true’ branch (when ‘buf == 18446744073709551615’)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:195:23: branch_true: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:195:23: acquire_memory: allocated here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:196:20: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:198:17: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:199:20: branch_false: following ‘false’ branch...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:202:9: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:205:12: branch_false: following ‘false’ branch (when ‘csn’ is NULL)...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:261:15: branch_false: ...to here
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:277:9: throw: if ‘prettyprint_ich_descriptors’ throws an exception...
flashrom-v1.6.0/util/ich_descriptors_tool/ich_descriptors_tool.c:277:9: danger: ‘buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  275|   	}
#  276|   
#  277|-> 	prettyprint_ich_descriptors(cs, &desc);
#  278|   
#  279|   	pMAC = (uint8_t *) &buf[ICH_FREG_BASE(desc.region.FLREGs[3]) >> 2];

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-64.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-nameflashrom-1.6.0-2.fc44
store-results-to/tmp/tmpu3ov4bbv/flashrom-1.6.0-2.fc44.tar.xz
time-created2026-01-08 16:08:42
time-finished2026-01-08 16:10:10
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpu3ov4bbv/flashrom-1.6.0-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpu3ov4bbv/flashrom-1.6.0-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9