nvme-cli-2.15-2.fc43

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
nvme-cli-2.15/fabrics.c:675:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/usr/run/nvme")’
nvme-cli-2.15/fabrics.c:671:13: acquire_memory: allocated here
nvme-cli-2.15/fabrics.c:672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:672:12: branch_false: ...to here
nvme-cli-2.15/fabrics.c:675:23: throw: if ‘readdir’ throws an exception...
nvme-cli-2.15/fabrics.c:675:23: danger: ‘opendir("/usr/run/nvme")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  673|   		return -ENOTDIR;
#  674|   
#  675|-> 	while ((dir = readdir(d))) {
#  676|   		if (dir->d_type != DT_REG)
#  677|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
nvme-cli-2.15/nbft.c:59:23: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
nvme-cli-2.15/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.15/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   57|   	for (i = 0; i < count; i++) {
#   58|   		snprintf(filename, sizeof(filename), "%s/%s", path, dent[i]->d_name);
#   59|-> 		ret = nvme_nbft_read(&nbft, filename);
#   60|   		if (!ret) {
#   61|   			entry = calloc(1, sizeof(*entry));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
nvme-cli-2.15/nbft.c:61:33: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
nvme-cli-2.15/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.15/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   59|   		ret = nvme_nbft_read(&nbft, filename);
#   60|   		if (!ret) {
#   61|-> 			entry = calloc(1, sizeof(*entry));
#   62|   			entry->nbft = nbft;
#   63|   			list_add_tail(nbft_list, &entry->node);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
nvme-cli-2.15/nbft.c:62:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘entry’
nvme-cli-2.15/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.15/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   60|   		if (!ret) {
#   61|   			entry = calloc(1, sizeof(*entry));
#   62|-> 			entry->nbft = nbft;
#   63|   			list_add_tail(nbft_list, &entry->node);
#   64|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
nvme-cli-2.15/nbft.c:69:1: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
nvme-cli-2.15/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.15/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.15/nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   67|   	free(dent);
#   68|   	return 0;
#   69|-> }
#   70|   
#   71|   void free_nbfts(struct list_head *nbft_list)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
nvme-cli-2.15/nvme-models.c:251:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(where, 0)’
nvme-cli-2.15/nvme-models.c:244:14: acquire_resource: opened here
nvme-cli-2.15/nvme-models.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-models.c:251:15: branch_false: ...to here
nvme-cli-2.15/nvme-models.c:251:15: danger: ‘open(where, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  249|   	}
#  250|   	/* -1 so we can safely use strstr below */
#  251|-> 	len = read(fd, save, savesz - 1);
#  252|   	if (!len)
#  253|   		ret = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
nvme-cli-2.15/nvme-models.c:289:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘open_pci_ids()’
nvme-cli-2.15/nvme-models.c:298:7: enter_function: entry to ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: call_function: calling ‘open_pci_ids’ from ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: return_function: returning to ‘nvme_product_name’ from ‘open_pci_ids’
nvme-cli-2.15/nvme-models.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-models.c:314:9: branch_false: ...to here
nvme-cli-2.15/nvme-models.c:320:15: call_function: calling ‘read_sys_node’ from ‘nvme_product_name’
#  287|   
#  288|   	/* NO environment, check in predefined places */
#  289|-> 	for (i = 0; pci_ids[i] != NULL; i++) {
#  290|   		if ((fp = fopen(pci_ids[i], "r")) != NULL)
#  291|   			return fp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
nvme-cli-2.15/nvme-models.c:289:21: warning[-Wanalyzer-malloc-leak]: leak of ‘open_pci_ids()’
nvme-cli-2.15/nvme-models.c:298:7: enter_function: entry to ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: call_function: calling ‘open_pci_ids’ from ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: return_function: returning to ‘nvme_product_name’ from ‘open_pci_ids’
nvme-cli-2.15/nvme-models.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-models.c:314:9: branch_false: ...to here
nvme-cli-2.15/nvme-models.c:320:15: call_function: calling ‘read_sys_node’ from ‘nvme_product_name’
#  287|   
#  288|   	/* NO environment, check in predefined places */
#  289|-> 	for (i = 0; pci_ids[i] != NULL; i++) {
#  290|   		if ((fp = fopen(pci_ids[i], "r")) != NULL)
#  291|   			return fp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
nvme-cli-2.15/nvme-models.c:314:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘open_pci_ids()’
nvme-cli-2.15/nvme-models.c:298:7: enter_function: entry to ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: call_function: calling ‘open_pci_ids’ from ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: return_function: returning to ‘nvme_product_name’ from ‘open_pci_ids’
nvme-cli-2.15/nvme-models.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-models.c:314:9: branch_false: ...to here
nvme-cli-2.15/nvme-models.c:320:15: call_function: calling ‘read_sys_node’ from ‘nvme_product_name’
#  312|   		goto error1;
#  313|   
#  314|-> 	snprintf(fmt1, 78, _fmt1, id);
#  315|   	snprintf(fmt2, 78, _fmt2, id);
#  316|   	snprintf(fmt3, 78, _fmt3, id);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
nvme-cli-2.15/nvme-models.c:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘open_pci_ids()’
nvme-cli-2.15/nvme-models.c:298:7: enter_function: entry to ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: call_function: calling ‘open_pci_ids’ from ‘nvme_product_name’
nvme-cli-2.15/nvme-models.c:309:22: return_function: returning to ‘nvme_product_name’ from ‘open_pci_ids’
nvme-cli-2.15/nvme-models.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-models.c:314:9: branch_false: ...to here
nvme-cli-2.15/nvme-models.c:320:15: call_function: calling ‘read_sys_node’ from ‘nvme_product_name’
#  312|   		goto error1;
#  313|   
#  314|-> 	snprintf(fmt1, 78, _fmt1, id);
#  315|   	snprintf(fmt2, 78, _fmt2, id);
#  316|   	snprintf(fmt3, 78, _fmt3, id);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
nvme-cli-2.15/nvme-print-json.c:2162:18: warning[-Wanalyzer-malloc-leak]: leak of ‘printable’
nvme-cli-2.15/nvme-print-json.c:2123:14: enter_function: entry to ‘json_eom_printable_eye’
nvme-cli-2.15/nvme-print-json.c:2133:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2136:21: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2137:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2144:28: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2144:21: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:2147:12: branch_false: following ‘false’ branch (when ‘printable’ is non-NULL)...
nvme-cli-2.15/nvme-print-json.c:2147:12: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2150:25: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2151:36: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2153:20: branch_false: following ‘false’ branch (when ‘row’ is non-NULL)...
nvme-cli-2.15/nvme-print-json.c:2153:20: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2156:33: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2162:18: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2165:17: call_function: calling ‘json_array_add_value_string’ from ‘json_eom_printable_eye’
# 2160|   		}
# 2161|   
# 2162|-> 		*printable++ = '\n';
# 2163|   		row[ncols] = '\0';
# 2164|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
nvme-cli-2.15/nvme-print-json.c:2171:9: warning[-Wanalyzer-malloc-leak]: leak of ‘printable’
nvme-cli-2.15/nvme-print-json.c:2183:13: enter_function: entry to ‘json_phy_rx_eom_descs’
nvme-cli-2.15/nvme-print-json.c:2193:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2202:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2221:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2224:20: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2224:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2224:20: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2193:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2202:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2222:45: call_function: calling ‘json_eom_printable_eye’ from ‘json_phy_rx_eom_descs’
# 2169|   	*printable = '\0';
# 2170|   
# 2171|-> 	obj_add_array(r, "printable_eye", eye_array);
# 2172|   
# 2173|   	return printable_start;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
nvme-cli-2.15/nvme-print-json.c:2187:42: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)*log.nd * 8)’
nvme-cli-2.15/nvme-print-json.c:2254:13: enter_function: entry to ‘json_phy_rx_eom_log’
nvme-cli-2.15/nvme-print-json.c:2280:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2282:41: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2282:34: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:2283:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2284:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2284:25: call_function: calling ‘json_phy_rx_eom_descs’ from ‘json_phy_rx_eom_log’
nvme-cli-2.15/nvme-print-json.c:2187:42: danger: ‘malloc((long unsigned int)*log.nd * 8)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/3)
# 2185|   {
# 2186|   	void *p = log->descs;
# 2187|-> 	uint16_t num_descs = le16_to_cpu(log->nd);
# 2188|   	int i;
# 2189|   	struct json_object *descs = json_create_array();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
nvme-cli-2.15/nvme-print-json.c:2236:32: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)((int)*(struct nvme_eom_lane_desc *)p.edlen * 3 + 1))’
nvme-cli-2.15/nvme-print-json.c:2183:13: enter_function: entry to ‘json_phy_rx_eom_descs’
nvme-cli-2.15/nvme-print-json.c:2193:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2202:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2221:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2224:20: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2228:26: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:2230:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2236:32: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2241:38: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2242:68: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2241:38: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2242:68: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2246:17: call_function: calling ‘json_object_add_value_string’ from ‘json_phy_rx_eom_descs’
nvme-cli-2.15/nvme-print-json.c:2236:32: danger: ‘malloc((long unsigned int)((int)*(struct nvme_eom_lane_desc *)p.edlen * 3 + 1))’ leaks here; was allocated at [(6)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/5)
# 2234|   
# 2235|   		/* Hex dump Vendor Specific Eye Data */
# 2236|-> 		vsdataoffset = (nrows * ncols) + sizeof(struct nvme_eom_lane_desc);
# 2237|   		vsdata = (unsigned char *)((unsigned char *)desc + vsdataoffset);
# 2238|   

