libusb1-1.0.29-4.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libusb-1.0.29/examples/dpfp.c:328:20: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
libusb-1.0.29/examples/dpfp.c:320:30: acquire_memory: allocated here
libusb-1.0.29/examples/dpfp.c:323:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
libusb-1.0.29/examples/dpfp.c:328:20: branch_false: ...to here
libusb-1.0.29/examples/dpfp.c:328:20: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  326|   	}
#  327|   
#  328|-> 	transfer = libusb_alloc_transfer(0);
#  329|   	if (!transfer) {
#  330|   		free(buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libusb-1.0.29/examples/ezusb.c:131:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  129|   
#  130|   	if (verbose > 1)
#  131|-> 		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|   	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libusb-1.0.29/examples/ezusb.c:131:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dImageBuf’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  129|   
#  130|   	if (verbose > 1)
#  131|-> 		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|   	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libusb-1.0.29/examples/ezusb.c:131:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  129|   
#  130|   	if (verbose > 1)
#  131|-> 		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|   	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libusb-1.0.29/examples/ezusb.c:132:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  130|   	if (verbose > 1)
#  131|   		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|-> 	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  134|   		opcode, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libusb-1.0.29/examples/ezusb.c:132:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dImageBuf’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  130|   	if (verbose > 1)
#  131|   		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|-> 	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  134|   		opcode, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libusb-1.0.29/examples/ezusb.c:132:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  130|   	if (verbose > 1)
#  131|   		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|-> 	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  134|   		opcode, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
libusb-1.0.29/examples/ezusb.c:138:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  136|   	if (status != (signed)len) {
#  137|   		if (status < 0)
#  138|-> 			logerror("%s: %s\n", label, libusb_error_name(status));
#  139|   		else
#  140|   			logerror("%s ==> %d\n", label, status);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libusb-1.0.29/examples/ezusb.c:138:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  136|   	if (status != (signed)len) {
#  137|   		if (status < 0)
#  138|-> 			logerror("%s: %s\n", label, libusb_error_name(status));
#  139|   		else
#  140|   			logerror("%s ==> %d\n", label, status);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
libusb-1.0.29/examples/ezusb.c:140:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  138|   			logerror("%s: %s\n", label, libusb_error_name(status));
#  139|   		else
#  140|-> 			logerror("%s ==> %d\n", label, status);
#  141|   	}
#  142|   	if (status < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libusb-1.0.29/examples/ezusb.c:140:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  138|   			logerror("%s: %s\n", label, libusb_error_name(status));
#  139|   		else
#  140|-> 			logerror("%s ==> %d\n", label, status);
#  141|   	}
#  142|   	if (status < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
libusb-1.0.29/examples/ezusb.c:158:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  156|   
#  157|   	if (verbose > 1)
#  158|-> 		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  159|   	status = libusb_control_transfer(device,
#  160|   		LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libusb-1.0.29/examples/ezusb.c:158:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  156|   
#  157|   	if (verbose > 1)
#  158|-> 		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  159|   	status = libusb_control_transfer(device,
#  160|   		LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
libusb-1.0.29/examples/ezusb.c:159:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  157|   	if (verbose > 1)
#  158|   		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  159|-> 	status = libusb_control_transfer(device,
#  160|   		LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  161|   		opcode, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
libusb-1.0.29/examples/ezusb.c:159:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  157|   	if (verbose > 1)
#  158|   		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  159|-> 	status = libusb_control_transfer(device,
#  160|   		LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  161|   		opcode, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
libusb-1.0.29/examples/ezusb.c:165:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  163|   	if (status != (signed)len) {
#  164|   		if (status < 0)
#  165|-> 			logerror("%s: %s\n", label, libusb_error_name(status));
#  166|   		else
#  167|   			logerror("%s ==> %d\n", label, status);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libusb-1.0.29/examples/ezusb.c:165:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  163|   	if (status != (signed)len) {
#  164|   		if (status < 0)
#  165|-> 			logerror("%s: %s\n", label, libusb_error_name(status));
#  166|   		else
#  167|   			logerror("%s ==> %d\n", label, status);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
libusb-1.0.29/examples/ezusb.c:167:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  165|   			logerror("%s: %s\n", label, libusb_error_name(status));
#  166|   		else
#  167|-> 			logerror("%s ==> %d\n", label, status);
#  168|   	}
#  169|   	if (status < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libusb-1.0.29/examples/ezusb.c:167:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:22: call_function: calling ‘ezusb_read’ from ‘fx3_load_ram’
#  165|   			logerror("%s: %s\n", label, libusb_error_name(status));
#  166|   		else
#  167|-> 			logerror("%s ==> %d\n", label, status);
#  168|   	}
#  169|   	if (status < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
libusb-1.0.29/examples/ezusb.c:186:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  184|   
#  185|   	if (verbose)
#  186|-> 		logerror("%s\n", data ? "stop CPU" : "reset CPU");
#  187|   	status = libusb_control_transfer(device,
#  188|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
libusb-1.0.29/examples/ezusb.c:186:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  184|   
#  185|   	if (verbose)
#  186|-> 		logerror("%s\n", data ? "stop CPU" : "reset CPU");
#  187|   	status = libusb_control_transfer(device,
#  188|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
libusb-1.0.29/examples/ezusb.c:187:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  185|   	if (verbose)
#  186|   		logerror("%s\n", data ? "stop CPU" : "reset CPU");
#  187|-> 	status = libusb_control_transfer(device,
#  188|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  189|   		RW_INTERNAL, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libusb-1.0.29/examples/ezusb.c:187:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  185|   	if (verbose)
#  186|   		logerror("%s\n", data ? "stop CPU" : "reset CPU");
#  187|-> 	status = libusb_control_transfer(device,
#  188|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  189|   		RW_INTERNAL, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def24]
libusb-1.0.29/examples/ezusb.c:197:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  195|   		const char *mesg = "can't modify CPUCS";
#  196|   		if (status < 0)
#  197|-> 			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  198|   		else
#  199|   			logerror("%s\n", mesg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libusb-1.0.29/examples/ezusb.c:197:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  195|   		const char *mesg = "can't modify CPUCS";
#  196|   		if (status < 0)
#  197|-> 			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  198|   		else
#  199|   			logerror("%s\n", mesg);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
libusb-1.0.29/examples/ezusb.c:199:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  197|   			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  198|   		else
#  199|-> 			logerror("%s\n", mesg);
#  200|   		return false;
#  201|   	} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
libusb-1.0.29/examples/ezusb.c:199:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:728:5: enter_function: entry to ‘ezusb_load_ram’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_false: following ‘false’ branch (when ‘img_type != 1’)...
libusb-1.0.29/examples/ezusb.c:760:9: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_true: following ‘true’ branch (when ‘stage == 0’)...
libusb-1.0.29/examples/ezusb.c:777:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:780:36: call_function: calling ‘ezusb_cpucs’ from ‘ezusb_load_ram’
#  197|   			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  198|   		else
#  199|-> 			logerror("%s\n", mesg);
#  200|   		return false;
#  201|   	} else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def28]
libusb-1.0.29/examples/ezusb.c:214:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  212|   
#  213|   	if (verbose)
#  214|-> 		logerror("transfer execution to Program Entry at 0x%08x\n", addr);
#  215|   	status = libusb_control_transfer(device,
#  216|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libusb-1.0.29/examples/ezusb.c:214:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  212|   
#  213|   	if (verbose)
#  214|-> 		logerror("transfer execution to Program Entry at 0x%08x\n", addr);
#  215|   	status = libusb_control_transfer(device,
#  216|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
libusb-1.0.29/examples/ezusb.c:215:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  213|   	if (verbose)
#  214|   		logerror("transfer execution to Program Entry at 0x%08x\n", addr);
#  215|-> 	status = libusb_control_transfer(device,
#  216|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  217|   		RW_INTERNAL, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
libusb-1.0.29/examples/ezusb.c:215:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  213|   	if (verbose)
#  214|   		logerror("transfer execution to Program Entry at 0x%08x\n", addr);
#  215|-> 	status = libusb_control_transfer(device,
#  216|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  217|   		RW_INTERNAL, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
libusb-1.0.29/examples/ezusb.c:224:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  222|   		const char *mesg = "failed to send jump command";
#  223|   		if (status < 0)
#  224|-> 			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  225|   		else
#  226|   			logerror("%s\n", mesg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libusb-1.0.29/examples/ezusb.c:224:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  222|   		const char *mesg = "failed to send jump command";
#  223|   		if (status < 0)
#  224|-> 			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  225|   		else
#  226|   			logerror("%s\n", mesg);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
libusb-1.0.29/examples/ezusb.c:226:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  224|   			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  225|   		else
#  226|-> 			logerror("%s\n", mesg);
#  227|   		return false;
#  228|   	} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
libusb-1.0.29/examples/ezusb.c:226:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:698:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:13: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:705:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:705:14: call_function: calling ‘ezusb_fx3_jump’ from ‘fx3_load_ram’
#  224|   			logerror("%s: %s\n", mesg, libusb_error_name(status));
#  225|   		else
#  226|-> 			logerror("%s\n", mesg);
#  227|   		return false;
#  228|   	} else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
libusb-1.0.29/examples/ezusb.c:589:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:588:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:589:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:589:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/0)
#  587|   		return -2;
#  588|   	} else if (verbose)
#  589|-> 		logerror("open firmware image %s for RAM upload\n", path);
#  590|   
#  591|   	// Read header

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libusb-1.0.29/examples/ezusb.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:588:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:589:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:589:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
#  587|   		return -2;
#  588|   	} else if (verbose)
#  589|-> 		logerror("open firmware image %s for RAM upload\n", path);
#  590|   
#  591|   	// Read header

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
libusb-1.0.29/examples/ezusb.c:593:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:593:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:593:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/0)
#  591|   	// Read header
#  592|   	if (fread(hBuf, sizeof(char), sizeof(hBuf), image) != sizeof(hBuf)) {
#  593|-> 		logerror("could not read image header");
#  594|   		ret = -3;
#  595|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
libusb-1.0.29/examples/ezusb.c:593:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:593:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:593:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
#  591|   	// Read header
#  592|   	if (fread(hBuf, sizeof(char), sizeof(hBuf), image) != sizeof(hBuf)) {
#  593|-> 		logerror("could not read image header");
#  594|   		ret = -3;
#  595|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
libusb-1.0.29/examples/ezusb.c:600:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:600:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/0)
#  598|   	// check "CY" signature byte and format
#  599|   	if ((hBuf[0] != 'C') || (hBuf[1] != 'Y')) {
#  600|-> 		logerror("image doesn't have a CYpress signature\n");
#  601|   		ret = -3;
#  602|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libusb-1.0.29/examples/ezusb.c:600:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:600:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/0)
#  598|   	// check "CY" signature byte and format
#  599|   	if ((hBuf[0] != 'C') || (hBuf[1] != 'Y')) {
#  600|-> 		logerror("image doesn't have a CYpress signature\n");
#  601|   		ret = -3;
#  602|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
libusb-1.0.29/examples/ezusb.c:609:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:608:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:609:80: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:609:25: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/0)
#  607|   	case 0xB0:
#  608|   		if (verbose)
#  609|-> 			logerror("normal FW binary %s image with checksum\n", (hBuf[2]&0x01)?"data":"executable");
#  610|   		break;
#  611|   	case 0xB1:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
libusb-1.0.29/examples/ezusb.c:609:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:608:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:609:80: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:609:25: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/0)
#  607|   	case 0xB0:
#  608|   		if (verbose)
#  609|-> 			logerror("normal FW binary %s image with checksum\n", (hBuf[2]&0x01)?"data":"executable");
#  610|   		break;
#  611|   	case 0xB1:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
libusb-1.0.29/examples/ezusb.c:612:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:612:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/0)
#  610|   		break;
#  611|   	case 0xB1:
#  612|-> 		logerror("security binary image is not currently supported\n");
#  613|   		ret = -3;
#  614|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libusb-1.0.29/examples/ezusb.c:612:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:612:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
#  610|   		break;
#  611|   	case 0xB1:
#  612|-> 		logerror("security binary image is not currently supported\n");
#  613|   		ret = -3;
#  614|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
libusb-1.0.29/examples/ezusb.c:616:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:616:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/0)
#  614|   		goto exit;
#  615|   	case 0xB2:
#  616|-> 		logerror("VID:PID image is not currently supported\n");
#  617|   		ret = -3;
#  618|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
libusb-1.0.29/examples/ezusb.c:616:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:616:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/0)
#  614|   		goto exit;
#  615|   	case 0xB2:
#  616|-> 		logerror("VID:PID image is not currently supported\n");
#  617|   		ret = -3;
#  618|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
libusb-1.0.29/examples/ezusb.c:620:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:620:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/0)
#  618|   		goto exit;
#  619|   	default:
#  620|-> 		logerror("invalid image type 0x%02X\n", hBuf[3]);
#  621|   		ret = -3;
#  622|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
libusb-1.0.29/examples/ezusb.c:620:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:620:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/0)
#  618|   		goto exit;
#  619|   	default:
#  620|-> 		logerror("invalid image type 0x%02X\n", hBuf[3]);
#  621|   		ret = -3;
#  622|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
libusb-1.0.29/examples/ezusb.c:632:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:632:104: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:632:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/0)
#  630|   			goto exit;
#  631|   		}
#  632|-> 		logerror("FX3 bootloader version: 0x%02X%02X%02X%02X\n", blBuf[3], blBuf[2], blBuf[1], blBuf[0]);
#  633|   	}
#  634|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
libusb-1.0.29/examples/ezusb.c:632:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:626:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:627:22: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:627:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:632:104: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:632:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/0)
#  630|   			goto exit;
#  631|   		}
#  632|-> 		logerror("FX3 bootloader version: 0x%02X%02X%02X%02X\n", blBuf[3], blBuf[2], blBuf[1], blBuf[0]);
#  633|   	}
#  634|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
libusb-1.0.29/examples/ezusb.c:637:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:636:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:637:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:637:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/0)
#  635|   	dCheckSum = 0;
#  636|   	if (verbose)
#  637|-> 		logerror("writing image...\n");
#  638|   	while (1) {
#  639|   		if ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) ||  // read dLength

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
libusb-1.0.29/examples/ezusb.c:637:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:636:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:637:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:637:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/0)
#  635|   	dCheckSum = 0;
#  636|   	if (verbose)
#  637|-> 		logerror("writing image...\n");
#  638|   	while (1) {
#  639|   		if ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) ||  // read dLength

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
libusb-1.0.29/examples/ezusb.c:641:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:641:25: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:641:25: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/0)
#  639|   		if ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) ||  // read dLength
#  640|   			(fread(&dAddress, sizeof(uint32_t), 1, image) != 1)) { // read dAddress
#  641|-> 			logerror("could not read image");
#  642|   			ret = -3;
#  643|   			goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libusb-1.0.29/examples/ezusb.c:641:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:641:25: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:641:25: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/0)
#  639|   		if ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) ||  // read dLength
#  640|   			(fread(&dAddress, sizeof(uint32_t), 1, image) != 1)) { // read dAddress
#  641|-> 			logerror("could not read image");
#  642|   			ret = -3;
#  643|   			goto exit;