Error: GCC_ANALYZER_WARNING (CWE-124): [#def15]
nvme-cli-2.15/nvme-print-json.c:2244:17: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite
nvme-cli-2.15/nvme-print-json.c:2193:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2202:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2221:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2224:20: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2230:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2236:32: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2241:38: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2244:17: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2244:17: danger: out-of-bounds write at byte -1 but region starts at byte 0
# 2242|   			hexdata += sprintf(hexdata, "%02X ", vsdata[offset]);
# 2243|   		/* remove trailing space */
# 2244|-> 		*(hexdata - 1) = '\0';
# 2245|   
# 2246|   		obj_add_str(jdesc, "vsdata_hex", hexstr);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def16]
nvme-cli-2.15/nvme-print-json.c:2290:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
nvme-cli-2.15/nvme-print-json.c:2280:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2282:41: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2283:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2284:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2288:29: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2290:44: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2290:25: danger: use of uninitialized value ‘*<unknown>’ here
# 2288|   		for (i = 0; i < log->nd; i++) {
# 2289|   			/* Free any Printable Eye strings allocated */
# 2290|-> 			free(allocated_eyes[i]);
# 2291|   		}
# 2292|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
nvme-cli-2.15/nvme-print-stdout.c:4208:17: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
nvme-cli-2.15/nvme-print-stdout.c:4217:13: enter_function: entry to ‘stdout_effects_log_segment’
nvme-cli-2.15/nvme-print-stdout.c:4225:18: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-stdout.c:4226:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
nvme-cli-2.15/nvme-print-stdout.c:4226:12: branch_false: ...to here
nvme-cli-2.15/nvme-print-stdout.c:4231:25: branch_true: following ‘true’ branch (when ‘i < b’)...
nvme-cli-2.15/nvme-print-stdout.c:4232:20: branch_true: ...to here
nvme-cli-2.15/nvme-print-stdout.c:4232:20: branch_true: following ‘true’ branch (when ‘admin != 0’)...
nvme-cli-2.15/nvme-print-stdout.c:4233:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-stdout.c:4233:25: call_function: calling ‘stdout_effects_entry’ from ‘stdout_effects_log_segment’
# 4206|   	effect = le32_to_cpu(entry);
# 4207|   	if (effect & NVME_CMD_EFFECTS_CSUPP) {
# 4208|-> 		fprintf(stream, format_string, index, nvme_cmd_to_string(admin, index),
# 4209|   		       effect);
# 4210|   		if (human)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def18]
nvme-cli-2.15/nvme-print.c:37:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1590:6: enter_function: entry to ‘nvme_show_key_value’
nvme-cli-2.15/nvme-print.c:1592:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_key_value’
nvme-cli-2.15/nvme-print.c:1592:33: return_function: returning to ‘nvme_show_key_value’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1595:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1597:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print.c:1598:23: call_function: inlined call to ‘nvme_print_ops’ from ‘nvme_show_key_value’
#   35|   
#   36|   	if (flags & JSON || nvme_is_output_format_json())
#   37|-> 		ops = nvme_get_json_print_ops(flags);
#   38|   	else if (flags & BINARY)
#   39|   		ops = nvme_get_binary_print_ops(flags);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def19]
nvme-cli-2.15/nvme-print.c:529:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:522:6: enter_function: entry to ‘nvme_show_error_status’
nvme-cli-2.15/nvme-print.c:524:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_error_status’
nvme-cli-2.15/nvme-print.c:524:33: return_function: returning to ‘nvme_show_error_status’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:527:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:529:13: throw: if ‘nvme_is_output_format_json’ throws an exception...
nvme-cli-2.15/nvme-print.c:529:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  527|   	va_start(ap, msg);
#  528|   
#  529|-> 	if (nvme_is_output_format_json())
#  530|   		ops = nvme_print_ops(JSON);
#  531|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def20]
nvme-cli-2.15/nvme-print.c:533:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:522:6: enter_function: entry to ‘nvme_show_error_status’
nvme-cli-2.15/nvme-print.c:524:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_error_status’
nvme-cli-2.15/nvme-print.c:524:33: return_function: returning to ‘nvme_show_error_status’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:527:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:532:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print.c:533:17: throw: if the called function throws an exception...
nvme-cli-2.15/nvme-print.c:533:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  531|   
#  532|   	if (ops && ops->show_status)
#  533|-> 		ops->show_error_status(status, msg, ap);
#  534|   
#  535|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def21]
nvme-cli-2.15/nvme-print.c:1565:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1558:6: enter_function: entry to ‘nvme_show_message’
nvme-cli-2.15/nvme-print.c:1560:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_message’
nvme-cli-2.15/nvme-print.c:1560:33: return_function: returning to ‘nvme_show_message’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1563:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1565:13: throw: if ‘nvme_is_output_format_json’ throws an exception...
nvme-cli-2.15/nvme-print.c:1565:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1563|   	va_start(ap, msg);
# 1564|   
# 1565|-> 	if (nvme_is_output_format_json())
# 1566|   		ops = nvme_print_ops(JSON);
# 1567|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def22]
nvme-cli-2.15/nvme-print.c:1569:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1558:6: enter_function: entry to ‘nvme_show_message’
nvme-cli-2.15/nvme-print.c:1560:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_message’
nvme-cli-2.15/nvme-print.c:1560:33: return_function: returning to ‘nvme_show_message’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1563:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1568:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print.c:1569:17: throw: if the called function throws an exception...
nvme-cli-2.15/nvme-print.c:1569:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 1567|   
# 1568|   	if (ops && ops->show_message)
# 1569|-> 		ops->show_message(error, msg, ap);
# 1570|   
# 1571|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def23]
nvme-cli-2.15/nvme-print.c:1581:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1574:6: enter_function: entry to ‘nvme_show_perror’
nvme-cli-2.15/nvme-print.c:1576:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_perror’
nvme-cli-2.15/nvme-print.c:1576:33: return_function: returning to ‘nvme_show_perror’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1579:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1581:13: throw: if ‘nvme_is_output_format_json’ throws an exception...
nvme-cli-2.15/nvme-print.c:1581:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
# 1579|   	va_start(ap, msg);
# 1580|   
# 1581|-> 	if (nvme_is_output_format_json())
# 1582|   		ops = nvme_print_ops(JSON);
# 1583|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def24]
nvme-cli-2.15/nvme-print.c:1585:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1574:6: enter_function: entry to ‘nvme_show_perror’
nvme-cli-2.15/nvme-print.c:1576:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_perror’
nvme-cli-2.15/nvme-print.c:1576:33: return_function: returning to ‘nvme_show_perror’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1579:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1584:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print.c:1585:17: throw: if the called function throws an exception...
nvme-cli-2.15/nvme-print.c:1585:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
# 1583|   
# 1584|   	if (ops && ops->show_perror)
# 1585|-> 		ops->show_perror(msg, ap);
# 1586|   
# 1587|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def25]
nvme-cli-2.15/nvme-print.c:1597:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1590:6: enter_function: entry to ‘nvme_show_key_value’
nvme-cli-2.15/nvme-print.c:1592:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_key_value’
nvme-cli-2.15/nvme-print.c:1592:33: return_function: returning to ‘nvme_show_key_value’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1595:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1597:13: throw: if ‘nvme_is_output_format_json’ throws an exception...
nvme-cli-2.15/nvme-print.c:1597:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
# 1595|   	va_start(ap, val);
# 1596|   
# 1597|-> 	if (nvme_is_output_format_json())
# 1598|   		ops = nvme_print_ops(JSON);
# 1599|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def26]
nvme-cli-2.15/nvme-print.c:1601:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/nvme-print.c:1590:6: enter_function: entry to ‘nvme_show_key_value’
nvme-cli-2.15/nvme-print.c:1592:33: call_function: calling ‘nvme_print_ops’ from ‘nvme_show_key_value’
nvme-cli-2.15/nvme-print.c:1592:33: return_function: returning to ‘nvme_show_key_value’ from ‘nvme_print_ops’
nvme-cli-2.15/nvme-print.c:1595:9: acquire_resource: ‘va_start’ called here
nvme-cli-2.15/nvme-print.c:1600:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print.c:1601:17: throw: if the called function throws an exception...
nvme-cli-2.15/nvme-print.c:1601:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
# 1599|   
# 1600|   	if (ops && ops->show_key_value)
# 1601|-> 		ops->show_key_value(key, val, ap);
# 1602|   
# 1603|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
nvme-cli-2.15/nvme-rpmb.c:81:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#   79|       	infd = socket(AF_ALG, SOCK_SEQPACKET, 0);
#   80|   	if (infd < 0) {
#   81|-> 		perror("socket");
#   82|   		return hash;
#   83|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
nvme-cli-2.15/nvme-rpmb.c:81:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#   79|       	infd = socket(AF_ALG, SOCK_SEQPACKET, 0);
#   80|   	if (infd < 0) {
#   81|-> 		perror("socket");
#   82|   		return hash;
#   83|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
nvme-cli-2.15/nvme-rpmb.c:86:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#   84|       	error = bind(infd, (struct sockaddr *)&provider_sa, sizeof(provider_sa));
#   85|   	if (error < 0) {
#   86|-> 		perror("bind");
#   87|   		goto out_close_infd;
#   88|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
nvme-cli-2.15/nvme-rpmb.c:86:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#   84|       	error = bind(infd, (struct sockaddr *)&provider_sa, sizeof(provider_sa));
#   85|   	if (error < 0) {
#   86|-> 		perror("bind");
#   87|   		goto out_close_infd;
#   88|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
nvme-cli-2.15/nvme-rpmb.c:100:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#   98|   
#   99|       	/* now send data to hash */
#  100|->     	outfd = accept(infd, NULL, 0);
#  101|   	if (outfd < 0) {
#  102|   		perror("accept");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
nvme-cli-2.15/nvme-rpmb.c:100:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#   98|   
#   99|       	/* now send data to hash */
#  100|->     	outfd = accept(infd, NULL, 0);
#  101|   	if (outfd < 0) {
#  102|   		perror("accept");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
nvme-cli-2.15/nvme-rpmb.c:102:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  100|       	outfd = accept(infd, NULL, 0);
#  101|   	if (outfd < 0) {
#  102|-> 		perror("accept");
#  103|   		goto out_close_infd;
#  104|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
nvme-cli-2.15/nvme-rpmb.c:102:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#  100|       	outfd = accept(infd, NULL, 0);
#  101|   	if (outfd < 0) {
#  102|-> 		perror("accept");
#  103|   		goto out_close_infd;
#  104|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
nvme-cli-2.15/nvme-rpmb.c:105:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  103|   		goto out_close_infd;
#  104|   	}
#  105|->     	error = send(outfd, data, datalen, 0);
#  106|   	if (error < 0) {
#  107|   		perror("send");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
nvme-cli-2.15/nvme-rpmb.c:105:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#  103|   		goto out_close_infd;
#  104|   	}
#  105|->     	error = send(outfd, data, datalen, 0);
#  106|   	if (error < 0) {
#  107|   		perror("send");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
nvme-cli-2.15/nvme-rpmb.c:107:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  105|       	error = send(outfd, data, datalen, 0);
#  106|   	if (error < 0) {
#  107|-> 		perror("send");
#  108|   		goto out_close_outfd;
#  109|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
nvme-cli-2.15/nvme-rpmb.c:107:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#  105|       	error = send(outfd, data, datalen, 0);
#  106|   	if (error < 0) {
#  107|-> 		perror("send");
#  108|   		goto out_close_outfd;
#  109|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
nvme-cli-2.15/nvme-rpmb.c:114:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  112|       	hash = (unsigned char *)calloc(hash_size, 1);
#  113|   	if (hash == NULL) {
#  114|->         	perror("calloc");
#  115|   		goto out_close_outfd;
#  116|       	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
nvme-cli-2.15/nvme-rpmb.c:114:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#  112|       	hash = (unsigned char *)calloc(hash_size, 1);
#  113|   	if (hash == NULL) {
#  114|->         	perror("calloc");
#  115|   		goto out_close_outfd;
#  116|       	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
nvme-cli-2.15/nvme-rpmb.c:120:17: warning[-Wanalyzer-malloc-leak]: leak of ‘hash’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ from ‘rpmb_cmd_option’
#  118|       	error = read(outfd, hash, hash_size);
#  119|   	if (error != hash_size) {
#  120|->         	perror("read");
#  121|           	free(hash);
#  122|           	hash = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
nvme-cli-2.15/nvme-rpmb.c:120:17: warning[-Wanalyzer-malloc-leak]: leak of ‘req’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  118|       	error = read(outfd, hash, hash_size);
#  119|   	if (error != hash_size) {
#  120|->         	perror("read");
#  121|           	free(hash);
#  122|           	hash = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
nvme-cli-2.15/nvme-rpmb.c:120:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tbufp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#  118|       	error = read(outfd, hash, hash_size);
#  119|   	if (error != hash_size) {
#  120|->         	perror("read");
#  121|           	free(hash);
#  122|           	hash = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
nvme-cli-2.15/nvme-rpmb.c:125:9: warning[-Wanalyzer-malloc-leak]: leak of ‘hash’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  123|       	}
#  124|   out_close_outfd:
#  125|-> 	close(outfd);
#  126|   out_close_infd:
#  127|   	close(infd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
nvme-cli-2.15/nvme-rpmb.c:127:9: warning[-Wanalyzer-malloc-leak]: leak of ‘hash’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’
#  125|   	close(outfd);
#  126|   out_close_infd:
#  127|-> 	close(infd);
#  128|   
#  129|   	return hash;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
nvme-cli-2.15/nvme-rpmb.c:293:16: warning[-Wanalyzer-malloc-leak]: leak of ‘rsp’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1060:31: call_function: calling ‘rpmb_program_auth_key’ from ‘rpmb_cmd_option’
#  291|   	};
#  292|   
#  293|-> 	return nvme_security_send(&args);
#  294|   }
#  295|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
nvme-cli-2.15/nvme-rpmb.c:339:17: warning[-Wanalyzer-malloc-leak]: leak of ‘read_rpmb_key(cfg.key,  cfg.keyfile, & key_size)’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-rpmb.c:965:29: branch_true: ...to here
nvme-cli-2.15/nvme-rpmb.c:965:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:970:49: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:970:39: call_function: calling ‘read_file’ from ‘rpmb_cmd_option’
#  337|   		}
#  338|   	} else if ((keybuf = (unsigned char *)malloc(strlen(keystr))) != NULL) {
#  339|-> 		*keysize = strlen(keystr);
#  340|   		memcpy(keybuf, keystr, *keysize);
#  341|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
nvme-cli-2.15/nvme-rpmb.c:360:48: warning[-Wanalyzer-malloc-leak]: leak of ‘rpmb_request_init(256, 1, target, 0, 0, 0,  key_buf, 223 - (short unsigned int)key_size, (unsigned int)key_size)’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:980:17: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:1060:31: call_function: calling ‘rpmb_program_auth_key’ from ‘rpmb_cmd_option’
#  358|   	struct rpmb_data_frame_t *req = NULL;
#  359|   
#  360|-> 	if ((req = (struct rpmb_data_frame_t *)calloc(req_size, 1)) == NULL) {
#  361|   		fprintf(stderr, "Memory allocation failed for request 0x%04x\n",
#  362|   			type);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
nvme-cli-2.15/nvme-rpmb.c:360:48: warning[-Wanalyzer-malloc-leak]: leak of ‘rpmb_request_init(768, 6, 0, 0, 0, 1, cfg_buf, 256, 512)’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-rpmb.c:965:29: branch_true: ...to here
nvme-cli-2.15/nvme-rpmb.c:965:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:970:49: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:970:39: call_function: calling ‘read_file’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:970:39: return_function: returning to ‘rpmb_cmd_option’ from ‘read_file’
nvme-cli-2.15/nvme-rpmb.c:971:36: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:1055:31: call_function: calling ‘rpmb_write_config_block’ from ‘rpmb_cmd_option’
#  358|   	struct rpmb_data_frame_t *req = NULL;
#  359|   
#  360|-> 	if ((req = (struct rpmb_data_frame_t *)calloc(req_size, 1)) == NULL) {
#  361|   		fprintf(stderr, "Memory allocation failed for request 0x%04x\n",
#  362|   			type);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
nvme-cli-2.15/nvme-rpmb.c:579:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msg_buf’
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-rpmb.c:965:29: branch_true: ...to here
nvme-cli-2.15/nvme-rpmb.c:965:28: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-rpmb.c:966:44: branch_true: ...to here
nvme-cli-2.15/nvme-rpmb.c:967:60: acquire_memory: allocated here
nvme-cli-2.15/nvme-rpmb.c:1017:29: call_function: inlined call to ‘invalid_xfer_size’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:1022:31: call_function: calling ‘rpmb_auth_data_read’ from ‘rpmb_cmd_option’
#  577|   	}
#  578|   	
#  579|-> 	*msg_buf = bufp;
#  580|   	error = offset;
#  581|   out:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def51]
nvme-cli-2.15/nvme-rpmb.c:968:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘msg_buf’ where non-null expected
nvme-cli-2.15/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:913:15: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:917:34: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:924:13: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.15/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.15/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:957:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-rpmb.c:963:21: branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:963:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-rpmb.c:965:29: branch_true: ...to here
nvme-cli-2.15/nvme-rpmb.c:965:28: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-rpmb.c:966:44: branch_true: ...to here
nvme-cli-2.15/nvme-rpmb.c:967:60: acquire_memory: this call could return NULL
nvme-cli-2.15/nvme-rpmb.c:968:33: danger: argument 1 (‘malloc(strlen(cfg.msg) & 4294967295)’) from [(27)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/26) could be NULL where non-null expected
#  966|   				msg_size = strlen(cfg.msg);
#  967|   				msg_buf = (unsigned char *)malloc(msg_size);
#  968|-> 				memcpy(msg_buf, cfg.msg, msg_size);
#  969|   			} else {
#  970|   				err = read_file(cfg.msgfile, &msg_buf, &msg_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
nvme-cli-2.15/nvme.h:147:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
nvme-cli-2.15/plugins/lm/lm-nvme.c:421:12: enter_function: entry to ‘lm_migration_recv’
nvme-cli-2.15/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:503:22: acquire_memory: allocated here
nvme-cli-2.15/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:438:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_recv’
nvme-cli-2.15/plugins/lm/lm-nvme.c:437:45: call_function: inlined call to ‘cleanup_nvme_dev’ from ‘lm_migration_recv’
#  145|   void dev_close(struct nvme_dev *dev);
#  146|   
#  147|-> static inline DEFINE_CLEANUP_FUNC(
#  148|   	cleanup_nvme_dev, struct nvme_dev *, dev_close)
#  149|   #define _cleanup_nvme_dev_ __cleanup__(cleanup_nvme_dev)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
nvme-cli-2.15/plugins/feat/feat-nvme.c:207:59: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cfg.vs_data, 0)’
nvme-cli-2.15/plugins/feat/feat-nvme.c:200:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/feat/feat-nvme.c:201:31: acquire_resource: opened here
nvme-cli-2.15/plugins/feat/feat-nvme.c:202:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/feat/feat-nvme.c:207:59: branch_false: ...to here
nvme-cli-2.15/plugins/feat/feat-nvme.c:208:28: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/feat/feat-nvme.c:209:33: branch_true: ...to here
nvme-cli-2.15/plugins/feat/feat-nvme.c:209:33: throw: if ‘nvme_show_message’ throws an exception...
nvme-cli-2.15/plugins/feat/feat-nvme.c:207:59: danger: ‘open(*cfg.vs_data, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  205|   				return -EINVAL;
#  206|   			}
#  207|-> 			err = read(ffd, data.vs_perf->vs, data.vs_perf->attrl);
#  208|   			if (err < 0) {
#  209|   				nvme_show_error("failed to read data buffer from input file: %s",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
nvme-cli-2.15/plugins/feat/feat-nvme.c:211:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/feat/feat-nvme.c:169:12: enter_function: entry to ‘perfc_set’
nvme-cli-2.15/plugins/feat/feat-nvme.c:200:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/feat/feat-nvme.c:201:31: acquire_resource: opened here
nvme-cli-2.15/plugins/feat/feat-nvme.c:202:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/feat/feat-nvme.c:207:59: branch_false: ...to here
nvme-cli-2.15/plugins/feat/feat-nvme.c:175:26: call_function: inlined call to ‘cleanup_fd’ from ‘perfc_set’
nvme-cli-2.15/plugins/feat/feat-nvme.c:236:1: branch_false: ...to here
nvme-cli-2.15/plugins/feat/feat-nvme.c:211:40: danger: ‘ffd’ leaks here; was opened at [(6)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/5)
#  209|   				nvme_show_error("failed to read data buffer from input file: %s",
#  210|   						strerror(errno));
#  211|-> 				return -errno;
#  212|   			}
#  213|   		}

Error: GCC_ANALYZER_WARNING (CWE-126): [#def55]
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:96:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:293:12: enter_function: entry to ‘huawei_list’
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:317:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:320:38: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:321:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:324:13: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:325:12: branch_false: following ‘false’ branch (when ‘n != 0’)...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:328:22: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:329:12: branch_false: following ‘false’ branch (when ‘list_items’ is non-NULL)...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:329:12: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:335:21: branch_true: following ‘true’ branch (when ‘i < n’)...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:338:64: branch_true: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:345:23: call_function: calling ‘huawei_get_nvme_info’ from ‘huawei_list’
#   94|   		return err;
#   95|   
#   96|-> 	strncpy(item->node, node, sizeof(item->node));
#   97|   	item->node[sizeof(item->node) - 1] = '\0';
#   98|   	item->block = S_ISBLK(nvme_stat_info.st_mode);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:339:22: warning[-Wanalyzer-malloc-leak]: leak of ‘list_items’
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:317:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:320:38: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:321:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:324:13: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:325:12: branch_false: following ‘false’ branch (when ‘n != 0’)...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:328:22: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:328:22: acquire_memory: allocated here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:329:12: branch_false: following ‘false’ branch (when ‘list_items’ is non-NULL)...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:329:12: branch_false: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:335:21: branch_true: following ‘true’ branch (when ‘i < n’)...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:338:64: branch_true: ...to here
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:339:22: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:339:22: danger: ‘list_items’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  337|   
#  338|   		snprintf(path, sizeof(path), "/dev/%s", devices[i]->d_name);
#  339|-> 		fd = open(path, O_RDONLY);
#  340|   		if (fd < 0) {
#  341|   			fprintf(stderr, "Cannot open device %s: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:36:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:280:38: acquire_resource: opened here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_true: following ‘true’ branch (when ‘itotal == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:304:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:36:16: danger: ‘fp’ leaks here; was opened at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#   34|   	cmd.addr = (__u64)(__u64)(uintptr_t)data;
#   35|   	cmd.data_len = data_len;
#   36|-> 	return nvme_submit_admin_passthru(fd, &cmd, NULL);
#   37|   }
#   38|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:36:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_true: following ‘true’ branch (when ‘itotal == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:304:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:36:16: danger: ‘fp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
#   34|   	cmd.addr = (__u64)(__u64)(uintptr_t)data;
#   35|   	cmd.data_len = data_len;
#   36|-> 	return nvme_submit_admin_passthru(fd, &cmd, NULL);
#   37|   }
#   38|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def59]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:135:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: this call could return NULL
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: return_function: returning to ‘innogrit_geteventlog’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:208:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:209:23: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:209:23: call_function: calling ‘getvsc_eventlog’ from ‘innogrit_geteventlog’
#  133|   			printf("get eventlog by vsc command\n");
#  134|   			start_flag = 1;
#  135|-> 			fwrite(data, 1, 4096, fp);
#  136|   			rxlen += 4096;
#  137|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def60]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:169:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: this call could return NULL
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: return_function: returning to ‘innogrit_geteventlog’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:207:15: call_function: calling ‘getlogpage_eventlog’ from ‘innogrit_geteventlog’
#  167|   			return IG_ERROR;
#  168|   		}
#  169|-> 		fwrite(data, 1, 4096, fp);
#  170|   	}
#  171|   	printf("\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "a+")’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:205:14: acquire_resource: opened here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’
#  204|   
#  205|   	fp = fopen(filename, "a+");
#  206|-> 	getvsctype(dev);
#  207|   	ret = getlogpage_eventlog(dev, fp);
#  208|   	if (ret == IG_UNSUPPORT)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "a+")’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: allocated here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’
#  204|   
#  205|   	fp = fopen(filename, "a+");
#  206|-> 	getvsctype(dev);
#  207|   	ret = getlogpage_eventlog(dev, fp);
#  208|   	if (ret == IG_UNSUPPORT)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def63]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:311:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: this call could return NULL
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: following ‘false’ branch (when ‘itotal != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:308:16: branch_true: following ‘true’ branch (when ‘ipackcount > ipackindex’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:309:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:311:17: danger: argument 4 (‘fp’) from [(17)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/16) could be NULL where non-null expected
#  309|   		memset(data, 0, 4096);
#  310|   		strcpy((char *)data, "cdumpstart");
#  311|-> 		fwrite(data, 1, strlen((char *)data), fp);
#  312|   		for (icur = 0; icur < itotal; icur += 4096) {
#  313|   			memset(data, 0, 4096);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def64]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:377:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:280:38: acquire_resource: opened here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: following ‘false’ branch (when ‘itotal != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:308:16: branch_false: following ‘false’ branch (when ‘ipackcount <= ipackindex’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:376:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:377:9: throw: if ‘dev_close’ throws an exception...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:377:9: danger: ‘fp’ leaks here; was opened at [(17)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/16)
#  375|   
#  376|   	printf("\n");
#  377|-> 	dev_close(dev);
#  378|   	if (fp != NULL)
#  379|   		fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:377:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: following ‘false’ branch (when ‘itotal != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:308:16: branch_false: following ‘false’ branch (when ‘ipackcount <= ipackindex’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:376:9: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:377:9: throw: if ‘dev_close’ throws an exception...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:377:9: danger: ‘fp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/16)
#  375|   
#  376|   	printf("\n");
#  377|-> 	dev_close(dev);
#  378|   	if (fp != NULL)
#  379|   		fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1242:23: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
# 1240|   	dword_tfer = min(max_tfer, total_size);
# 1241|   	while (total_size > 0) {
# 1242|-> 		err = nvme_submit_admin_passthru(ioctl_fd, cmd, NULL);
# 1243|   		if (err) {
# 1244|   			fprintf(stderr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1252:31: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1430:23: call_function: calling ‘get_internal_log_old’ from ‘get_internal_log’
# 1250|   
# 1251|   		if (out_fd > 0) {
# 1252|-> 			err = write(out_fd, buf, cmd->data_len);
# 1253|   			if (err < 0) {
# 1254|   				perror("write failure");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1254:33: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1430:23: call_function: calling ‘get_internal_log_old’ from ‘get_internal_log’
# 1252|   			err = write(out_fd, buf, cmd->data_len);
# 1253|   			if (err < 0) {
# 1254|-> 				perror("write failure");
# 1255|   				goto out;
# 1256|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1271:13: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1434:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1435:21: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1440:23: call_function: inlined call to ‘write_header’ from ‘get_internal_log’
# 1269|   static int write_header(__u8 *buf, int fd, size_t amnt)
# 1270|   {
# 1271|-> 	if (write(fd, buf, amnt) < 0)
# 1272|   		return 1;
# 1273|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1324:15: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1430:23: call_function: calling ‘get_internal_log_old’ from ‘get_internal_log’
# 1322|   		intel->ver.major, intel->ver.minor, intel->header, intel->size);
# 1323|   
# 1324|-> 	err = write(output, buf, 0x1000);
# 1325|   	if (err < 0) {
# 1326|   		perror("write failure");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1326:17: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1430:23: call_function: calling ‘get_internal_log_old’ from ‘get_internal_log’
# 1324|   	err = write(output, buf, 0x1000);
# 1325|   	if (err < 0) {
# 1326|-> 		perror("write failure");
# 1327|   		goto out;
# 1328|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1390:15: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1390:15: throw: if ‘parse_and_open’ throws an exception...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1390:15: danger: ‘intel’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1388|   	};
# 1389|   
# 1390|-> 	err = parse_and_open(&dev, argc, argv, desc, opts);
# 1391|   	if (err) {
# 1392|   		free(intel);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1414:18: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1414:18: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1414:18: danger: ‘intel’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1412|   	cdlog.u.fields.selectNlog = cfg.lnum < 0 ? 0 : cfg.lnum;
# 1413|   
# 1414|-> 	output = open(cfg.file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
# 1415|   	if (output < 0) {
# 1416|   		err = output;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def74]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘intel’ where non-null expected
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: this call could return NULL
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: danger: argument 1 (‘intel’) from [(2)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/1) could be NULL where non-null expected
# 1422|   	if (err)
# 1423|   		goto out;
# 1424|-> 	memcpy(intel, buf, sizeof(*intel));
# 1425|   
# 1426|   	/* for 1.1 Fultondales will use old nlog, but current assert/event */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1442:25: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1434:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1435:21: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1440:23: call_function: inlined call to ‘write_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1442:25: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1442:25: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1442:25: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/1)
# 1440|   		err = write_header(buf, output, 0x1000);
# 1441|   		if (err) {
# 1442|-> 			perror("write failure");
# 1443|   			goto out;
# 1444|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1520:17: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1423:17: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1519:12: branch_true: following ‘true’ branch (when ‘err > 0’)...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1520:17: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1520:17: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1520:17: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/1)
# 1518|   out:
# 1519|   	if (err > 0) {
# 1520|-> 		nvme_show_status(err);
# 1521|   	} else if (err < 0) {
# 1522|   		perror("intel log");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1522:17: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1423:17: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1519:12: branch_false: following ‘false’ branch (when ‘err <= 0’)...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1521:19: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1521:19: branch_true: following ‘true’ branch (when ‘err != 0’)...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1522:17: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1522:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1522:17: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/1)
# 1520|   		nvme_show_status(err);
# 1521|   	} else if (err < 0) {
# 1522|-> 		perror("intel log");
# 1523|   		err = EIO;
# 1524|   	} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
nvme-cli-2.15/plugins/intel/intel-nvme.c:1526:9: warning[-Wanalyzer-malloc-leak]: leak of ‘intel’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1350:38: acquire_memory: allocated here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.15/plugins/intel/intel-nvme.c:1422:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1423:17: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1521:19: branch_true: following ‘true’ branch (when ‘err != 0’)...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1522:17: branch_true: ...to here
nvme-cli-2.15/plugins/intel/intel-nvme.c:1526:9: throw: if ‘close’ throws an exception...
nvme-cli-2.15/plugins/intel/intel-nvme.c:1526:9: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/1)
# 1524|   	} else
# 1525|   		printf("Successfully wrote log to %s\n", cfg.file);
# 1526|-> 	close(output);
# 1527|   out_free:
# 1528|   	free(intel);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def79]
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cfg.input, "r")’
nvme-cli-2.15/plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:373:24: acquire_resource: opened here
nvme-cli-2.15/plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:24: throw: if ‘nvme_alloc_huge’ throws an exception...
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: danger: ‘fopen(cfg.input, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  377|   		}
#  378|   
#  379|-> 		data = nvme_alloc_huge(cfg.numd << 2, &mh);
#  380|   		if (!data)
#  381|   			return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cfg.input, "r")’
nvme-cli-2.15/plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:373:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:24: throw: if ‘nvme_alloc_huge’ throws an exception...
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: danger: ‘fopen(cfg.input, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  377|   		}
#  378|   
#  379|-> 		data = nvme_alloc_huge(cfg.numd << 2, &mh);
#  380|   		if (!data)
#  381|   			return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def81]
nvme-cli-2.15/plugins/lm/lm-nvme.c:540:29: warning[-Wanalyzer-null-argument]: use of NULL ‘fd’ where non-null expected
nvme-cli-2.15/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:540:29: danger: argument 4 (‘fd’) NULL where non-null expected
#  538|   
#  539|   		if (cfg.output && strlen(cfg.output)) {
#  540|-> 			if (fwrite(data, 1, cfg.numd << 2, fd) != (cfg.numd << 2)) {
#  541|   				nvme_show_error("ERROR: %s: failed to write buffer to output file",
#  542|   						strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def82]
nvme-cli-2.15/plugins/lm/lm-nvme.c:540:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fd’ where non-null expected
nvme-cli-2.15/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:503:22: acquire_memory: this call could return NULL
nvme-cli-2.15/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:540:29: danger: argument 4 (‘fd’) from [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
#  538|   
#  539|   		if (cfg.output && strlen(cfg.output)) {
#  540|-> 			if (fwrite(data, 1, cfg.numd << 2, fd) != (cfg.numd << 2)) {
#  541|   				nvme_show_error("ERROR: %s: failed to write buffer to output file",
#  542|   						strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
nvme-cli-2.15/plugins/lm/lm-nvme.c:552:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
nvme-cli-2.15/plugins/lm/lm-nvme.c:421:12: enter_function: entry to ‘lm_migration_recv’
nvme-cli-2.15/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:503:22: acquire_memory: allocated here
nvme-cli-2.15/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:438:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_recv’
nvme-cli-2.15/plugins/lm/lm-nvme.c:437:45: call_function: inlined call to ‘cleanup_nvme_dev’ from ‘lm_migration_recv’
nvme-cli-2.15/plugins/lm/lm-nvme.c:552:1: danger: ‘fd’ leaks here; was allocated at [(8)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/7)
#  550|   
#  551|   	return 0;
#  552|-> }
#  553|   
#  554|   enum lm_controller_data_queue_feature_id {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:138:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:138:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:138:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  136|   
#  137|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_PROGRAM_FAIL, nm, raw);
#  138|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "program_fail_count", *nm, int48_to_long(raw));
#  139|   
#  140|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_ERASE_FAIL, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:141:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:141:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:141:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  139|   
#  140|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_ERASE_FAIL, nm, raw);
#  141|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "erase_fail_count", *nm, int48_to_long(raw));
#  142|   
#  143|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_WEARLEVELING_COUNT, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:148:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:148:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  146|   
#  147|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_E2E_DECTECTION_COUNT, nm, raw);
#  148|-> 	printf("%-31s: %3d%%       %"PRIu64"\n", "end_to_end_error_detection_count", *nm,
#  149|   	       int48_to_long(raw));
#  150|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:152:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:152:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:152:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  150|   
#  151|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_PCIE_CRC_ERR_COUNT, nm, raw);
#  152|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "crc_error_count", *nm, int48_to_long(raw));
#  153|   
#  154|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_MEDIA_WEAR, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:156:24: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:156:24: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:156:24: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  154|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_MEDIA_WEAR, nm, raw);
#  155|   	printf("%-32s: %3d%%       %.3f%%\n", "timed_workload_media_wear", *nm,
#  156|-> 	       ((float)int48_to_long(raw))/1000);
#  157|   
#  158|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_HOST_READ, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:159:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:159:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:159:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  157|   
#  158|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_HOST_READ, nm, raw);
#  159|-> 	printf("%-32s: %3d%%       %"PRIu64"%%\n", "timed_workload_host_reads", *nm,
#  160|   	       int48_to_long(raw));
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:163:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:163:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:163:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  161|   
#  162|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TIMED_WORKLOAD_TIMER, nm, raw);
#  163|-> 	printf("%-32s: %3d%%       %"PRIu64"%s\n", "timed_workload_timer", *nm,
#  164|   	       int48_to_long(raw), " min");
#  165|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:167:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:167:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:167:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  165|   
#  166|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_THERMAL_THROTTLE_STATUS, nm, raw);
#  167|-> 	printf("%-32s: %3d%%       %u%%%s%"PRIu64"\n", "thermal_throttle_status", *nm, *raw,
#  168|   	       ", cnt: ", int48_to_long(raw+1));
#  169|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:171:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:171:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:171:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  169|   
#  170|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_RETRY_BUFF_OVERFLOW_COUNT, nm, raw);
#  171|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "retry_buffer_overflow_count", *nm,
#  172|   	       int48_to_long(raw));
#  173|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:175:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:175:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:175:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  173|   
#  174|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_PLL_LOCK_LOSS_COUNT, nm, raw);
#  175|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "pll_lock_loss_count", *nm,
#  176|   	       int48_to_long(raw));
#  177|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:179:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:179:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:179:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  177|   
#  178|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TOTAL_WRITE, nm, raw);
#  179|-> 	printf("%-32s: %3d%%       %s%"PRIu64"\n", "nand_bytes_written", *nm, "sectors: ",
#  180|   	       int48_to_long(raw));
#  181|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:183:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:183:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:183:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  181|   
#  182|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_HOST_WRITE, nm, raw);
#  183|-> 	printf("%-32s: %3d%%       %s%"PRIu64"\n", "host_bytes_written", *nm, "sectors: ",
#  184|   	       int48_to_long(raw));
#  185|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:187:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:187:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:187:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  185|   
#  186|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_SYSTEM_AREA_LIFE_LEFT, nm, raw);
#  187|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "system_area_life_left", *nm,
#  188|   	       int48_to_long(raw));
#  189|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:191:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:191:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:191:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  189|   
#  190|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TOTAL_READ, nm, raw);
#  191|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "total_read", *nm, int48_to_long(raw));
#  192|   
#  193|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_TEMPT_SINCE_BORN, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:206:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:206:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:206:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  204|   
#  205|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_READ_FAIL, nm, raw);
#  206|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "read_fail_count", *nm, int48_to_long(raw));
#  207|   
#  208|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_THERMAL_THROTTLE_TIME, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:209:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:209:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:209:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  207|   
#  208|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_THERMAL_THROTTLE_TIME, nm, raw);
#  209|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "thermal_throttle_time", *nm, int48_to_long(raw));
#  210|   
#  211|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_FLASH_MEDIA_ERROR, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:212:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:122:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:128:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:133:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:212:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:212:9: danger: ‘raw’ leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  210|   
#  211|   	get_memblaze_new_smart_info(smart, RAISIN_SI_VD_FLASH_MEDIA_ERROR, nm, raw);
#  212|-> 	printf("%-32s: %3d%%       %"PRIu64"\n", "flash_media_error", *nm, int48_to_long(raw));
#  213|   
#  214|   	free(nm);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:330:17: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:218:13: enter_function: entry to ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: call_function: calling ‘compare_fw_version’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: return_function: returning to ‘show_memblaze_smart_log_old’ from ‘compare_fw_version’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:316:12: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:325:20: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:329:17: call_function: inlined call to ‘get_memblaze_new_smart_info’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:330:17: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:330:17: danger: ‘raw’ leaks here; was allocated at [(10)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/9)
#  328|   		}
#  329|   		get_memblaze_new_smart_info(s, PROGRAM_FAIL, nm, raw);
#  330|-> 		printf("%-32s                                : %3d%%       %"PRIu64"\n",
#  331|   		       "program_fail_count", *nm, int48_to_long(raw));
#  332|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:334:17: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:218:13: enter_function: entry to ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: call_function: calling ‘compare_fw_version’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: return_function: returning to ‘show_memblaze_smart_log_old’ from ‘compare_fw_version’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:316:12: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:325:20: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:329:17: call_function: inlined call to ‘get_memblaze_new_smart_info’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:334:17: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:334:17: danger: ‘raw’ leaks here; was allocated at [(10)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/9)
#  332|   
#  333|   		get_memblaze_new_smart_info(s, ERASE_FAIL, nm, raw);
#  334|-> 		printf("%-32s                                : %3d%%       %"PRIu64"\n",
#  335|   		       "erase_fail_count", *nm, int48_to_long(raw));
#  336|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:344:54: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:218:13: enter_function: entry to ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: call_function: calling ‘compare_fw_version’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: return_function: returning to ‘show_memblaze_smart_log_old’ from ‘compare_fw_version’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:316:12: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:325:20: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:329:17: call_function: inlined call to ‘get_memblaze_new_smart_info’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:344:54: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:344:54: danger: ‘raw’ leaks here; was allocated at [(10)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/9)
#  342|   		get_memblaze_new_smart_info(s, TOTAL_WRITE, nm, raw);
#  343|   		printf("%-32s                                : %3d%%       %"PRIu64"\n",
#  344|-> 		       "nand_bytes_written", *nm, 32*int48_to_long(raw));
#  345|   
#  346|   		get_memblaze_new_smart_info(s, HOST_WRITE, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:348:54: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:218:13: enter_function: entry to ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: call_function: calling ‘compare_fw_version’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:243:13: return_function: returning to ‘show_memblaze_smart_log_old’ from ‘compare_fw_version’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:316:12: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:319:29: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:325:20: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:329:17: call_function: inlined call to ‘get_memblaze_new_smart_info’ from ‘show_memblaze_smart_log_old’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:348:54: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:348:54: danger: ‘raw’ leaks here; was allocated at [(10)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/9)
#  346|   		get_memblaze_new_smart_info(s, HOST_WRITE, nm, raw);
#  347|   		printf("%-32s                                : %3d%%       %"PRIu64"\n",
#  348|-> 		       "host_bytes_written", *nm, 32*int48_to_long(raw));
#  349|   
#  350|   		free(nm);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def105]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:413:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:576:12: enter_function: entry to ‘mb_set_high_latency_log’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:607:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:610:13: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:610:13: call_function: calling ‘parse_params’ from ‘mb_set_high_latency_log’
#  411|   
#  412|   	return 0;
#  413|-> }
#  414|   
#  415|   static int mb_get_additional_smart_log(int argc, char **argv, struct command *cmd,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:754:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:734:12: enter_function: entry to ‘mb_high_latency_log_print’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:748:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:751:15: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:751:15: acquire_resource: opened here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:753:9: call_function: calling ‘glp_high_latency_show_bar’ from ‘mb_high_latency_log_print’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:753:9: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency_show_bar’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:757:22: call_function: calling ‘glp_high_latency’ from ‘mb_high_latency_log_print’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:757:22: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:757:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:759:23: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:761:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:762:25: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:762:25: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:754:15: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was opened at [(4)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/3)
#  752|   
#  753|   	glp_high_latency_show_bar(fdi, DO_PRINT_FLAG);
#  754|-> 	err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, sizeof(buf), &buf);
#  755|   
#  756|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:754:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:734:12: enter_function: entry to ‘mb_high_latency_log_print’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:748:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:751:15: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:751:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:753:9: call_function: calling ‘glp_high_latency_show_bar’ from ‘mb_high_latency_log_print’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:753:9: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency_show_bar’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:757:22: call_function: calling ‘glp_high_latency’ from ‘mb_high_latency_log_print’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:757:22: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:757:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:759:23: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:761:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:762:25: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:762:25: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:754:15: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/3)
#  752|   
#  753|   	glp_high_latency_show_bar(fdi, DO_PRINT_FLAG);
#  754|-> 	err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, sizeof(buf), &buf);
#  755|   
#  756|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def108]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:927:9: warning[-Wanalyzer-null-argument]: use of NULL ‘fd’ where non-null expected
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:932:5: enter_function: entry to ‘io_latency_histogram’
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:934:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:943:9: release_memory: assuming ‘fopen(file, "w+")’ is NULL
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:943:9: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:943:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:944:9: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:944:9: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:947:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:948:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:948:17: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:949:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:949:17: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:950:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:950:17: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:954:29: branch_true: following ‘true’ branch (when ‘i != 32’)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:955:28: branch_true: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:955:28: branch_false: following ‘false’ branch (when ‘i != 31’)...
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:960:78: branch_false: ...to here
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:960:33: call_function: calling ‘ioLatencyHistogramOutput’ from ‘io_latency_histogram’
#  925|   	len = snprintf(string, sizeof(string), "%-11d %-11s %-11s %-11u\n",
#  926|   		       index, subString0, subString1, pHistogram[index]);
#  927|-> 	fwrite(string, 1, len, fd);
#  928|   	if (print)
#  929|   		printf("%s", string);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
nvme-cli-2.15/plugins/micron/micron-nvme.c:142:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(file, 0)’
nvme-cli-2.15/plugins/micron/micron-nvme.c:134:18: acquire_resource: opened here
nvme-cli-2.15/plugins/micron/micron-nvme.c:136:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/micron/micron-nvme.c:141:15: branch_false: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:142:9: danger: ‘open(file, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  140|   
#  141|   	ret = read(fd, idstr, sizeof(idstr));
#  142|-> 	close(fd);
#  143|   	if (ret < 0)
#  144|   		perror("read");

Error: GCC_ANALYZER_WARNING (CWE-131): [#def110]
nvme-cli-2.15/plugins/micron/micron-nvme.c:488:35: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#  486|   	int err = 0;
#  487|   
#  488|-> 	pBuffer = (unsigned int *)calloc(1, nBufferSize);
#  489|   	if (!pBuffer)
#  490|   		return err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
nvme-cli-2.15/plugins/micron/micron-nvme.c:3505:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
nvme-cli-2.15/plugins/micron/micron-nvme.c:3515:12: enter_function: entry to ‘get_common_log’
nvme-cli-2.15/plugins/micron/micron-nvme.c:3524:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/micron/micron-nvme.c:3529:13: branch_false: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:3529:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/micron/micron-nvme.c:3542:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/micron/micron-nvme.c:3550:19: branch_false: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:3550:19: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/micron/micron-nvme.c:3551:58: branch_true: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:3551:37: acquire_memory: allocated here
nvme-cli-2.15/plugins/micron/micron-nvme.c:3552:20: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
nvme-cli-2.15/plugins/micron/micron-nvme.c:3557:17: branch_false: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:3558:23: call_function: calling ‘nvme_get_log_lpo’ from ‘get_common_log’
# 3503|   		args.log = ptr;
# 3504|   		args.len = xfer_len;
# 3505|-> 		ret = nvme_get_log(&args);
# 3506|   		if (ret)
# 3507|   			return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:958:22: warning[-Wanalyzer-malloc-leak]: leak of ‘smdevices’
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:914:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:917:15: branch_false: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:924:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:929:13: branch_false: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:949:21: acquire_memory: allocated here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:950:12: branch_false: following ‘false’ branch (when ‘smdevices’ is non-NULL)...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:950:12: branch_false: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:955:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:957:32: branch_true: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:958:22: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:958:22: danger: ‘smdevices’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  956|   		snprintf(path, sizeof(path), "%s%s", dev_path,
#  957|   			devices[i]->d_name);
#  958|-> 		fd = open(path, O_RDONLY);
#  959|   		if (fd < 0) {
#  960|   			fprintf(stderr, "Unable to open %s: %s\n", path,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1064:22: warning[-Wanalyzer-malloc-leak]: leak of ‘ontapdevices’
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1020:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1023:15: branch_false: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1050:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1055:24: branch_false: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1055:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1056:12: branch_false: following ‘false’ branch (when ‘ontapdevices’ is non-NULL)...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1056:12: branch_false: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1061:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1063:40: branch_true: ...to here
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1064:22: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/netapp/netapp-nvme.c:1064:22: danger: ‘ontapdevices’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 1062|   		snprintf(path, sizeof(path), "%s%s", dev_path,
# 1063|   				devices[i]->d_name);
# 1064|-> 		fd = open(path, O_RDONLY);
# 1065|   		if (fd < 0) {
# 1066|   			fprintf(stderr, "Unable to open %s: %s\n", path,

Error: GCC_ANALYZER_WARNING: [#def114]
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:219:21: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:193:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:199:33: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:210:12: branch_false: following ‘false’ branch (when ‘log_bytes > 6.4e+1l’)...
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:215:20: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:219:21: danger: at least one operand of the size argument is of a floating-point type
#  217|   	print_info("args.len: %u\n", args.len);
#  218|   
#  219|-> 	log->desc = calloc(1, args.len);
#  220|   	if (!log->desc) {
#  221|   		fprintf(stderr, "error: ocp: calloc: %s\n", strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:231:15: warning[-Wanalyzer-malloc-leak]: leak of ‘log.desc’
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:243:12: enter_function: entry to ‘get_hwcomp_log’
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:252:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:257:15: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-hardware-component-log.c:257:15: call_function: calling ‘get_hwcomp_log_data’ from ‘get_hwcomp_log’
#  229|   	memcpy(log->desc, &hwcomp_dummy[desc_offset], args.len);
#  230|   #else /* HWCOMP_DUMMY */
#  231|-> 	ret = nvme_get_log_page(dev_fd(dev), NVME_LOG_PAGE_PDU_SIZE, &args);
#  232|   	if (ret) {
#  233|   		print_info_error("error: ocp: failed to get log page (hwcomp: %02X, ret: %d)\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:220:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:208:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:213:16: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:213:16: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:214:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:218:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:220:15: throw: if ‘ocp_get_log_simple’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:220:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  218|   	memset(data, 0, sizeof(__u8) * C3_LATENCY_MON_LOG_BUF_LEN);
#  219|   
#  220|-> 	ret = ocp_get_log_simple(dev, OCP_LID_LMLOG, C3_LATENCY_MON_LOG_BUF_LEN, data);
#  221|   
#  222|   	if (strcmp(format, "json"))

Error: GCC_ANALYZER_WARNING (CWE-688): [#def117]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:887:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:870:22: acquire_memory: this call could return NULL
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:886:21: branch_true: following ‘true’ branch (when ‘i < total_loop_cnt’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:887:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:887:17: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#  885|   
#  886|   	for (i = 0; i < total_loop_cnt; i++) {
#  887|-> 		memset(data, 0, transfersize);
#  888|   
#  889|   		struct nvme_get_log_args args = {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:906:23: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:864:12: enter_function: entry to ‘extract_dump_get_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:870:22: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:886:21: branch_true: following ‘true’ branch (when ‘i < total_loop_cnt’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:887:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:894:31: call_function: inlined call to ‘__dev_fd’ from ‘extract_dump_get_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:906:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:906:23: danger: ‘data’ leaks here; was allocated at [(2)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/1)
#  904|   		};
#  905|   
#  906|-> 		err = nvme_get_log(&args);
#  907|   		if (err) {
#  908|   			if (i > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:938:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:870:22: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:886:21: branch_false: following ‘false’ branch (when ‘i >= total_loop_cnt’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:935:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:938:9: throw: if ‘close’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:938:9: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  936|   
#  937|   close_output:
#  938|-> 	close(output);
#  939|   
#  940|   end:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘hdr’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1255:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: danger: ‘hdr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1264|   
# 1265|   	sprintf(file_path, DEFAULT_TELEMETRY_BIN);
# 1266|-> 	fd = open(file_path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
# 1267|   	if (fd < 0) {
# 1268|   		fprintf(stderr, "Failed to open output file %s: %s!\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1264|   
# 1265|   	sprintf(file_path, DEFAULT_TELEMETRY_BIN);
# 1266|-> 	fd = open(file_path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
# 1267|   	if (fd < 0) {
# 1268|   		fprintf(stderr, "Failed to open output file %s: %s!\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1292:15: warning[-Wanalyzer-malloc-leak]: leak of ‘hdr’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1255:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1292:15: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1292:15: danger: ‘hdr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1290|   	};
# 1291|   
# 1292|-> 	err = nvme_get_log(&args);
# 1293|   	if (err < 0)
# 1294|   		nvme_show_error("Failed to fetch the log from drive.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1292:15: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1292:15: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1292:15: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 1290|   	};
# 1291|   
# 1292|-> 	err = nvme_get_log(&args);
# 1293|   	if (err < 0)
# 1294|   		nvme_show_error("Failed to fetch the log from drive.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1294:17: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1293:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1294:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1294:17: throw: if ‘nvme_show_message’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1294:17: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 1292|   	err = nvme_get_log(&args);
# 1293|   	if (err < 0)
# 1294|-> 		nvme_show_error("Failed to fetch the log from drive.\n");
# 1295|   	else if (err > 0) {
# 1296|   		nvme_show_status(err);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1296:17: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1293:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1296:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1296:17: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1296:17: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 1294|   		nvme_show_error("Failed to fetch the log from drive.\n");
# 1295|   	else if (err > 0) {
# 1296|-> 		nvme_show_status(err);
# 1297|   		nvme_show_error("Failed to fetch telemetry-header. Error:%d.\n", err);
# 1298|   		goto close_fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1297:17: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1293:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1296:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1297:17: throw: if ‘nvme_show_message’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1297:17: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
# 1295|   	else if (err > 0) {
# 1296|   		nvme_show_status(err);
# 1297|-> 		nvme_show_error("Failed to fetch telemetry-header. Error:%d.\n", err);
# 1298|   		goto close_fd;
# 1299|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1301:15: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1293:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1301:15: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1301:15: throw: if ‘write’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1301:15: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 1299|   	}
# 1300|   
# 1301|-> 	err = write(fd, (void *)hdr, bs);
# 1302|   	if (err != bs) {
# 1303|   		nvme_show_error("Failed to write data to file.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1303:17: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1293:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1301:15: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1302:12: branch_true: following ‘true’ branch (when ‘err != 512’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1303:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1303:17: throw: if ‘nvme_show_message’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1303:17: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 1301|   	err = write(fd, (void *)hdr, bs);
# 1302|   	if (err != bs) {
# 1303|-> 		nvme_show_error("Failed to write data to file.\n");
# 1304|   		goto close_fd;
# 1305|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1313:23: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1267:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1274:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1293:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1295:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1301:15: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1302:12: branch_false: following ‘false’ branch (when ‘err == 512’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1307:34: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1309:16: branch_true: following ‘true’ branch (when ‘offset != full_size’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1310:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1313:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1313:23: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
# 1311|   		args.lpo = offset;
# 1312|   		args.lsp = NVME_LOG_LSP_NONE;
# 1313|-> 		err = nvme_get_log(&args);
# 1314|   		if (err < 0) {
# 1315|   			nvme_show_error("Failed to fetch the log from drive.\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1671:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1659:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1664:24: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1664:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1665:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1669:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1671:15: throw: if ‘ocp_get_log_simple’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1671:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1669|   	memset(data, 0, sizeof(__u8) * C5_UNSUPPORTED_REQS_LEN);
# 1670|   
# 1671|-> 	ret = ocp_get_log_simple(dev, OCP_LID_URLP, C5_UNSUPPORTED_REQS_LEN, data);
# 1672|   	if (!ret) {
# 1673|   		log_data = (struct unsupported_requirement_log *)data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1775:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1763:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1768:24: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1768:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1769:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1773:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1775:15: throw: if ‘ocp_get_log_simple’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1775:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1773|   	memset(data, 0, sizeof(__u8) * C1_ERROR_RECOVERY_LOG_BUF_LEN);
# 1774|   
# 1775|-> 	ret = ocp_get_log_simple(dev, OCP_LID_EREC, C1_ERROR_RECOVERY_LOG_BUF_LEN, data);
# 1776|   
# 1777|   	if (!ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1877:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1865:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1870:24: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1870:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1871:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1875:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1877:15: throw: if ‘ocp_get_log_simple’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1877:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
# 1875|   	memset(data, 0, sizeof(__u8) * C4_DEV_CAP_REQ_LEN);
# 1876|   
# 1877|-> 	ret = ocp_get_log_simple(dev, OCP_LID_DCLP, C4_DEV_CAP_REQ_LEN, data);
# 1878|   
# 1879|   	if (!ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2679:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2667:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2672:24: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2672:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2673:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2677:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2679:15: throw: if ‘ocp_get_log_simple’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2679:15: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
# 2677|   	memset(data, 0, sizeof(__u8) * C7_TCG_CONFIGURATION_LEN);
# 2678|   
# 2679|-> 	ret = ocp_get_log_simple(dev, OCP_LID_TCGL, C7_TCG_CONFIGURATION_LEN, data);
# 2680|   	if (!ret) {
# 2681|   		log_data = (struct tcg_configuration_log *)data;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def134]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2898:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cfg.file, 0)’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2887:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2892:13: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2892:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2893:23: acquire_resource: opened here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2894:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2898:40: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2899:20: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2900:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2900:25: throw: if ‘nvme_show_message’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2898:40: danger: ‘open(*cfg.file, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
# 2896|   			return -EINVAL;
# 2897|   		}
# 2898|-> 		err = read(ffd, entry, args.data_len);
# 2899|   		if (err < 0) {
# 2900|   			nvme_show_error("failed to read data buffer from input file: %s",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def135]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2902:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2859:12: enter_function: entry to ‘error_injection_set’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2887:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2892:13: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2892:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2893:23: acquire_resource: opened here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2894:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2898:40: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2873:26: call_function: inlined call to ‘cleanup_fd’ from ‘error_injection_set’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2928:1: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2902:32: danger: ‘ffd’ leaks here; was opened at [(6)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/5)
# 2900|   			nvme_show_error("failed to read data buffer from input file: %s",
# 2901|   					strerror(errno));
# 2902|-> 			return -errno;
# 2903|   		}
# 2904|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:59:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:46:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:51:16: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:51:16: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:52:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:56:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:59:9: throw: if ‘ocp_get_uuid_index’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-smart-extended-log.c:59:9: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   57|   
#   58|   	args.log = data;
#   59|-> 	ocp_get_uuid_index(dev, &args.uuidx);
#   60|   	ret = nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
#   61|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def137]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:475:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘description_str’ where non-null expected
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:870:6: enter_function: entry to ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:889:20: branch_true: following ‘true’ branch (when ‘pevent_fifos_object’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: call_function: calling ‘json_add_formatted_u32_str’ from ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: return_function: returning to ‘parse_common_event’ from ‘json_add_formatted_u32_str’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:892:25: call_function: calling ‘json_object_add_value_string’ from ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:892:25: return_function: returning to ‘parse_common_event’ from ‘json_object_add_value_string’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:894:25: call_function: calling ‘json_add_formatted_var_size_str’ from ‘parse_common_event’
#  473|   	for (size_t i = 0; i < data_size; ++i) {
#  474|   		sprintf(temp_buffer, "%02X", pdata[i]);
#  475|-> 		strcat(description_str, temp_buffer);
#  476|   	}
#  477|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def138]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:989:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘description’ where non-null expected
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1522:5: enter_function: entry to ‘print_ocp_telemetry_normal’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1526:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1529:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1530:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1601:34: call_function: calling ‘parse_statistics’ from ‘print_ocp_telemetry_normal’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1601:34: return_function: returning to ‘print_ocp_telemetry_normal’ from ‘parse_statistics’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1602:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1607:25: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1610:34: call_function: calling ‘parse_event_fifos’ from ‘print_ocp_telemetry_normal’
#  987|   	char *description = (char *)malloc((40 + 1) * sizeof(char));
#  988|   
#  989|-> 	memset(description, 0, sizeof(40));
#  990|   
#  991|   	status =

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:995:17: warning[-Wanalyzer-malloc-leak]: leak of ‘description’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1522:5: enter_function: entry to ‘print_ocp_telemetry_normal’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1526:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1529:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1530:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1601:34: call_function: calling ‘parse_statistics’ from ‘print_ocp_telemetry_normal’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1601:34: return_function: returning to ‘print_ocp_telemetry_normal’ from ‘parse_statistics’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1602:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1607:25: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1610:34: call_function: calling ‘parse_event_fifos’ from ‘print_ocp_telemetry_normal’
#  993|   
#  994|   	if (status != 0) {
#  995|-> 		nvme_show_error("Failed to get C9 String. status: %d\n", status);
#  996|   		return -1;
#  997|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def140]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*options.output_file, "w")’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1526:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: acquire_resource: opened here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1529:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1530:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:28: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:37: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:36: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: throw: if ‘generic_structure_parser’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: danger: ‘fopen(*options.output_file, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1531|   			fprintf(fp, "%s\n", STR_LOG_PAGE_HEADER);
# 1532|   			fprintf(fp, STR_LINE);
# 1533|-> 			if (!strcmp(options->telemetry_type, "host")) {
# 1534|   				if ((ptelemetry_buffer == NULL) ||
# 1535|   					(ARRAY_SIZE(host_log_page_header) == 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*options.output_file, "w")’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1526:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1529:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1530:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:28: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:37: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:36: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: throw: if ‘generic_structure_parser’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: danger: ‘fopen(*options.output_file, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1531|   			fprintf(fp, "%s\n", STR_LOG_PAGE_HEADER);
# 1532|   			fprintf(fp, STR_LINE);
# 1533|-> 			if (!strcmp(options->telemetry_type, "host")) {
# 1534|   				if ((ptelemetry_buffer == NULL) ||
# 1535|   					(ARRAY_SIZE(host_log_page_header) == 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
nvme-cli-2.15/plugins/sandisk/sandisk-nvme.c:182:15: warning[-Wanalyzer-malloc-leak]: leak of ‘log’
nvme-cli-2.15/plugins/sandisk/sandisk-nvme.c:191:12: enter_function: entry to ‘sndk_do_cap_udui’
nvme-cli-2.15/plugins/sandisk/sandisk-nvme.c:202:44: acquire_memory: allocated here
nvme-cli-2.15/plugins/sandisk/sandisk-nvme.c:203:12: branch_false: following ‘false’ branch (when ‘log’ is non-NULL)...
nvme-cli-2.15/plugins/sandisk/sandisk-nvme.c:209:9: branch_false: ...to here
nvme-cli-2.15/plugins/sandisk/sandisk-nvme.c:212:15: call_function: calling ‘sndk_dump_udui_data’ from ‘sndk_do_cap_udui’
#  180|   	admin_cmd.cdw10 = ((dataLen >> 2) - 1);
#  181|   	admin_cmd.cdw12 = offset;
#  182|-> 	ret = nvme_submit_admin_passthru(fd, &admin_cmd, NULL);
#  183|   	if (ret) {
#  184|   		fprintf(stderr, "ERROR: SNDK: reading DUI data failed\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def143]
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:57:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&vid, 0)’
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:50:14: acquire_resource: opened here
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:51:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:56:15: branch_false: ...to here
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:57:9: danger: ‘open(&vid, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   55|   
#   56|   	ret = read(fd, id, 32);
#   57|-> 	close(fd);
#   58|   
#   59|   	if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def144]
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:77:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&did, 0)’
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:51:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:56:15: branch_false: ...to here
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:59:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:63:12: branch_false: ...to here
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:70:14: acquire_resource: opened here
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:71:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:76:15: branch_false: ...to here
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:77:9: danger: ‘open(&did, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   75|   
#   76|   	ret = read(fd, id, 32);
#   77|-> 	close(fd);
#   78|   
#   79|   	if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:564:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data_buf’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:648:12: enter_function: entry to ‘sfx_get_bad_block’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:662:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:665:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:665:20: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:666:12: branch_false: following ‘false’ branch (when ‘data_buf’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:672:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:672:15: call_function: calling ‘get_bb_table’ from ‘sfx_get_bad_block’
#  562|   	cmd.cdw11 = numdu;
#  563|   
#  564|-> 	return nvme_submit_admin_passthru(fd, &cmd, NULL);
#  565|   }
#  566|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data_buf’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:648:12: enter_function: entry to ‘sfx_get_bad_block’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:662:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:665:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:665:20: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:666:12: branch_false: following ‘false’ branch (when ‘data_buf’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:672:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:672:15: call_function: calling ‘get_bb_table’ from ‘sfx_get_bad_block’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:672:15: return_function: returning to ‘sfx_get_bad_block’ from ‘get_bb_table’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:673:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:674:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:674:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:674:17: danger: ‘data_buf’ leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  672|   	err = get_bb_table(dev_fd(dev), NVME_NSID_ALL, data_buf, buf_size);
#  673|   	if (err < 0) {
#  674|-> 		perror("get-bad-block");
#  675|   	} else if (err) {
#  676|   		nvme_show_status(err);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def147]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rb")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1221:12: enter_function: entry to ‘nvme_dump_evtlog’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: following ‘true’ branch (when ‘length > single_len’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1312:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1317:41: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1317:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1322:17: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1339:22: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1345:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1350:23: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1350:23: call_function: calling ‘nvme_parse_evtlog’ from ‘nvme_dump_evtlog’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: danger: ‘fopen(file, "rb")’ leaks here; was opened at [(26)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/25)
# 1156|   
# 1157|   	while (length > 0) {
# 1158|-> 		info = (struct sfx_nvme_evtlog_info *)(pevent_log_info + offset);
# 1159|   
# 1160|   		if ((info->magic1 == 0x474F4C545645) &&

Error: GCC_ANALYZER_WARNING (CWE-775): [#def148]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(output, "w+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1150:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1151:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1151:12: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1157:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1160:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1161:22: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1160:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1163:25: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1171:25: throw: if ‘convert_ts’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: danger: ‘fopen(output, "w+")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1156|   
# 1157|   	while (length > 0) {
# 1158|-> 		info = (struct sfx_nvme_evtlog_info *)(pevent_log_info + offset);
# 1159|   
# 1160|   		if ((info->magic1 == 0x474F4C545645) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rb")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1221:12: enter_function: entry to ‘nvme_dump_evtlog’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: following ‘true’ branch (when ‘length > single_len’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1312:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1317:41: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1317:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1322:17: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1339:22: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1345:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1350:23: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1350:23: call_function: calling ‘nvme_parse_evtlog’ from ‘nvme_dump_evtlog’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: danger: ‘fopen(file, "rb")’ leaks here; was allocated at [(26)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/25)
# 1156|   
# 1157|   	while (length > 0) {
# 1158|-> 		info = (struct sfx_nvme_evtlog_info *)(pevent_log_info + offset);
# 1159|   
# 1160|   		if ((info->magic1 == 0x474F4C545645) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(output, "w+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1150:14: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1151:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1151:12: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1157:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1160:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1161:22: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1160:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1163:25: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1171:25: throw: if ‘convert_ts’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1158:55: danger: ‘fopen(output, "w+")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1156|   
# 1157|   	while (length > 0) {
# 1158|-> 		info = (struct sfx_nvme_evtlog_info *)(pevent_log_info + offset);
# 1159|   
# 1160|   		if ((info->magic1 == 0x474F4C545645) &&

Error: GCC_ANALYZER_WARNING (CWE-775): [#def151]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: following ‘true’ branch (when ‘length > single_len’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1311:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/10)
# 1302|   	length = log_len;
# 1303|   	while (length > 0) {
# 1304|-> 		args.lpo = offset;
# 1305|   		if (length > single_len) {
# 1306|   			args.len = single_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: following ‘true’ branch (when ‘length > single_len’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1305:20: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1311:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1304:17: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
# 1302|   	length = log_len;
# 1303|   	while (length > 0) {
# 1304|-> 		args.lpo = offset;
# 1305|   		if (length > single_len) {
# 1306|   			args.len = single_len;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def153]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_false: following ‘false’ branch (when ‘length == 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1327:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: throw: if ‘nvme_free_huge’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/10)
# 1328|   
# 1329|   	if (parse) {
# 1330|-> 		nvme_free_huge(&mh);
# 1331|   		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_false: following ‘false’ branch (when ‘length == 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1327:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: throw: if ‘nvme_free_huge’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/10)
# 1328|   
# 1329|   	if (parse) {
# 1330|-> 		nvme_free_huge(&mh);
# 1331|   		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def155]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1331:35: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_false: following ‘false’ branch (when ‘length == 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1327:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1331:35: throw: if ‘nvme_alloc_huge’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1331:35: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
# 1329|   	if (parse) {
# 1330|   		nvme_free_huge(&mh);
# 1331|-> 		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {
# 1333|   			fprintf(stderr, "Failed to alloc enough memory 0x%x to parse evtlog\n", log_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1331:35: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1303:16: branch_false: following ‘false’ branch (when ‘length == 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1327:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1331:35: throw: if ‘nvme_alloc_huge’ throws an exception...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1331:35: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
# 1329|   	if (parse) {
# 1330|   		nvme_free_huge(&mh);
# 1331|-> 		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {
# 1333|   			fprintf(stderr, "Failed to alloc enough memory 0x%x to parse evtlog\n", log_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1697:23: warning[-Wanalyzer-malloc-leak]: leak of ‘log’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1594:12: enter_function: entry to ‘get_host_tele’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1629:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1633:23: branch_false: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1637:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1638:26: branch_true: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1659:16: branch_true: following ‘true’ branch (when ‘blkCnt < maxBlk’)...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1662:30: branch_true: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1670:23: acquire_memory: allocated here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1672:20: branch_false: following ‘false’ branch (when ‘log’ is non-NULL)...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1678:17: branch_false: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1682:35: call_function: inlined call to ‘__dev_fd’ from ‘get_host_tele’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1697:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1697:23: danger: ‘log’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
# 1695|   			.result     = NULL,
# 1696|   		};
# 1697|-> 		err = nvme_get_log(&args);
# 1698|   		if (!err) {
# 1699|   			offset += (__le64)bytesToGet;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1816:23: warning[-Wanalyzer-malloc-leak]: leak of ‘log’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1722:12: enter_function: entry to ‘get_ctrl_tele’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1752:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1758:15: branch_false: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1760:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1761:26: branch_true: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1781:16: branch_true: following ‘true’ branch (when ‘blkCnt < maxBlk’)...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1784:30: branch_true: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1790:23: acquire_memory: allocated here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1792:20: branch_false: following ‘false’ branch (when ‘log’ is non-NULL)...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1797:17: branch_false: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1801:35: call_function: inlined call to ‘__dev_fd’ from ‘get_ctrl_tele’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1816:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1816:23: danger: ‘log’ leaks here; was allocated at [(8)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/7)
# 1814|   			.result     = NULL,
# 1815|   		};
# 1816|-> 		err = nvme_get_log(&args);
# 1817|   		if (!err) {
# 1818|   			offset += (__le64)bytesToGet;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1946:23: warning[-Wanalyzer-malloc-leak]: leak of ‘log’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1848:12: enter_function: entry to ‘vs_internal_log’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1881:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1885:20: branch_false: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1897:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1898:26: branch_true: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1910:16: branch_true: following ‘true’ branch (when ‘blkCnt < maxBlk’)...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1913:30: branch_true: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1919:23: acquire_memory: allocated here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1921:20: branch_false: following ‘false’ branch (when ‘log’ is non-NULL)...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1927:17: branch_false: ...to here
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1931:35: call_function: inlined call to ‘__dev_fd’ from ‘vs_internal_log’
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1946:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.15/plugins/seagate/seagate-nvme.c:1946:23: danger: ‘log’ leaks here; was allocated at [(8)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/7)
# 1944|   			.result     = NULL,
# 1945|   		};
# 1946|-> 		err = nvme_get_log(&args);
# 1947|   		if (!err) {
# 1948|   			offset += (__le64)bytesToGet;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def160]
nvme-cli-2.15/plugins/sed/sedopal_cmd.c:189:29: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
nvme-cli-2.15/plugins/sed/sedopal_cmd.c:524:5: enter_function: entry to ‘sedopal_cmd_password’
nvme-cli-2.15/plugins/sed/sedopal_cmd.c:539:13: call_function: calling ‘sedopal_set_key’ from ‘sedopal_cmd_password’
#  187|   		if (sedopal_ask_new_key) {
#  188|   			pass = sedopal_get_password(SEDOPAL_REENTER_PW_PROMPT);
#  189|-> 			if (strncmp((char *)key->key, pass, key->key_len)) {
#  190|   				fprintf(stderr,
#  191|   					"Error: passwords don't match\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def161]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.file, 0)’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: danger: ‘open(cfg.file, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  326|   		if (strlen(cfg.file)) {
#  327|   			ffd = open(cfg.file, O_RDONLY);
#  328|-> 			if (ffd <= 0) {
#  329|   				fprintf(stderr, "no firmware file provided\n");
#  330|   				err = EINVAL;

Error: GCC_ANALYZER_WARNING: [#def162]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:23: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:23: danger: ‘ffd’ could be invalid: unchecked value from [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  332|   			}
#  333|   		}
#  334|-> 		err = read(ffd, (void *)buf, cfg.data_len);
#  335|   		if (err < 0) {
#  336|   			fprintf(stderr, "failed to read data buffer from input file\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def163]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:338:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:335:20: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:336:25: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:338:25: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  336|   			fprintf(stderr, "failed to read data buffer from input file\n");
#  337|   			err = EINVAL;
#  338|-> 			goto free;
#  339|   		}
#  340|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def164]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:357:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:335:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:342:39: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:357:15: throw: if ‘nvme_set_features’ throws an exception...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:357:15: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  355|   		.result		= &result,
#  356|   	};
#  357|-> 	err = nvme_set_features(&args);
#  358|   	if (err < 0) {
#  359|   		perror("set-feature");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def165]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:359:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:335:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:342:39: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:358:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:359:17: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:359:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:359:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
#  357|   	err = nvme_set_features(&args);
#  358|   	if (err < 0) {
#  359|-> 		perror("set-feature");
#  360|   		goto free;
#  361|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def166]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:360:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:335:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:342:39: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:360:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
#  358|   	if (err < 0) {
#  359|   		perror("set-feature");
#  360|-> 		goto free;
#  361|   	}
#  362|   	if (!err) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def167]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:364:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:335:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:342:39: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:358:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:362:12: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:362:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:363:20: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:363:20: branch_true: following ‘true’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:364:32: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:364:25: throw: if ‘d’ throws an exception...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:364:25: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
#  362|   	if (!err) {
#  363|   		if (buf)
#  364|-> 			d(buf, cfg.data_len, 16, 1);
#  365|   	} else if (err > 0)
#  366|   		nvme_show_status(err);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def168]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:366:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:335:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:342:39: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:358:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:362:12: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:362:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:366:17: branch_false: ...to here
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:366:17: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:366:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10)
#  364|   			d(buf, cfg.data_len, 16, 1);
#  365|   	} else if (err > 0)
#  366|-> 		nvme_show_status(err);
#  367|   
#  368|   free:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def169]
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:884:17: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(cfg.out_dir)’
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:857:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:859:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:862:34: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:865:21: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:882:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:883:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:884:17: branch_true: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:884:17: danger: ‘opendir(cfg.out_dir)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  882|   	dir = opendir(cfg.out_dir);
#  883|   	if (dir)
#  884|-> 		closedir(dir);
#  885|   	else  {
#  886|   		perror(cfg.out_dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def170]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file_name, "rb")’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:29:20: acquire_resource: opened here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:31:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: throw: if ‘fseek’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: danger: ‘fopen(file_name, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   32|   		return -errno;
#   33|   
#   34|-> 	fseek(fd, 0, SEEK_END);
#   35|   	size_t length_bytes = ftell(fd);
#   36|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file_name, "rb")’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:29:20: acquire_memory: allocated here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:31:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: throw: if ‘fseek’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: danger: ‘fopen(file_name, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   32|   		return -errno;
#   33|   
#   34|-> 	fseek(fd, 0, SEEK_END);
#   35|   	size_t length_bytes = ftell(fd);
#   36|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def172]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:35:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file_name, "rb")’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:29:20: acquire_resource: opened here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:31:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:35:31: throw: if ‘ftell’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:35:31: danger: ‘fopen(file_name, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   33|   
#   34|   	fseek(fd, 0, SEEK_END);
#   35|-> 	size_t length_bytes = ftell(fd);
#   36|   
#   37|   	fseek(fd, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:35:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file_name, "rb")’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:29:20: acquire_memory: allocated here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:31:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:35:31: throw: if ‘ftell’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:35:31: danger: ‘fopen(file_name, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   33|   
#   34|   	fseek(fd, 0, SEEK_END);
#   35|-> 	size_t length_bytes = ftell(fd);
#   36|   
#   37|   	fseek(fd, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def174]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:37:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file_name, "rb")’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:29:20: acquire_resource: opened here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:31:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:37:9: throw: if ‘fseek’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:37:9: danger: ‘fopen(file_name, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   35|   	size_t length_bytes = ftell(fd);
#   36|   
#   37|-> 	fseek(fd, 0, SEEK_SET);
#   38|   
#   39|   	*buffer = malloc(length_bytes);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:37:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file_name, "rb")’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:29:20: acquire_memory: allocated here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:31:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:34:9: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:37:9: throw: if ‘fseek’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:37:9: danger: ‘fopen(file_name, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#   35|   	size_t length_bytes = ftell(fd);
#   36|   
#   37|-> 	fseek(fd, 0, SEEK_SET);
#   38|   
#   39|   	*buffer = malloc(length_bytes);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def176]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:59:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘configuration’
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:80:17: throw: if ‘json_object_new_object’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry.c:77:75: call_function: inlined call to ‘cleanup_json_object’ from ‘solidigm_get_telemetry_log’
#   57|   static void cleanup_json_object(struct json_object **jobj_ptr)
#   58|   {
#   59|-> 	json_free_object(*jobj_ptr);
#   60|   	*jobj_ptr = NULL;
#   61|   }

Error: CPPCHECK_WARNING (CWE-457): [#def177]
nvme-cli-2.15/plugins/solidigm/solidigm-telemetry/nlog.c:122: warning[uninitvar]: Uninitialized variable: str_mismatches
#  120|   				       offset_tail_mismatches[best_offset][i]);
#  121|   
#  122|-> 		SOLIDIGM_LOG_WARNING("%s:%d with %d header mismatches ( %s). Configuration file may be missing format headers.",
#  123|   				      name, media_bank, smaller_tail_count, str_mismatches);
#  124|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:60:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:60:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:60:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#   58|   	/* 00 SI_VD_PROGRAM_FAIL */
#   59|   	get_ymtc_smart_info(smart, SI_VD_PROGRAM_FAIL, nm, raw);
#   60|-> 	printf("program_fail_count              : %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#   61|   	/* 01 SI_VD_ERASE_FAIL */
#   62|   	get_ymtc_smart_info(smart, SI_VD_ERASE_FAIL, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:63:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:63:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:63:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#   61|   	/* 01 SI_VD_ERASE_FAIL */
#   62|   	get_ymtc_smart_info(smart, SI_VD_ERASE_FAIL, nm, raw);
#   63|-> 	printf("erase_fail_count                : %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#   64|   	/* 02 SI_VD_WEARLEVELING_COUNT */
#   65|   	get_ymtc_smart_info(smart, SI_VD_WEARLEVELING_COUNT, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:70:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:70:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:70:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
#   68|   	/* 03 SI_VD_E2E_DECTECTION_COUNT */
#   69|   	get_ymtc_smart_info(smart, SI_VD_E2E_DECTECTION_COUNT, nm, raw);
#   70|-> 	printf("end_to_end_error_detection_count: %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#   71|   	/* 04 SI_VD_PCIE_CRC_ERR_COUNT */
#   72|   	get_ymtc_smart_info(smart, SI_VD_PCIE_CRC_ERR_COUNT, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:80:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:80:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:80:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
#   78|   	/* 11 SI_VD_TOTAL_WRITE */
#   79|   	get_ymtc_smart_info(smart, SI_VD_TOTAL_WRITE, nm, raw);
#   80|-> 	printf("nand_bytes_written              : %3d%%       sectors: %"PRIu64"\n", *nm, int48_to_long(raw));
#   81|   	/* 12 SI_VD_HOST_WRITE */
#   82|   	get_ymtc_smart_info(smart, SI_VD_HOST_WRITE, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:83:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:83:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:83:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/1)
#   81|   	/* 12 SI_VD_HOST_WRITE */
#   82|   	get_ymtc_smart_info(smart, SI_VD_HOST_WRITE, nm, raw);
#   83|-> 	printf("host_bytes_written              : %3d%%       sectors: %"PRIu64"\n", *nm, int48_to_long(raw));
#   84|   	/* 14 SI_VD_TOTAL_READ */
#   85|   	get_ymtc_smart_info(smart, SI_VD_TOTAL_READ, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:86:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:86:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:86:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/1)
#   84|   	/* 14 SI_VD_TOTAL_READ */
#   85|   	get_ymtc_smart_info(smart, SI_VD_TOTAL_READ, nm, raw);
#   86|-> 	printf("nand_bytes_read                 : %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#   87|   	/* 15 SI_VD_TEMPT_SINCE_BORN */
#   88|   	get_ymtc_smart_info(smart, SI_VD_TEMPT_SINCE_BORN, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:101:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:101:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:101:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
#   99|   	/* 18 SI_VD_POWER_LOSS_PROTECTION */
#  100|   	get_ymtc_smart_info(smart, SI_VD_POWER_LOSS_PROTECTION, nm, raw);
#  101|-> 	printf("power_loss_protection           : %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#  102|   	/* 19 SI_VD_READ_FAIL */
#  103|   	get_ymtc_smart_info(smart, SI_VD_READ_FAIL, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:104:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:104:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:104:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/1)
#  102|   	/* 19 SI_VD_READ_FAIL */
#  103|   	get_ymtc_smart_info(smart, SI_VD_READ_FAIL, nm, raw);
#  104|-> 	printf("read_fail                       : %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#  105|   	/* 20 SI_VD_THERMAL_THROTTLE_TIME */
#  106|   	get_ymtc_smart_info(smart, SI_VD_THERMAL_THROTTLE_TIME, nm, raw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:111:9: warning[-Wanalyzer-malloc-leak]: leak of ‘raw’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:24:12: enter_function: entry to ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:32:19: acquire_memory: allocated here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:38:12: branch_false: following ‘false’ branch (when ‘raw’ is non-NULL)...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:42:15: call_function: inlined call to ‘__dev_fd’ from ‘show_ymtc_smart_log’
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:43:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:51:42: branch_false: ...to here
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:111:9: throw: if ‘int48_to_long’ throws an exception...
nvme-cli-2.15/plugins/ymtc/ymtc-nvme.c:111:9: danger: ‘raw’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
#  109|   	/* 21 SI_VD_FLASH_MEDIA_ERROR */
#  110|   	get_ymtc_smart_info(smart, SI_VD_FLASH_MEDIA_ERROR, nm, raw);
#  111|-> 	printf("flash_error_media_count         : %3d%%       %"PRIu64"\n", *nm, int48_to_long(raw));
#  112|   
#  113|   	free(nm);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def187]
nvme-cli-2.15/plugins/zns/zns.c:422:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:375:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:378:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:386:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:393:22: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:412:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:413:31: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:413:31: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:414:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:420:46: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:421:20: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/zns/zns.c:422:25: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:422:25: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:422:25: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  420|   		err = read(ffd, (void *)buf, cfg.data_len);
#  421|   		if (err < 0) {
#  422|-> 			perror("read");
#  423|   			goto close_ffd;
#  424|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def188]
nvme-cli-2.15/plugins/zns/zns.c:446:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:375:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:378:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:386:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:393:22: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:412:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:413:31: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:413:31: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:414:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:420:46: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:421:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:437:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:446:15: throw: if ‘nvme_zns_mgmt_send’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:446:15: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  444|   		.result		= NULL,
#  445|   	};
#  446|-> 	err = nvme_zns_mgmt_send(&args);
#  447|   	if (!err)
#  448|   		printf("zone-mgmt-send: Success, action:%d zone:%"PRIx64" all:%d nsid:%d\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def189]
nvme-cli-2.15/plugins/zns/zns.c:451:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:375:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:378:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:386:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:393:22: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:412:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:413:31: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:413:31: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:414:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:420:46: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:421:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:437:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:447:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:450:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:450:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:451:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:451:17: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:451:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  449|   		       cfg.zsa, (uint64_t)cfg.zslba, (int)cfg.select_all, cfg.namespace_id);
#  450|   	else if (err > 0)
#  451|-> 		nvme_show_status(err);
#  452|   	else
#  453|   		perror("zns zone-mgmt-send");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def190]
nvme-cli-2.15/plugins/zns/zns.c:453:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:375:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:378:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:386:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:393:22: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:412:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:413:31: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:413:31: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:414:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:420:46: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:421:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:437:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:447:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:450:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:450:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:453:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:453:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:453:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  451|   		nvme_show_status(err);
#  452|   	else
#  453|-> 		perror("zns zone-mgmt-send");
#  454|   
#  455|   close_ffd:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def191]
nvme-cli-2.15/plugins/zns/zns.c:457:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:375:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:378:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:386:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:392:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:393:22: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:406:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:412:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:413:31: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:413:31: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:414:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:420:46: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:421:20: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:437:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:456:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:457:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:457:17: throw: if ‘close’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:457:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
#  455|   close_ffd:
#  456|   	if (cfg.file)
#  457|-> 		close(ffd);
#  458|   free:
#  459|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
nvme-cli-2.15/plugins/zns/zns.c:808:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.15/plugins/zns/zns.c:766:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:769:38: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:770:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:773:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:786:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:787:24: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:787:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/zns/zns.c:788:20: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:799:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:808:15: throw: if ‘nvme_zns_mgmt_recv’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:808:15: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  806|   		.result		= NULL,
#  807|   	};
#  808|-> 	err = nvme_zns_mgmt_recv(&args);
#  809|   	if (!err)
#  810|   		printf("zone-mgmt-recv: Success, action:%d zone:%"PRIx64" nsid:%d\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def193]
nvme-cli-2.15/plugins/zns/zns.c:1128:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1212:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1214:1: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1128:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
# 1126|   		fprintf(stderr, "No memory for data size:%"PRIx64"\n",
# 1127|   			(uint64_t)cfg.data_size);
# 1128|-> 		goto close_dfd;
# 1129|   	}
# 1130|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def194]
nvme-cli-2.15/plugins/zns/zns.c:1134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1134:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1134:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1134:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
# 1132|   	err = read(dfd, buf, cfg.data_size);
# 1133|   	if (err < 0) {
# 1134|-> 		perror("read-data");
# 1135|   		goto free_data;
# 1136|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def195]
nvme-cli-2.15/plugins/zns/zns.c:1139:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: throw: if ‘open’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
# 1137|   
# 1138|   	if (cfg.metadata) {
# 1139|-> 		mfd = open(cfg.metadata, O_RDONLY);
# 1140|   		if (mfd < 0) {
# 1141|   			perror(cfg.metadata);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def196]
nvme-cli-2.15/plugins/zns/zns.c:1141:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1141:32: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1141:25: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1141:25: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/12)
# 1139|   		mfd = open(cfg.metadata, O_RDONLY);
# 1140|   		if (mfd < 0) {
# 1141|-> 			perror(cfg.metadata);
# 1142|   			err = -1;
# 1143|   			goto free_data;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def197]
nvme-cli-2.15/plugins/zns/zns.c:1158:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1148:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1148:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1148:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1157:20: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1158:25: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1158:25: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1158:25: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
# 1156|   		err = read(mfd, mbuf, cfg.metadata_size);
# 1157|   		if (err < 0) {
# 1158|-> 			perror("read-metadata");
# 1159|   			goto free_meta;
# 1160|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def198]
nvme-cli-2.15/plugins/zns/zns.c:1158:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1148:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1148:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1148:21: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1157:20: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1158:25: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1158:25: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1158:25: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/18)
# 1156|   		err = read(mfd, mbuf, cfg.metadata_size);
# 1157|   		if (err < 0) {
# 1158|-> 			perror("read-metadata");
# 1159|   			goto free_meta;
# 1160|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def199]
nvme-cli-2.15/plugins/zns/zns.c:1191:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1191:15: throw: if ‘nvme_zns_append’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1191:15: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/12)
# 1189|   
# 1190|   	gettimeofday(&start_time, NULL);
# 1191|-> 	err = nvme_zns_append(&args);
# 1192|   	gettimeofday(&end_time, NULL);
# 1193|   	if (cfg.latency)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def200]
nvme-cli-2.15/plugins/zns/zns.c:1191:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1191:15: throw: if ‘nvme_zns_append’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1191:15: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/18)
# 1189|   
# 1190|   	gettimeofday(&start_time, NULL);
# 1191|-> 	err = nvme_zns_append(&args);
# 1192|   	gettimeofday(&end_time, NULL);
# 1193|   	if (cfg.latency)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def201]
nvme-cli-2.15/plugins/zns/zns.c:1194:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1193:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1194:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1194:17: throw: if ‘elapsed_utime’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1194:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/12)
# 1192|   	gettimeofday(&end_time, NULL);
# 1193|   	if (cfg.latency)
# 1194|-> 		printf(" latency: zone append: %llu us\n",
# 1195|   		       elapsed_utime(start_time, end_time));
# 1196|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def202]
nvme-cli-2.15/plugins/zns/zns.c:1194:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1193:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1194:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1194:17: throw: if ‘elapsed_utime’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1194:17: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/18)
# 1192|   	gettimeofday(&end_time, NULL);
# 1193|   	if (cfg.latency)
# 1194|-> 		printf(" latency: zone append: %llu us\n",
# 1195|   		       elapsed_utime(start_time, end_time));
# 1196|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def203]
nvme-cli-2.15/plugins/zns/zns.c:1200:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1197:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1200:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1200:17: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1200:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/12)
# 1198|   		printf("Success appended data to LBA %"PRIx64"\n", (uint64_t)result);
# 1199|   	else if (err > 0)
# 1200|-> 		nvme_show_status(err);
# 1201|   	else
# 1202|   		perror("zns zone-append");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def204]
nvme-cli-2.15/plugins/zns/zns.c:1200:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1197:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1200:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1200:17: throw: if ‘nvme_show_status’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1200:17: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/18)
# 1198|   		printf("Success appended data to LBA %"PRIx64"\n", (uint64_t)result);
# 1199|   	else if (err > 0)
# 1200|-> 		nvme_show_status(err);
# 1201|   	else
# 1202|   		perror("zns zone-append");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def205]
nvme-cli-2.15/plugins/zns/zns.c:1202:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1197:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1202:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1202:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1202:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/12)
# 1200|   		nvme_show_status(err);
# 1201|   	else
# 1202|-> 		perror("zns zone-append");
# 1203|   
# 1204|   free_meta:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def206]
nvme-cli-2.15/plugins/zns/zns.c:1202:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1197:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1199:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1202:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1202:17: throw: if ‘perror’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1202:17: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/18)
# 1200|   		nvme_show_status(err);
# 1201|   	else
# 1202|-> 		perror("zns zone-append");
# 1203|   
# 1204|   free_meta:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def207]
nvme-cli-2.15/plugins/zns/zns.c:1208:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1207:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1208:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1208:17: throw: if ‘close’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1208:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/12)
# 1206|   close_mfd:
# 1207|   	if (cfg.metadata)
# 1208|-> 		close(mfd);
# 1209|   free_data:
# 1210|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def208]
nvme-cli-2.15/plugins/zns/zns.c:1208:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:13: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1133:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:1138:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1138:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1139:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1139:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1140:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1147:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1147:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1163:20: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1167:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1169:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1169:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1172:37: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1207:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1208:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1208:17: throw: if ‘close’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1208:17: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/18)
# 1206|   close_mfd:
# 1207|   	if (cfg.metadata)
# 1208|-> 		close(mfd);
# 1209|   free_data:
# 1210|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def209]
nvme-cli-2.15/plugins/zns/zns.c:1213:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1212:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1213:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1213:17: throw: if ‘close’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1213:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
# 1211|   close_dfd:
# 1212|   	if (cfg.data)
# 1213|-> 		close(dfd);
# 1214|   close_dev:
# 1215|   	dev_close(dev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def210]
nvme-cli-2.15/plugins/zns/zns.c:1215:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
nvme-cli-2.15/plugins/zns/zns.c:1068:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1071:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1071:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1077:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1086:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1091:9: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1093:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1101:21: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1111:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1117:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1117:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1118:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1118:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:1119:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1125:49: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1212:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1214:1: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1215:9: throw: if ‘dev_close’ throws an exception...
nvme-cli-2.15/plugins/zns/zns.c:1215:9: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/12)
# 1213|   		close(dfd);
# 1214|   close_dev:
# 1215|-> 	dev_close(dev);
# 1216|   	return err;
# 1217|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def211]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘allocated_eyes’
nvme-cli-2.15/nvme-print-json.c:2261:9: throw: if ‘json_object_new_uint64’ throws an exception...
nvme-cli-2.15/nvme-print-json.c:2259:31: call_function: inlined call to ‘freep’ from ‘json_phy_rx_eom_log’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def212]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘buf’
nvme-cli-2.15/plugins/feat/feat-nvme.c:60:12: branch_true: following ‘true’ branch (when ‘sel != 3’)...
nvme-cli-2.15/plugins/feat/feat-nvme.c:61:17: branch_true: ...to here
nvme-cli-2.15/plugins/feat/feat-nvme.c:61:17: throw: if ‘nvme_get_feature_length’ throws an exception...
nvme-cli-2.15/plugins/feat/feat-nvme.c:58:30: call_function: inlined call to ‘freep’ from ‘feat_get’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def213]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘entry’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2800:12: branch_true: following ‘true’ branch (when ‘uuid != 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2802:23: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2802:23: throw: if ‘ocp_get_uuid_index’ throws an exception...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:2787:43: call_function: inlined call to ‘freep’ from ‘error_injection_get’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def214]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘hexstr’
nvme-cli-2.15/nvme-print-json.c:2193:21: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2202:25: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2202:25: throw: if ‘json_object_new_object’ throws an exception...
nvme-cli-2.15/nvme-print-json.c:2195:38: call_function: inlined call to ‘freep’ from ‘json_phy_rx_eom_descs’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def215]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘hid’
nvme-cli-2.15/fabrics.c:1341:5: enter_function: entry to ‘nvmf_config’
nvme-cli-2.15/fabrics.c:1352:41: call_function: inlined call to ‘cleanup_nvme_root’ from ‘nvmf_config’
nvme-cli-2.15/fabrics.c:1347:30: call_function: inlined call to ‘freep’ from ‘nvmf_config’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def216]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘id’
nvme-cli-2.15/fabrics.c:534:12: enter_function: entry to ‘_discover_from_json_config_file’
nvme-cli-2.15/fabrics.c:551:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:555:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:608:14: call_function: calling ‘nvmf_create_discover_ctrl’ from ‘_discover_from_json_config_file’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def217]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pevent’
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:746:12: enter_function: entry to ‘ilog_dump_pel’
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:761:15: call_function: calling ‘nvme_get_log_persistent_event’ from ‘ilog_dump_pel’
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:759:45: throw: if ‘nvme_free_huge’ throws an exception...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:757:58: call_function: inlined call to ‘freep’ from ‘ilog_dump_pel’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def218]
nvme-cli-2.15/util/cleanup.h:26:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘value’
nvme-cli-2.15/util/json.c:91:6: enter_function: entry to ‘json_object_add_byte_array’
nvme-cli-2.15/util/json.c:97:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/util/json.c:98:17: branch_true: ...to here
nvme-cli-2.15/util/json.c:98:17: call_function: calling ‘json_object_add_value_string’ from ‘json_object_add_byte_array’
nvme-cli-2.15/util/json.c:95:30: call_function: inlined call to ‘freep’ from ‘json_object_add_byte_array’
#   24|   static inline void freep(void *p)
#   25|   {
#   26|-> 	free(*(void **)p);
#   27|   }
#   28|   #define _cleanup_free_ __cleanup__(freep)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def219]
nvme-cli-2.15/util/cleanup.h:34:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ffd’
nvme-cli-2.15/plugins/feat/feat-nvme.c:219:15: throw: if ‘nvme_set_features’ throws an exception...
nvme-cli-2.15/plugins/feat/feat-nvme.c:175:26: call_function: inlined call to ‘cleanup_fd’ from ‘perfc_set’
#   32|   static inline void cleanup_fd(int *fd)
#   33|   {
#   34|-> 	if (*fd > STDERR_FILENO)
#   35|   		close(*fd);
#   36|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def220]
nvme-cli-2.15/util/cleanup.h:34:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘output’
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:654:12: enter_function: entry to ‘ilog_dump_log_page’
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:660:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:662:12: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:668:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:671:71: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:671:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:674:16: branch_false: ...to here
nvme-cli-2.15/plugins/solidigm/solidigm-internal-logs.c:674:16: call_function: calling ‘log_save’ from ‘ilog_dump_log_page’
#   32|   static inline void cleanup_fd(int *fd)
#   33|   {
#   34|-> 	if (*fd > STDERR_FILENO)
#   35|   		close(*fd);
#   36|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def221]
nvme-cli-2.15/util/cleanup.h:35:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/feat/feat-nvme.c:169:12: enter_function: entry to ‘perfc_set’
nvme-cli-2.15/plugins/feat/feat-nvme.c:200:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/feat/feat-nvme.c:201:31: acquire_resource: opened here
nvme-cli-2.15/plugins/feat/feat-nvme.c:202:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/feat/feat-nvme.c:207:59: branch_false: ...to here
nvme-cli-2.15/plugins/feat/feat-nvme.c:175:26: call_function: inlined call to ‘cleanup_fd’ from ‘perfc_set’
#   33|   {
#   34|   	if (*fd > STDERR_FILENO)
#   35|-> 		close(*fd);
#   36|   }
#   37|   #define _cleanup_fd_ __cleanup__(cleanup_fd)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def222]
nvme-cli-2.15/util/cleanup.h:41:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘r’
nvme-cli-2.15/fabrics.c:1292:15: throw: if ‘argconfig_parse’ throws an exception...
nvme-cli-2.15/fabrics.c:1273:41: call_function: inlined call to ‘cleanup_nvme_root’ from ‘nvmf_disconnect_all’
#   39|   static inline void cleanup_nvme_root(nvme_root_t *r)
#   40|   {
#   41|-> 	nvme_free_tree(*r);
#   42|   }
#   43|   #define _cleanup_nvme_root_ __cleanup__(cleanup_nvme_root)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def223]
nvme-cli-2.15/util/cleanup.h:45:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘c’
nvme-cli-2.15/fabrics.c:996:5: enter_function: entry to ‘nvmf_connect’
nvme-cli-2.15/fabrics.c:1027:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1030:15: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1031:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1036:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1064:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1069:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1077:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1083:15: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1084:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1087:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1088:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1090:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1095:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:1098:26: branch_false: ...to here
nvme-cli-2.15/fabrics.c:1107:13: call_function: calling ‘lookup_ctrl’ from ‘nvmf_connect’
nvme-cli-2.15/fabrics.c:1107:13: return_function: returning to ‘nvmf_connect’ from ‘lookup_ctrl’
nvme-cli-2.15/fabrics.c:1108:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/fabrics.c:1108:18: branch_true: ...to here
nvme-cli-2.15/fabrics.c:1108:18: throw: if ‘nvme_ctrl_get_name’ throws an exception...
nvme-cli-2.15/fabrics.c:1010:41: call_function: inlined call to ‘cleanup_nvme_ctrl’ from ‘nvmf_connect’
#   43|   #define _cleanup_nvme_root_ __cleanup__(cleanup_nvme_root)
#   44|   
#   45|-> static inline DEFINE_CLEANUP_FUNC(cleanup_nvme_ctrl, nvme_ctrl_t, nvme_free_ctrl)
#   46|   #define _cleanup_nvme_ctrl_ __cleanup__(cleanup_nvme_ctrl)
#   47|   