Error: GCC_ANALYZER_WARNING (CWE-789): [#def56]
libusb-1.0.29/examples/ezusb.c:649:40: warning[-Wanalyzer-tainted-allocation-size]: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as allocation size without upper-bounds checking
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: danger: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as allocation size without upper-bounds checking
#  647|   
#  648|   		// coverity[tainted_data]
#  649|-> 		dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
#  650|   		if (dImageBuf == NULL) {
#  651|   			logerror("could not allocate buffer for image chunk\n");

Error: GCC_ANALYZER_WARNING (CWE-129): [#def57]
libusb-1.0.29/examples/ezusb.c:649:40: warning[-Wanalyzer-tainted-size]: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as size without upper-bounds checking
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: danger: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as size without upper-bounds checking
#  647|   
#  648|   		// coverity[tainted_data]
#  649|-> 		dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
#  650|   		if (dImageBuf == NULL) {
#  651|   			logerror("could not allocate buffer for image chunk\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
libusb-1.0.29/examples/ezusb.c:651:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:651:25: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/0)
#  649|   		dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
#  650|   		if (dImageBuf == NULL) {
#  651|-> 			logerror("could not allocate buffer for image chunk\n");
#  652|   			ret = -4;
#  653|   			goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
libusb-1.0.29/examples/ezusb.c:651:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:651:25: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/0)
#  649|   		dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
#  650|   		if (dImageBuf == NULL) {
#  651|-> 			logerror("could not allocate buffer for image chunk\n");
#  652|   			ret = -4;
#  653|   			goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
libusb-1.0.29/examples/ezusb.c:658:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:658:25: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/0)
#  656|   		// read sections
#  657|   		if (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) {
#  658|-> 			logerror("could not read image");
#  659|   			free(dImageBuf);
#  660|   			ret = -3;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
libusb-1.0.29/examples/ezusb.c:658:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dImageBuf’
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:658:25: danger: ‘dImageBuf’ leaks here; was allocated at [(15)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/14)
#  656|   		// read sections
#  657|   		if (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) {
#  658|-> 			logerror("could not read image");
#  659|   			free(dImageBuf);
#  660|   			ret = -3;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
libusb-1.0.29/examples/ezusb.c:658:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:658:25: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/0)
#  656|   		// read sections
#  657|   		if (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) {
#  658|-> 			logerror("could not read image");
#  659|   			free(dImageBuf);
#  660|   			ret = -3;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
libusb-1.0.29/examples/ezusb.c:674:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:672:30: return_function: returning to ‘fx3_load_ram’ from ‘ezusb_write’
libusb-1.0.29/examples/ezusb.c:672:28: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:674:33: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:674:33: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(2)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/1)
#  672|   			if ((ezusb_write(device, "write firmware", RW_INTERNAL, dAddress, bBuf, dLen) < 0) ||
#  673|   				(ezusb_read(device, "read firmware", RW_INTERNAL, dAddress, rBuf, dLen) < 0)) {
#  674|-> 				logerror("R/W error\n");
#  675|   				free(dImageBuf);
#  676|   				ret = -5;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
libusb-1.0.29/examples/ezusb.c:674:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:663:29: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:665:25: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:672:30: return_function: returning to ‘fx3_load_ram’ from ‘ezusb_write’
libusb-1.0.29/examples/ezusb.c:672:28: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:674:33: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:674:33: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/1)
#  672|   			if ((ezusb_write(device, "write firmware", RW_INTERNAL, dAddress, bBuf, dLen) < 0) ||
#  673|   				(ezusb_read(device, "read firmware", RW_INTERNAL, dAddress, rBuf, dLen) < 0)) {
#  674|-> 				logerror("R/W error\n");
#  675|   				free(dImageBuf);
#  676|   				ret = -5;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
libusb-1.0.29/examples/ezusb.c:699:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:699:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:699:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/71/codeFlows/0/threadFlows/0/locations/0)
#  697|   	if ((fread(&dExpectedCheckSum, sizeof(uint32_t), 1, image) != 1) ||
#  698|   		(dCheckSum != dExpectedCheckSum)) {
#  699|-> 		logerror("checksum error\n");
#  700|   		ret = -7;
#  701|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
libusb-1.0.29/examples/ezusb.c:699:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:697:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:699:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:699:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/72/codeFlows/0/threadFlows/0/locations/0)
#  697|   	if ((fread(&dExpectedCheckSum, sizeof(uint32_t), 1, image) != 1) ||
#  698|   		(dCheckSum != dExpectedCheckSum)) {
#  699|-> 		logerror("checksum error\n");
#  700|   		ret = -7;
#  701|   		goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
libusb-1.0.29/examples/ezusb.c:746:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:745:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:746:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:746:17: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/73/codeFlows/0/threadFlows/0/locations/2)
#  744|   		return -2;
#  745|   	} else if (verbose > 1)
#  746|-> 		logerror("open firmware image %s for RAM upload\n", path);
#  747|   
#  748|   	if (img_type == IMG_TYPE_IIC) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
libusb-1.0.29/examples/ezusb.c:746:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:745:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:746:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:746:17: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/74/codeFlows/0/threadFlows/0/locations/2)
#  744|   		return -2;
#  745|   	} else if (verbose > 1)
#  746|-> 		logerror("open firmware image %s for RAM upload\n", path);
#  747|   
#  748|   	if (img_type == IMG_TYPE_IIC) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
libusb-1.0.29/examples/ezusb.c:753:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_true: following ‘true’ branch (when ‘img_type == 1’)...
libusb-1.0.29/examples/ezusb.c:749:23: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:749:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:753:25: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:753:25: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/75/codeFlows/0/threadFlows/0/locations/2)
#  751|   		  || ((fx_type == FX_TYPE_AN21) && (iic_header[0] != 0xB2))
#  752|   		  || ((fx_type == FX_TYPE_FX1) && (iic_header[0] != 0xB6)) ) {
#  753|-> 			logerror("IIC image does not contain executable code - cannot load to RAM.\n");
#  754|   			ret = -1;
#  755|   			goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
libusb-1.0.29/examples/ezusb.c:753:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:748:12: branch_true: following ‘true’ branch (when ‘img_type == 1’)...
libusb-1.0.29/examples/ezusb.c:749:23: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:749:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:753:25: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:753:25: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/76/codeFlows/0/threadFlows/0/locations/2)
#  751|   		  || ((fx_type == FX_TYPE_AN21) && (iic_header[0] != 0xB2))
#  752|   		  || ((fx_type == FX_TYPE_FX1) && (iic_header[0] != 0xB6)) ) {
#  753|-> 			logerror("IIC image does not contain executable code - cannot load to RAM.\n");
#  754|   			ret = -1;
#  755|   			goto exit;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def71]
libusb-1.0.29/examples/ezusb.c:792:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_false: following ‘false’ branch (when ‘stage != 0’)...
libusb-1.0.29/examples/ezusb.c:788:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:791:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:792:25: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:792:25: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/77/codeFlows/0/threadFlows/0/locations/2)
#  790|   		/* let CPU run; overwrite the 2nd stage loader later */
#  791|   		if (verbose)
#  792|-> 			logerror("2nd stage: write external memory\n");
#  793|   	}
#  794|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libusb-1.0.29/examples/ezusb.c:792:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_false: following ‘false’ branch (when ‘stage != 0’)...
libusb-1.0.29/examples/ezusb.c:788:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:791:20: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:792:25: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:792:25: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/78/codeFlows/0/threadFlows/0/locations/2)
#  790|   		/* let CPU run; overwrite the 2nd stage loader later */
#  791|   		if (verbose)
#  792|-> 			logerror("2nd stage: write external memory\n");
#  793|   	}
#  794|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
libusb-1.0.29/examples/ezusb.c:798:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_false: following ‘false’ branch (when ‘stage != 0’)...
libusb-1.0.29/examples/ezusb.c:788:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:798:18: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/79/codeFlows/0/threadFlows/0/locations/2)
#  796|   	ctx.device = device;
#  797|   	ctx.total = ctx.count = 0;
#  798|-> 	status = parse[img_type](image, &ctx, is_external, ram_poke);
#  799|   	if (status < 0) {
#  800|   		logerror("unable to upload %s\n", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
libusb-1.0.29/examples/ezusb.c:798:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:776:12: branch_false: following ‘false’ branch (when ‘stage != 0’)...
libusb-1.0.29/examples/ezusb.c:788:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:798:18: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/80/codeFlows/0/threadFlows/0/locations/2)
#  796|   	ctx.device = device;
#  797|   	ctx.total = ctx.count = 0;
#  798|-> 	status = parse[img_type](image, &ctx, is_external, ram_poke);
#  799|   	if (status < 0) {
#  800|   		logerror("unable to upload %s\n", path);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def75]
libusb-1.0.29/examples/fxload.c:61:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
libusb-1.0.29/examples/fxload.c:57:9: acquire_resource: ‘va_start’ called here
libusb-1.0.29/examples/fxload.c:60:12: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/fxload.c:61:17: branch_true: ...to here
libusb-1.0.29/examples/fxload.c:61:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   59|   #if !defined(_WIN32) || defined(__CYGWIN__)
#   60|   	if (dosyslog)
#   61|-> 		vsyslog(LOG_ERR, format, ap);
#   62|   	else
#   63|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def76]
libusb-1.0.29/examples/testlibusb.c:252:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(device_name, 2)’
libusb-1.0.29/examples/testlibusb.c:247:14: acquire_resource: opened here
libusb-1.0.29/examples/testlibusb.c:248:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/testlibusb.c:252:13: branch_false: ...to here
libusb-1.0.29/examples/testlibusb.c:252:13: danger: ‘open(device_name, 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  250|   		return 1;
#  251|   	}
#  252|-> 	r = libusb_wrap_sys_device(NULL, fd, &handle);
#  253|   	if (r) {
#  254|   		printf("Error wrapping device: %s: %s\n", device_name, libusb_strerror(r));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
libusb-1.0.29/examples/xusb.c:361:21: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libusb-1.0.29/examples/xusb.c:1101:5: enter_function: entry to ‘main’
libusb-1.0.29/examples/xusb.c:1122:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/xusb.c:1127:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1228:12: branch_false: following ‘false’ branch (when ‘r >= 0’)...
libusb-1.0.29/examples/xusb.c:1232:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1234:12: branch_false: following ‘false’ branch (when ‘error_lang’ is NULL)...
libusb-1.0.29/examples/xusb.c:1240:13: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1240:13: call_function: calling ‘test_device’ from ‘main’
#  359|   	do {
#  360|   		// The transfer length must always be exactly 31 bytes.
#  361|-> 		r = libusb_bulk_transfer(handle, endpoint, (unsigned char*)&cbw, 31, &size, 1000);
#  362|   		if (r == LIBUSB_ERROR_PIPE) {
#  363|   			libusb_clear_halt(handle, endpoint);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
libusb-1.0.29/examples/xusb.c:363:25: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libusb-1.0.29/examples/xusb.c:1101:5: enter_function: entry to ‘main’
libusb-1.0.29/examples/xusb.c:1122:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/xusb.c:1127:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1228:12: branch_false: following ‘false’ branch (when ‘r >= 0’)...
libusb-1.0.29/examples/xusb.c:1232:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1234:12: branch_false: following ‘false’ branch (when ‘error_lang’ is NULL)...
libusb-1.0.29/examples/xusb.c:1240:13: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1240:13: call_function: calling ‘test_device’ from ‘main’
#  361|   		r = libusb_bulk_transfer(handle, endpoint, (unsigned char*)&cbw, 31, &size, 1000);
#  362|   		if (r == LIBUSB_ERROR_PIPE) {
#  363|-> 			libusb_clear_halt(handle, endpoint);
#  364|   		}
#  365|   		i++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
libusb-1.0.29/examples/xusb.c:368:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libusb-1.0.29/examples/xusb.c:1101:5: enter_function: entry to ‘main’
libusb-1.0.29/examples/xusb.c:1122:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/xusb.c:1127:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1228:12: branch_false: following ‘false’ branch (when ‘r >= 0’)...
libusb-1.0.29/examples/xusb.c:1232:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1234:12: branch_false: following ‘false’ branch (when ‘error_lang’ is NULL)...
libusb-1.0.29/examples/xusb.c:1240:13: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1240:13: call_function: calling ‘test_device’ from ‘main’
#  366|   	} while ((r == LIBUSB_ERROR_PIPE) && (i<RETRY_MAX));
#  367|   	if (r != LIBUSB_SUCCESS) {
#  368|-> 		perr("   send_mass_storage_command: %s\n", libusb_strerror((enum libusb_error)r));
#  369|   		return -1;
#  370|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
libusb-1.0.29/examples/xusb.c:543:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libusb-1.0.29/examples/xusb.c:1101:5: enter_function: entry to ‘main’
libusb-1.0.29/examples/xusb.c:1122:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/xusb.c:1127:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1228:12: branch_false: following ‘false’ branch (when ‘r >= 0’)...
libusb-1.0.29/examples/xusb.c:1232:12: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1234:12: branch_false: following ‘false’ branch (when ‘error_lang’ is NULL)...
libusb-1.0.29/examples/xusb.c:1240:13: branch_false: ...to here
libusb-1.0.29/examples/xusb.c:1240:13: call_function: calling ‘test_device’ from ‘main’
#  541|   
#  542|   	send_mass_storage_command(handle, endpoint_out, lun, cdb, LIBUSB_ENDPOINT_IN, block_size, &expected_tag);
#  543|-> 	libusb_bulk_transfer(handle, endpoint_in, data, block_size, &size, 5000);
#  544|   	printf("   READ: received %d bytes\n", size);
#  545|   	if (get_mass_storage_status(handle, endpoint_in, expected_tag) == -2) {

Error: GCC_ANALYZER_WARNING (CWE-686): [#def81]
libusb-1.0.29/libusb/core.c:2310:17: warning[-Wanalyzer-va-arg-type-mismatch]: 'va_arg' expected 'libusb_log_cb' {{aka 'void (*)(libusb_context *, enum libusb_log_level,  const char *)'}} but received 'int' for variadic argument 1 of 'ap'
libusb-1.0.29/libusb/core.c:2422:18: enter_function: entry to 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2438:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2438:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2443:9: call_function: calling 'usbi_mutex_static_unlock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2443:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_unlock'
libusb-1.0.29/libusb/core.c:2446:12: branch_false: following 'false' branch (when '_ctx' is non-NULL)...
libusb-1.0.29/libusb/core.c:2452:9: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2461:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2461:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2462:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2462:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_true: following 'true' branch (when 'option == 0')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/core.c:2471:20: branch_true: following 'true' branch (when 'option != 3')...
libusb-1.0.29/libusb/core.c:2472:29: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context' with 0 variadic arguments
libusb-1.0.29/libusb/core.c:2472:29: return_function: returning to 'libusb_init_context' from 'libusb_set_option'
libusb-1.0.29/libusb/core.c:2476:20: branch_false: following 'false' branch (when 'r == 0')...
libusb-1.0.29/libusb/core.c:2467:75: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context' with 0 variadic arguments
libusb-1.0.29/libusb/core.c:2472:29: return_function: returning to 'libusb_init_context' from 'libusb_set_option'
libusb-1.0.29/libusb/core.c:2476:20: branch_false: following 'false' branch (when 'r == 0')...
libusb-1.0.29/libusb/core.c:2467:75: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2481:26: branch_true: following 'true' branch (when 'i < num_options')...
libusb-1.0.29/libusb/core.c:2482:31: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2482:17: branch_false: following 'false' branch...
libusb-1.0.29/libusb/core.c:2487:17: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2492:29: call_function: calling 'libusb_set_option' from 'libusb_init_context' with 1 variadic argument
# 2308|   	}
# 2309|   	if (LIBUSB_OPTION_LOG_CB == option) {
# 2310|-> 		log_cb = (libusb_log_cb) va_arg(ap, libusb_log_cb);
# 2311|   	}
# 2312|   

Error: GCC_ANALYZER_WARNING (CWE-685): [#def82]
libusb-1.0.29/libusb/core.c:2310:17: warning[-Wanalyzer-va-list-exhausted]: 'ap' has no more arguments (0 consumed)
libusb-1.0.29/libusb/core.c:2422:18: enter_function: entry to 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2438:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2438:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2443:9: call_function: calling 'usbi_mutex_static_unlock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2443:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_unlock'
libusb-1.0.29/libusb/core.c:2446:12: branch_false: following 'false' branch (when '_ctx' is non-NULL)...
libusb-1.0.29/libusb/core.c:2452:9: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2461:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2461:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2462:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2462:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_true: following 'true' branch (when 'option == 0')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/core.c:2471:20: branch_true: following 'true' branch (when 'option != 3')...
libusb-1.0.29/libusb/core.c:2472:29: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context' with 0 variadic arguments
libusb-1.0.29/libusb/core.c:2472:29: return_function: returning to 'libusb_init_context' from 'libusb_set_option'
libusb-1.0.29/libusb/core.c:2476:20: branch_false: following 'false' branch (when 'r == 0')...
libusb-1.0.29/libusb/core.c:2467:75: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context' with 0 variadic arguments
libusb-1.0.29/libusb/core.c:2472:29: return_function: returning to 'libusb_init_context' from 'libusb_set_option'
libusb-1.0.29/libusb/core.c:2476:20: branch_false: following 'false' branch (when 'r == 0')...
libusb-1.0.29/libusb/core.c:2467:75: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context' with 0 variadic arguments
# 2308|   	}
# 2309|   	if (LIBUSB_OPTION_LOG_CB == option) {
# 2310|-> 		log_cb = (libusb_log_cb) va_arg(ap, libusb_log_cb);
# 2311|   	}
# 2312|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def83]
libusb-1.0.29/libusb/core.c:2354:37: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libusb-1.0.29/libusb/core.c:2422:18: enter_function: entry to 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2438:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2438:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2443:9: call_function: calling 'usbi_mutex_static_unlock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2443:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_unlock'
libusb-1.0.29/libusb/core.c:2446:12: branch_false: following 'false' branch (when '_ctx' is non-NULL)...
libusb-1.0.29/libusb/core.c:2452:9: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2461:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2461:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2462:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2462:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_true: following 'true' branch (when 'option == 0')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/core.c:2471:20: branch_true: following 'true' branch (when 'option != 3')...
libusb-1.0.29/libusb/core.c:2472:29: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context'
# 2352|   		case LIBUSB_OPTION_NO_DEVICE_DISCOVERY:
# 2353|   			if (usbi_backend.set_option) {
# 2354|-> 				r = usbi_backend.set_option(ctx, option, ap);
# 2355|   				break;
# 2356|   			}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def84]
libusb-1.0.29/libusb/core.c:2743:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libusb-1.0.29/libusb/core.c:2845:6: enter_function: entry to 'usbi_log'
libusb-1.0.29/libusb/core.c:2850:9: acquire_resource: 'va_start' called here
libusb-1.0.29/libusb/core.c:2851:9: call_function: calling 'log_v' from 'usbi_log'
# 2741|   	/* Global log handler */
# 2742|   	if (log_handler)
# 2743|-> 		log_handler(NULL, level, str);
# 2744|   	else
# 2745|   		fputs(str, stderr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def85]
libusb-1.0.29/libusb/core.c:2809:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libusb-1.0.29/libusb/core.c:2845:6: enter_function: entry to 'usbi_log'
libusb-1.0.29/libusb/core.c:2850:9: acquire_resource: 'va_start' called here
libusb-1.0.29/libusb/core.c:2851:9: call_function: calling 'log_v' from 'usbi_log'
# 2807|   		TIMESPEC_SUB(&timestamp, &timestamp_origin, &timestamp);
# 2808|   
# 2809|-> 		header_len = snprintf(buf, sizeof(buf),
# 2810|   			"[%2ld.%06ld] [%08lx] libusb: %s [%s] ",
# 2811|   			(long)timestamp.tv_sec, (long)(timestamp.tv_nsec / 1000L), usbi_get_tid(), prefix, function);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
libusb-1.0.29/libusb/descriptor.c:337:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  335|   
#  336|   	if (size < LIBUSB_DT_CONFIG_SIZE) {
#  337|-> 		usbi_err(ctx, "short config descriptor read %d/%d",
#  338|   			 size, LIBUSB_DT_CONFIG_SIZE);
#  339|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
libusb-1.0.29/libusb/descriptor.c:351:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  349|   	config->MaxPower = buffer[8];
#  350|   	if (config->bDescriptorType != LIBUSB_DT_CONFIG) {
#  351|-> 		usbi_err(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#  352|   			 config->bDescriptorType, LIBUSB_DT_CONFIG);
#  353|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
libusb-1.0.29/libusb/descriptor.c:355:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  353|   		return LIBUSB_ERROR_IO;
#  354|   	} else if (config->bLength < LIBUSB_DT_CONFIG_SIZE) {
#  355|-> 		usbi_err(ctx, "invalid config bLength (%u)", config->bLength);
#  356|   		return LIBUSB_ERROR_IO;
#  357|   	} else if (config->bLength > size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
libusb-1.0.29/libusb/descriptor.c:358:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  356|   		return LIBUSB_ERROR_IO;
#  357|   	} else if (config->bLength > size) {
#  358|-> 		usbi_err(ctx, "short config descriptor read %d/%u",
#  359|   			 size, config->bLength);
#  360|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
libusb-1.0.29/libusb/descriptor.c:362:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  360|   		return LIBUSB_ERROR_IO;
#  361|   	} else if (config->bNumInterfaces > USB_MAXINTERFACES) {
#  362|-> 		usbi_err(ctx, "too many interfaces (%u)", config->bNumInterfaces);
#  363|   		return LIBUSB_ERROR_IO;
#  364|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
libusb-1.0.29/libusb/descriptor.c:384:33: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  382|   			header = (const struct usbi_descriptor_header *)buffer;
#  383|   			if (header->bLength < DESC_HEADER_LENGTH) {
#  384|-> 				usbi_err(ctx,
#  385|   					 "invalid extra config desc len (%u)",
#  386|   					 header->bLength);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
libusb-1.0.29/libusb/descriptor.c:384:33: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  382|   			header = (const struct usbi_descriptor_header *)buffer;
#  383|   			if (header->bLength < DESC_HEADER_LENGTH) {
#  384|-> 				usbi_err(ctx,
#  385|   					 "invalid extra config desc len (%u)",
#  386|   					 header->bLength);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
libusb-1.0.29/libusb/descriptor.c:390:33: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  388|   				goto err;
#  389|   			} else if (header->bLength > size) {
#  390|-> 				usbi_warn(ctx,
#  391|   					  "short extra config desc read %d/%u",
#  392|   					  size, header->bLength);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
libusb-1.0.29/libusb/descriptor.c:390:33: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  388|   				goto err;
#  389|   			} else if (header->bLength > size) {
#  390|-> 				usbi_warn(ctx,
#  391|   					  "short extra config desc read %d/%u",
#  392|   					  size, header->bLength);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
libusb-1.0.29/libusb/descriptor.c:404:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  402|   				break;
#  403|   
#  404|-> 			usbi_dbg(ctx, "skipping descriptor 0x%x", header->bDescriptorType);
#  405|   			buffer += header->bLength;
#  406|   			size -= header->bLength;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
libusb-1.0.29/libusb/descriptor.c:404:25: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  402|   				break;
#  403|   
#  404|-> 			usbi_dbg(ctx, "skipping descriptor 0x%x", header->bDescriptorType);
#  405|   			buffer += header->bLength;
#  406|   			size -= header->bLength;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
libusb-1.0.29/libusb/descriptor.c:470:17: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libusb-1.0.29/libusb/descriptor.c:1513:18: enter_function: entry to 'libusb_get_active_interface_association_descriptors'
libusb-1.0.29/libusb/descriptor.c:1521:12: branch_false: following 'false' branch (when 'iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1524:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1525:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1528:41: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1529:15: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1530:12: branch_false: following 'false' branch (when 'buf' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1533:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1533:13: call_function: calling 'get_active_config_descriptor' from 'libusb_get_active_interface_association_descriptors'
#  468|   	uint8_t *buffer, size_t size)
#  469|   {
#  470|-> 	int r = usbi_backend.get_active_config_descriptor(dev, buffer, size);
#  471|   
#  472|   	if (r < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
libusb-1.0.29/libusb/descriptor.c:490:17: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libusb-1.0.29/libusb/descriptor.c:1464:18: enter_function: entry to 'libusb_get_interface_association_descriptors'
libusb-1.0.29/libusb/descriptor.c:1472:12: branch_false: following 'false' branch (when 'iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1475:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1476:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1479:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1480:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1483:41: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1484:15: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1485:12: branch_false: following 'false' branch (when 'buf' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1488:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1488:13: call_function: calling 'get_config_descriptor' from 'libusb_get_interface_association_descriptors'
#  488|   	uint8_t *buffer, size_t size)
#  489|   {
#  490|-> 	int r = usbi_backend.get_config_descriptor(dev, config_idx, buffer, size);
#  491|   
#  492|   	if (r < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
libusb-1.0.29/libusb/descriptor.c:794:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: following 'true' branch (when 'size <= 2')...
libusb-1.0.29/libusb/descriptor.c:794:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:794:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/20)
#  792|   	for (i = 0; i < _bos->bNumDeviceCaps; i++) {
#  793|   		if (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  794|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%d",
#  795|   				  size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);
#  796|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
libusb-1.0.29/libusb/descriptor.c:794:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: following 'true' branch (when 'size <= 2')...
libusb-1.0.29/libusb/descriptor.c:794:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:794:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
#  792|   	for (i = 0; i < _bos->bNumDeviceCaps; i++) {
#  793|   		if (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  794|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%d",
#  795|   				  size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);
#  796|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
libusb-1.0.29/libusb/descriptor.c:800:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:800:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:800:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/20)
#  798|   		header = (const struct usbi_descriptor_header *)buffer;
#  799|   		if (header->bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {
#  800|-> 			usbi_warn(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#  801|   				  header->bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);
#  802|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
libusb-1.0.29/libusb/descriptor.c:800:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:800:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:800:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
#  798|   		header = (const struct usbi_descriptor_header *)buffer;
#  799|   		if (header->bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {
#  800|-> 			usbi_warn(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#  801|   				  header->bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);
#  802|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
libusb-1.0.29/libusb/descriptor.c:804:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:804:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:804:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/20)
#  802|   			break;
#  803|   		} else if (header->bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  804|-> 			usbi_err(ctx, "invalid dev-cap bLength (%u)",
#  805|   				 header->bLength);
#  806|   			libusb_free_bos_descriptor(_bos);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
libusb-1.0.29/libusb/descriptor.c:804:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:804:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:804:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
#  802|   			break;
#  803|   		} else if (header->bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  804|-> 			usbi_err(ctx, "invalid dev-cap bLength (%u)",
#  805|   				 header->bLength);
#  806|   			libusb_free_bos_descriptor(_bos);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
libusb-1.0.29/libusb/descriptor.c:809:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:809:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:809:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/20)
#  807|   			return LIBUSB_ERROR_IO;
#  808|   		} else if (header->bLength > size) {
#  809|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%u",
#  810|   				  size, header->bLength);
#  811|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
libusb-1.0.29/libusb/descriptor.c:809:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:809:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:809:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/8)
#  807|   			return LIBUSB_ERROR_IO;
#  808|   		} else if (header->bLength > size) {
#  809|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%u",
#  810|   				  size, header->bLength);
#  811|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
libusb-1.0.29/libusb/descriptor.c:1100:17: warning[-Wanalyzer-malloc-leak]: leak of '_ssplus_cap'
libusb-1.0.29/libusb/descriptor.c:1053:18: enter_function: entry to 'libusb_get_ssplus_usb_device_capability_descriptor'
libusb-1.0.29/libusb/descriptor.c:1064:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1069:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1069:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1080:41: call_function: inlined call to 'ReadLittleEndian32' from 'libusb_get_ssplus_usb_device_capability_descriptor'
libusb-1.0.29/libusb/descriptor.c:1085:23: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1086:12: branch_false: following 'false' branch (when '_ssplus_cap' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1090:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1099:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:1100:17: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:1100:17: danger: '_ssplus_cap' leaks here; was allocated at [(7)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/6)
# 1098|   	/* Check that we have enough to read all the sublink attributes */
# 1099|   	if (dev_cap->bLength < LIBUSB_BT_SSPLUS_USB_DEVICE_CAPABILITY_SIZE + _ssplus_cap->numSublinkSpeedAttributes * sizeof(uint32_t)) {
# 1100|-> 		usbi_err(ctx, "short ssplus capability descriptor, unable to read sublinks: Not enough data");
# 1101|   		return LIBUSB_ERROR_IO;
# 1102|   	}

Error: CPPCHECK_WARNING (CWE-401): [#def108]
libusb-1.0.29/libusb/descriptor.c:1101: error[memleak]: Memory leak: _ssplus_cap
# 1099|   	if (dev_cap->bLength < LIBUSB_BT_SSPLUS_USB_DEVICE_CAPABILITY_SIZE + _ssplus_cap->numSublinkSpeedAttributes * sizeof(uint32_t)) {
# 1100|   		usbi_err(ctx, "short ssplus capability descriptor, unable to read sublinks: Not enough data");
# 1101|-> 		return LIBUSB_ERROR_IO;
# 1102|   	}
# 1103|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
libusb-1.0.29/libusb/descriptor.c:1361:17: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
# 1359|   
# 1360|   	if (size < LIBUSB_DT_CONFIG_SIZE) {
# 1361|-> 		usbi_err(ctx, "short config descriptor read %d/%d",
# 1362|   			 size, LIBUSB_DT_CONFIG_SIZE);
# 1363|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
libusb-1.0.29/libusb/descriptor.c:1372:25: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
# 1370|   		header.bDescriptorType = buf[1];
# 1371|   		if (header.bLength < DESC_HEADER_LENGTH) {
# 1372|-> 			usbi_err(ctx, "invalid descriptor bLength %d",
# 1373|   				 header.bLength);
# 1374|   			return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
libusb-1.0.29/libusb/descriptor.c:1377:25: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
# 1375|   		}
# 1376|   		else if (header.bLength > size) {
# 1377|-> 			usbi_warn(ctx, "short config descriptor read %d/%u",
# 1378|   					  size, header.bLength);
# 1379|   			return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
libusb-1.0.29/libusb/descriptor.c:1436:17: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1434:13: return_function: returning to 'raw_desc_to_iad_array' from 'parse_iad_array'
libusb-1.0.29/libusb/descriptor.c:1435:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:1436:17: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:1436:17: danger: '_iad_array' leaks here; was allocated at [(2)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/1)
# 1434|   	r = parse_iad_array(ctx, _iad_array, buf, size);
# 1435|   	if (r < 0) {
# 1436|-> 		usbi_err(ctx, "parse_iad_array failed with error %d", r);
# 1437|   		free(_iad_array);
# 1438|   		return r;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def113]
libusb-1.0.29/libusb/hotplug.c:389:30: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/hotplug.c:342:18: enter_function: entry to 'libusb_hotplug_register_callback'
libusb-1.0.29/libusb/hotplug.c:351:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:354:13: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:355:13: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch (when 'cb_fn' is non-NULL)...
libusb-1.0.29/libusb/hotplug.c:361:14: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:361:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:364:15: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:364:15: call_function: calling 'usbi_get_context' from 'libusb_hotplug_register_callback'
libusb-1.0.29/libusb/hotplug.c:364:15: return_function: returning to 'libusb_hotplug_register_callback' from 'usbi_get_context'
libusb-1.0.29/libusb/hotplug.c:367:12: branch_false: following 'false' branch (when 'hotplug_cb' is non-NULL)...
libusb-1.0.29/libusb/hotplug.c:370:29: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:371:12: branch_false: following 'false' branch (when 'vendor_id == -1')...
libusb-1.0.29/libusb/hotplug.c:375:12: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:375:12: branch_false: following 'false' branch (when 'product_id == -1')...
libusb-1.0.29/libusb/hotplug.c:379:12: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:379:12: branch_false: following 'false' branch (when 'dev_class == -1')...
libusb-1.0.29/libusb/hotplug.c:383:9: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:386:9: call_function: calling 'usbi_mutex_lock' from 'libusb_hotplug_register_callback'
libusb-1.0.29/libusb/hotplug.c:386:9: return_function: returning to 'libusb_hotplug_register_callback' from 'usbi_mutex_lock'
libusb-1.0.29/libusb/hotplug.c:389:30: danger: dereference of NULL 'usbi_get_context(ctx)'
#  387|   
#  388|   	/* protect the handle by the context hotplug lock */
#  389|-> 	hotplug_cb->handle = ctx->next_hotplug_cb_handle++;
#  390|   
#  391|   	/* handle the unlikely case of overflow */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def114]
libusb-1.0.29/libusb/hotplug.c:456:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/hotplug.c:427:19: enter_function: entry to 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:439:15: call_function: calling 'usbi_get_context' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:439:15: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_get_context'
libusb-1.0.29/libusb/hotplug.c:441:9: call_function: calling 'usbi_mutex_lock' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:441:9: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_mutex_lock'
libusb-1.0.29/libusb/hotplug.c:442:9: branch_true: following 'true' branch...
libusb-1.0.29/libusb/hotplug.c:443:40: branch_true: ...to here
libusb-1.0.29/libusb/hotplug.c:450:9: call_function: calling 'usbi_mutex_unlock' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:450:9: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_mutex_unlock'
libusb-1.0.29/libusb/hotplug.c:452:12: branch_true: following 'true' branch (when 'deregistered != 0')...
libusb-1.0.29/libusb/hotplug.c:455:17: branch_true: ...to here
libusb-1.0.29/libusb/hotplug.c:455:17: call_function: calling 'usbi_mutex_lock' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:455:17: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_mutex_lock'
libusb-1.0.29/libusb/hotplug.c:456:17: danger: dereference of NULL 'usbi_get_context(ctx)'
#  454|   
#  455|   		usbi_mutex_lock(&ctx->event_data_lock);
#  456|-> 		event_flags = ctx->event_flags;
#  457|   		ctx->event_flags |= USBI_EVENT_HOTPLUG_CB_DEREGISTERED;
#  458|   		if (!event_flags)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def115]
libusb-1.0.29/libusb/io.c:2651:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/io.c:2645:19: enter_function: entry to 'libusb_set_pollfd_notifiers'
libusb-1.0.29/libusb/io.c:2650:15: call_function: calling 'usbi_get_context' from 'libusb_set_pollfd_notifiers'
libusb-1.0.29/libusb/io.c:2650:15: return_function: returning to 'libusb_set_pollfd_notifiers' from 'usbi_get_context'
libusb-1.0.29/libusb/io.c:2651:9: danger: dereference of NULL 'usbi_get_context(ctx)'
# 2649|   #if !defined(PLATFORM_WINDOWS)
# 2650|   	ctx = usbi_get_context(ctx);
# 2651|-> 	ctx->fd_added_cb = added_cb;
# 2652|   	ctx->fd_removed_cb = removed_cb;
# 2653|   	ctx->fd_cb_user_data = user_data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
libusb-1.0.29/libusb/io.c:2689:9: warning[-Wanalyzer-malloc-leak]: leak of 'ievent_source'
libusb-1.0.29/libusb/io.c:2684:51: acquire_memory: allocated here
libusb-1.0.29/libusb/io.c:2686:12: branch_false: following 'false' branch (when 'ievent_source' is non-NULL)...
libusb-1.0.29/libusb/io.c:2689:9: branch_false: ...to here
libusb-1.0.29/libusb/io.c:2689:9: danger: 'ievent_source' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 2687|   		return LIBUSB_ERROR_NO_MEM;
# 2688|   
# 2689|-> 	usbi_dbg(ctx, "add " USBI_OS_HANDLE_FORMAT_STRING " events %d", os_handle, poll_events);
# 2690|   	ievent_source->data.os_handle = os_handle;
# 2691|   	ievent_source->data.poll_events = poll_events;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def117]
libusb-1.0.29/libusb/io.c:2820:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dev_handle'
libusb-1.0.29/libusb/io.c:2816:38: branch_false: following 'false' branch (when 'dev_handle' is NULL)...
libusb-1.0.29/libusb/io.c:2820:9: branch_false: ...to here
libusb-1.0.29/libusb/io.c:2820:9: danger: dereference of NULL 'dev_handle'
# 2818|   	struct usbi_transfer *to_cancel;
# 2819|   
# 2820|-> 	usbi_dbg(ctx, "device %d.%d",
# 2821|   		dev_handle->dev->bus_number, dev_handle->dev->device_address);
# 2822|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
libusb-1.0.29/libusb/libusb.h:2174:16: warning[-Wanalyzer-malloc-leak]: leak of 'bos_data'
libusb-1.0.29/libusb/descriptor.c:840:18: enter_function: entry to 'libusb_get_bos_descriptor'
libusb-1.0.29/libusb/descriptor.c:847:38: branch_false: following 'false' branch (when 'dev_handle' is NULL)...
libusb-1.0.29/libusb/descriptor.c:851:13: call_function: inlined call to 'libusb_get_descriptor' from 'libusb_get_bos_descriptor'
libusb-1.0.29/libusb/descriptor.c:852:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:857:12: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:857:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:863:38: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:866:20: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:867:12: branch_false: following 'false' branch (when 'bos_data' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:870:13: call_function: inlined call to 'libusb_get_descriptor' from 'libusb_get_bos_descriptor'
# 2172|   	uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
# 2173|   {
# 2174|-> 	return libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN,
# 2175|   		LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index),
# 2176|   		0, data, (uint16_t) length, 1000);

Error: CPPCHECK_WARNING (CWE-476): [#def119]
libusb-1.0.29/libusb/libusbi.h:497: error[ctunullpointer]: Null pointer dereference: ctx
#  495|   static inline int usbi_handling_events(struct libusb_context *ctx)
#  496|   {
#  497|-> 	return usbi_tls_key_get(ctx->event_handling_key) != NULL;
#  498|   }
#  499|   

Error: CPPCHECK_WARNING (CWE-476): [#def120]
libusb-1.0.29/libusb/libusbi.h:497: warning[nullPointer]: Possible null pointer dereference: ctx
#  495|   static inline int usbi_handling_events(struct libusb_context *ctx)
#  496|   {
#  497|-> 	return usbi_tls_key_get(ctx->event_handling_key) != NULL;
#  498|   }
#  499|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
libusb-1.0.29/libusb/libusbi.h:497:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/sync.c:103:18: enter_function: entry to 'libusb_control_transfer'
libusb-1.0.29/libusb/sync.c:112:13: branch_false: following 'false' branch (when 'dev_handle' is NULL)...
libusb-1.0.29/libusb/sync.c:112:13: call_function: inlined call to 'usbi_handling_events' from 'libusb_control_transfer'
#  495|   static inline int usbi_handling_events(struct libusb_context *ctx)
#  496|   {
#  497|-> 	return usbi_tls_key_get(ctx->event_handling_key) != NULL;
#  498|   }
#  499|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def122]
libusb-1.0.29/libusb/os/events_posix.h:58:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/io.c:2573:18: enter_function: entry to 'libusb_get_next_timeout'
libusb-1.0.29/libusb/io.c:2580:15: call_function: calling 'usbi_get_context' from 'libusb_get_next_timeout'
libusb-1.0.29/libusb/io.c:2580:15: return_function: returning to 'libusb_get_next_timeout' from 'usbi_get_context'
libusb-1.0.29/libusb/io.c:2581:13: call_function: inlined call to 'usbi_using_timer' from 'libusb_get_next_timeout'
#   56|   static inline int usbi_timer_valid(usbi_timer_t *timer)
#   57|   {
#   58|-> 	return timer->timerfd >= 0;
#   59|   }
#   60|   #endif

Error: GCC_ANALYZER_WARNING (CWE-476): [#def123]
libusb-1.0.29/libusb/os/events_posix.h:58:16: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ctx'
libusb-1.0.29/libusb/io.c:2491:18: enter_function: entry to 'libusb_handle_events_locked'
libusb-1.0.29/libusb/io.c:2497:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/io.c:2500:15: call_function: calling 'usbi_get_context' from 'libusb_handle_events_locked'
libusb-1.0.29/libusb/io.c:2500:15: return_function: returning to 'libusb_handle_events_locked' from 'usbi_get_context'
libusb-1.0.29/libusb/io.c:2501:13: call_function: calling 'get_next_timeout' from 'libusb_handle_events_locked'
#   56|   static inline int usbi_timer_valid(usbi_timer_t *timer)
#   57|   {
#   58|-> 	return timer->timerfd >= 0;
#   59|   }
#   60|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
libusb-1.0.29/libusb/os/linux_usbfs.c:515:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_sysfs_attr(ctx,  sysfs_dir,  attr)'
libusb-1.0.29/libusb/os/linux_usbfs.c:1448:12: enter_function: entry to 'op_get_configuration'
libusb-1.0.29/libusb/os/linux_usbfs.c:1455:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:1456:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1456:21: call_function: calling 'sysfs_get_active_config' from 'op_get_configuration'
#  513|   		r = errno;
#  514|   		close(fd);
#  515|-> 		if (r == ENODEV)
#  516|   			return LIBUSB_ERROR_NO_DEVICE;
#  517|   		usbi_err(ctx, "attribute %s read failed, errno=%zd", attr, r);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
libusb-1.0.29/libusb/os/linux_usbfs.c:522:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_sysfs_attr(ctx,  sysfs_dir,  attr)'
libusb-1.0.29/libusb/os/linux_usbfs.c:1448:12: enter_function: entry to 'op_get_configuration'
libusb-1.0.29/libusb/os/linux_usbfs.c:1455:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:1456:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1456:21: call_function: calling 'sysfs_get_active_config' from 'op_get_configuration'
#  520|   	close(fd);
#  521|   
#  522|-> 	if (r == 0) {
#  523|   		/* Certain attributes (e.g. bConfigurationValue) are not
#  524|   		 * populated if the device is not configured. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
libusb-1.0.29/libusb/os/linux_usbfs.c:1997:21: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:1988:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:1989:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:1991:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1997:21: branch_false: following 'false' branch (when 'num_urbs <= i')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1997:21: danger: 'urbs' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1995|   	tpriv->reap_status = LIBUSB_TRANSFER_COMPLETED;
# 1996|   
# 1997|-> 	for (i = 0; i < num_urbs; i++) {
# 1998|   		struct usbfs_urb *urb = &urbs[i];
# 1999|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: following 'false' branch (when 'i >= num_urbs')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_false: following 'false' branch (when 'i >= num_urbs')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 2184|   
# 2185|   	/* submit URBs */
# 2186|-> 	for (i = 0; i < num_urbs; i++) {
# 2187|   		int r = ioctl(hpriv->fd, IOCTL_USBFS_SUBMITURB, urbs[i]);
# 2188|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 2193|   			r = LIBUSB_ERROR_NO_DEVICE;
# 2194|   		} else if (errno == EINVAL) {
# 2195|-> 			usbi_warn(TRANSFER_CTX(transfer), "submiturb failed, transfer too large");
# 2196|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2197|   		} else if (errno == EMSGSIZE) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 2196|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2197|   		} else if (errno == EMSGSIZE) {
# 2198|-> 			usbi_warn(TRANSFER_CTX(transfer), "submiturb failed, iso packet length too large");
# 2199|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2200|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
 branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 2199|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2200|   		} else {
# 2201|-> 			usbi_err(TRANSFER_CTX(transfer), "submiturb failed, errno=%d", errno);
# 2202|   			r = LIBUSB_ERROR_IO;
# 2203|   		}

Error: CPPCHECK_WARNING (CWE-562): [#def131]
libusb-1.0.29/tests/umockdev.c:603: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  601|   	struct libusb_transfer *transfer = NULL;
#  602|   
#  603|-> 	fixture->chat = chat;
#  604|   
#  605|   	/* Open */

Error: CPPCHECK_WARNING (CWE-562): [#def132]
libusb-1.0.29/tests/umockdev.c:650: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  648|   	struct libusb_transfer *transfer = NULL;
#  649|   
#  650|-> 	fixture->chat = chat;
#  651|   
#  652|   	/* Open */

Error: CPPCHECK_WARNING (CWE-562): [#def133]
libusb-1.0.29/tests/umockdev.c:696: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  694|   	struct libusb_transfer *transfer = NULL;
#  695|   
#  696|-> 	fixture->chat = chat;
#  697|   
#  698|   	/* Open */

Error: CPPCHECK_WARNING (CWE-562): [#def134]
libusb-1.0.29/tests/umockdev.c:778: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  776|   	};
#  777|   
#  778|-> 	fixture->chat = chat;
#  779|   
#  780|   	handle = libusb_open_device_with_vid_pid(fixture->ctx, 0x04a9, 0x31c0);

Error: CPPCHECK_WARNING (CWE-562): [#def135]
libusb-1.0.29/tests/umockdev.c:825: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  823|   	struct libusb_transfer *transfer = NULL;
#  824|   
#  825|-> 	fixture->chat = chat;
#  826|   
#  827|   	handle = libusb_open_device_with_vid_pid(fixture->ctx, 0x04a9, 0x31c0);

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
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-141.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-gcc-latest-x86_64
project-namelibusb1-1.0.29-4.fc44
store-results-to/tmp/tmpnjb5ozh3/libusb1-1.0.29-4.fc44.tar.xz
time-created2025-10-28 19:16:51
time-finished2025-10-28 19:18:47
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpnjb5ozh3/libusb1-1.0.29-4.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpnjb5ozh3/libusb1-1.0.29-4.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9