Error: GCC_ANALYZER_WARNING (CWE-910): [#def224]
nvme-cli-2.15/util/cleanup.h:55:15: warning[-Wanalyzer-double-fclose]: double ‘fclose’ of FILE ‘file’
nvme-cli-2.15/plugins/lm/lm-nvme.c:269:12: enter_function: entry to ‘lm_migration_send’
nvme-cli-2.15/plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:373:24: acquire_resource: opened here
nvme-cli-2.15/plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:380:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:383:48: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:385:17: release_resource: first ‘fclose’ here
nvme-cli-2.15/plugins/lm/lm-nvme.c:296:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_send’
#   53|   #define _cleanup_uri_ __cleanup__(free_uri)
#   54|   
#   55|-> static inline DEFINE_CLEANUP_FUNC(cleanup_file, FILE *, fclose)
#   56|   #define _cleanup_file_ __cleanup__(cleanup_file)
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def225]
nvme-cli-2.15/util/cleanup.h:55:15: warning[-Wanalyzer-double-free]: double-‘fclose’ of ‘file’
nvme-cli-2.15/plugins/lm/lm-nvme.c:269:12: enter_function: entry to ‘lm_migration_send’
nvme-cli-2.15/plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:373:24: acquire_memory: allocated here
nvme-cli-2.15/plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:379:40: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:380:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/lm/lm-nvme.c:383:48: branch_false: ...to here
nvme-cli-2.15/plugins/lm/lm-nvme.c:385:17: release_memory: first ‘fclose’ here
nvme-cli-2.15/plugins/lm/lm-nvme.c:296:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_send’
#   53|   #define _cleanup_uri_ __cleanup__(free_uri)
#   54|   
#   55|-> static inline DEFINE_CLEANUP_FUNC(cleanup_file, FILE *, fclose)
#   56|   #define _cleanup_file_ __cleanup__(cleanup_file)
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def226]
nvme-cli-2.15/util/cleanup.h:55:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fd’
nvme-cli-2.15/plugins/lm/lm-nvme.c:484:15: throw: if ‘parse_and_open’ throws an exception...
nvme-cli-2.15/plugins/lm/lm-nvme.c:439:45: throw: if ‘nvme_free_huge’ throws an exception...
nvme-cli-2.15/plugins/lm/lm-nvme.c:438:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_recv’
#   53|   #define _cleanup_uri_ __cleanup__(free_uri)
#   54|   
#   55|-> static inline DEFINE_CLEANUP_FUNC(cleanup_file, FILE *, fclose)
#   56|   #define _cleanup_file_ __cleanup__(cleanup_file)
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def227]
nvme-cli-2.15/util/cleanup.h:55:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘file’
nvme-cli-2.15/plugins/lm/lm-nvme.c:344:15: throw: if ‘parse_and_open’ throws an exception...
nvme-cli-2.15/plugins/lm/lm-nvme.c:297:45: throw: if ‘nvme_free_huge’ throws an exception...
nvme-cli-2.15/plugins/lm/lm-nvme.c:296:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_send’
#   53|   #define _cleanup_uri_ __cleanup__(free_uri)
#   54|   
#   55|-> static inline DEFINE_CLEANUP_FUNC(cleanup_file, FILE *, fclose)
#   56|   #define _cleanup_file_ __cleanup__(cleanup_file)
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
nvme-cli-2.15/util/json.c:111:52: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, (long unsigned int)((len + 1) * 2 + 1))’
nvme-cli-2.15/util/json.c:91:6: enter_function: entry to ‘json_object_add_byte_array’
nvme-cli-2.15/util/json.c:97:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/util/json.c:102:27: branch_false: ...to here
nvme-cli-2.15/util/json.c:102:17: acquire_memory: allocated here
nvme-cli-2.15/util/json.c:104:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/util/json.c:109:9: branch_false: ...to here
nvme-cli-2.15/util/json.c:110:21: branch_true: following ‘true’ branch (when ‘i <= len’)...
nvme-cli-2.15/util/json.c:111:52: branch_true: ...to here
nvme-cli-2.15/util/json.c:113:9: call_function: calling ‘json_object_add_value_string’ from ‘json_object_add_byte_array’
nvme-cli-2.15/util/json.c:111:52: danger: ‘calloc(1, (long unsigned int)((len + 1) * 2 + 1))’ leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  109|   	sprintf(value, "0x");
#  110|   	for (i = 1; i <= len; i++)
#  111|-> 		sprintf(&value[i * 2], "%02x", buf[len - i]);
#  112|   
#  113|   	json_object_add_value_string(o, k, value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
nvme-cli-2.15/util/json.c:113:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, (long unsigned int)((len + 1) * 2 + 1))’
nvme-cli-2.15/util/json.c:91:6: enter_function: entry to ‘json_object_add_byte_array’
nvme-cli-2.15/util/json.c:97:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/util/json.c:102:27: branch_false: ...to here
nvme-cli-2.15/util/json.c:102:17: acquire_memory: allocated here
nvme-cli-2.15/util/json.c:104:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/util/json.c:109:9: branch_false: ...to here
nvme-cli-2.15/util/json.c:110:21: branch_false: following ‘false’ branch (when ‘i > len’)...
nvme-cli-2.15/util/json.c:113:9: branch_false: ...to here
nvme-cli-2.15/util/json.c:113:9: call_function: calling ‘json_object_add_value_string’ from ‘json_object_add_byte_array’
nvme-cli-2.15/util/json.c:113:9: danger: ‘calloc(1, (long unsigned int)((len + 1) * 2 + 1))’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  111|   		sprintf(&value[i * 2], "%02x", buf[len - i]);
#  112|   
#  113|-> 	json_object_add_value_string(o, k, value);
#  114|   }
#  115|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
nvme-cli-2.15/util/json.h:30:16: warning[-Wanalyzer-malloc-leak]: leak of ‘description_str’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:870:6: enter_function: entry to ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:889:20: branch_true: following ‘true’ branch (when ‘pevent_fifos_object’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: call_function: calling ‘json_add_formatted_u32_str’ from ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: return_function: returning to ‘parse_common_event’ from ‘json_add_formatted_u32_str’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:892:25: call_function: calling ‘json_object_add_value_string’ from ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:892:25: return_function: returning to ‘parse_common_event’ from ‘json_object_add_value_string’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:894:25: call_function: calling ‘json_add_formatted_var_size_str’ from ‘parse_common_event’
#   28|   static inline int json_object_add_value_string(struct json_object *o, const char *k, const char *v)
#   29|   {
#   30|-> 	return json_object_object_add(o, k, v ? json_object_new_string(v) : NULL);
#   31|   }
#   32|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
nvme-cli-2.15/util/json.h:30:49: warning[-Wanalyzer-malloc-leak]: leak of ‘description_str’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:870:6: enter_function: entry to ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:889:20: branch_true: following ‘true’ branch (when ‘pevent_fifos_object’ is non-NULL)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: call_function: calling ‘json_add_formatted_u32_str’ from ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:890:25: return_function: returning to ‘parse_common_event’ from ‘json_add_formatted_u32_str’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:892:25: call_function: calling ‘json_object_add_value_string’ from ‘parse_common_event’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:892:25: return_function: returning to ‘parse_common_event’ from ‘json_object_add_value_string’
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:894:25: call_function: calling ‘json_add_formatted_var_size_str’ from ‘parse_common_event’
#   28|   static inline int json_object_add_value_string(struct json_object *o, const char *k, const char *v)
#   29|   {
#   30|-> 	return json_object_object_add(o, k, v ? json_object_new_string(v) : NULL);
#   31|   }
#   32|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def232]
nvme-cli-2.15/util/json.h:37:16: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
nvme-cli-2.15/nvme-print-json.c:2123:14: enter_function: entry to ‘json_eom_printable_eye’
nvme-cli-2.15/nvme-print-json.c:2133:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2136:21: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2137:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2144:28: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2147:12: branch_false: following ‘false’ branch (when ‘printable’ is non-NULL)...
nvme-cli-2.15/nvme-print-json.c:2147:12: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2150:25: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2151:36: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2151:29: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:2153:20: branch_false: following ‘false’ branch (when ‘row’ is non-NULL)...
nvme-cli-2.15/nvme-print-json.c:2153:20: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2156:33: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2162:18: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2165:17: call_function: calling ‘json_array_add_value_string’ from ‘json_eom_printable_eye’
#   35|   static inline int json_array_add_value_string(struct json_object *o, const char *v)
#   36|   {
#   37|-> 	return json_object_array_add(o, v ? json_object_new_string(v) : NULL);
#   38|   }
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
nvme-cli-2.15/util/json.h:37:45: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
nvme-cli-2.15/nvme-print-json.c:2123:14: enter_function: entry to ‘json_eom_printable_eye’
nvme-cli-2.15/nvme-print-json.c:2133:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2136:21: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2137:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2144:28: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2147:12: branch_false: following ‘false’ branch (when ‘printable’ is non-NULL)...
nvme-cli-2.15/nvme-print-json.c:2147:12: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2150:25: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print-json.c:2151:36: branch_true: ...to here
nvme-cli-2.15/nvme-print-json.c:2151:29: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:2153:20: branch_false: following ‘false’ branch (when ‘row’ is non-NULL)...
nvme-cli-2.15/nvme-print-json.c:2153:20: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2156:33: branch_false: following ‘false’ branch...
nvme-cli-2.15/nvme-print-json.c:2162:18: branch_false: ...to here
nvme-cli-2.15/nvme-print-json.c:2165:17: call_function: calling ‘json_array_add_value_string’ from ‘json_eom_printable_eye’
#   35|   static inline int json_array_add_value_string(struct json_object *o, const char *v)
#   36|   {
#   37|-> 	return json_object_array_add(o, v ? json_object_new_string(v) : NULL);
#   38|   }
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def234]
nvme-cli-2.15/util/mem.c:34:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
nvme-cli-2.15/util/mem.c:27:7: enter_function: entry to ‘nvme_realloc’
nvme-cli-2.15/util/mem.c:31:24: call_function: calling ‘nvme_alloc’ from ‘nvme_realloc’
nvme-cli-2.15/util/mem.c:31:24: return_function: returning to ‘nvme_realloc’ from ‘nvme_alloc’
nvme-cli-2.15/util/mem.c:33:12: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
nvme-cli-2.15/util/mem.c:34:17: branch_true: ...to here
nvme-cli-2.15/util/mem.c:34:17: danger: argument 1 (‘nvme_alloc(len)’) NULL where non-null expected
#   32|   
#   33|   	if (p) {
#   34|-> 		memcpy(result, p, min(old_len, len));
#   35|   		free(p);
#   36|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
nvme-cli-2.15/util/utils.c:34:37: warning[-Wanalyzer-malloc-leak]: leak of ‘hex_to_ascii(&buffer)’
nvme-cli-2.15/util/utils.c:179:6: enter_function: entry to ‘process_field_size_8’
nvme-cli-2.15/util/utils.c:189:19: branch_true: following ‘true’ branch...
nvme-cli-2.15/util/utils.c:190:22: branch_true: ...to here
nvme-cli-2.15/util/utils.c:195:17: call_function: calling ‘hex_to_ascii’ from ‘process_field_size_8’
nvme-cli-2.15/util/utils.c:195:17: return_function: returning to ‘process_field_size_8’ from ‘hex_to_ascii’
nvme-cli-2.15/util/utils.c:34:37: danger: ‘hex_to_ascii(&buffer)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   32|   	if (hex_length > 0) {
#   33|   		int symbol_count;
#   34|-> 		int odd_hex_count = hex_length % 2 == 1;
#   35|   
#   36|   		if (odd_hex_count)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def236]
nvme-cli-2.15/util/utils.c:56:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘text’
nvme-cli-2.15/util/utils.c:179:6: enter_function: entry to ‘process_field_size_8’
nvme-cli-2.15/util/utils.c:189:19: branch_true: following ‘true’ branch...
nvme-cli-2.15/util/utils.c:190:22: branch_true: ...to here
nvme-cli-2.15/util/utils.c:195:17: call_function: calling ‘hex_to_ascii’ from ‘process_field_size_8’
#   54|   				int dec = hex_to_int(hex[0]);
#   55|   
#   56|-> 				text[0] = dec;
#   57|   			}
#   58|   		}

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-79.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namenvme-cli-2.15-2.fc43
store-results-to/tmp/tmpe_wrocd0/nvme-cli-2.15-2.fc43.tar.xz
time-created2026-01-08 19:43:37
time-finished2026-01-08 19:46:28
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpe_wrocd0/nvme-cli-2.15-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpe_wrocd0/nvme-cli-2.15-2.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9