nvme-cli-2.15-2.fc44

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...
 branch_false: ...to here
nvme-cli-2.15/fabrics.c:675:23: danger: ‘opendir("/usr/run/nvme")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/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:55:24: 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’
#   53|   	count = scandir(path, &dent, nbft_filter, NULL);
#   54|   	if (count < 0)
#   55|-> 		return -errno;
#   56|   
#   57|   	for (i = 0; i < count; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
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): [#def4]
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): [#def5]
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-775): [#def6]
nvme-cli-2.15/nvme-models.c:244:14: 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’
#  242|   	char *new;
#  243|   	int fd, ret = 0, len;
#  244|-> 	fd = open(where, O_RDONLY);
#  245|   	if (fd < 0) {
#  246|   		fprintf(stderr, "Failed to open %s with errno %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
nvme-cli-2.15/nvme-models.c:244:14: 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’
#  242|   	char *new;
#  243|   	int fd, ret = 0, len;
#  244|-> 	fd = open(where, O_RDONLY);
#  245|   	if (fd < 0) {
#  246|   		fprintf(stderr, "Failed to open %s with errno %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
nvme-cli-2.15/nvme-models.c:260:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(where, 0)’
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’
#  258|   			new[0] = '\0';
#  259|   	}
#  260|-> 	close(fd);
#  261|   	return ret;
#  262|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
nvme-cli-2.15/nvme-models.c:260: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’
#  258|   			new[0] = '\0';
#  259|   	}
#  260|-> 	close(fd);
#  261|   	return ret;
#  262|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
nvme-cli-2.15/nvme-models.c:260: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’
#  258|   			new[0] = '\0';
#  259|   	}
#  260|-> 	close(fd);
#  261|   	return ret;
#  262|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
nvme-cli-2.15/nvme-print-json.c:5157:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(key)’
nvme-cli-2.15/nvme-print-json.c:5171:13: enter_function: entry to ‘json_output_key_value’
nvme-cli-2.15/nvme-print-json.c:5176:41: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:5176:41: call_function: calling ‘trim_white_space’ from ‘json_output_key_value’
# 5155|   
# 5156|   	/* All spaces */
# 5157|-> 	if (!*str)
# 5158|   		return str;
# 5159|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
nvme-cli-2.15/nvme-print-json.c:5166:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(key)’
nvme-cli-2.15/nvme-print-json.c:5171:13: enter_function: entry to ‘json_output_key_value’
nvme-cli-2.15/nvme-print-json.c:5176:41: acquire_memory: allocated here
nvme-cli-2.15/nvme-print-json.c:5176:41: call_function: calling ‘trim_white_space’ from ‘json_output_key_value’
# 5164|   
# 5165|   	/* Write new null terminator character */
# 5166|-> 	end[1] = '\0';
# 5167|   
# 5168|   	return str;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
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)...
 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): [#def14]
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: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:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/nvme-print.c:1582:23: call_function: inlined call to ‘nvme_print_ops’ from ‘nvme_show_perror’
#   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): [#def15]
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: 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): [#def16]
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: 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): [#def17]
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: 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): [#def18]
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: 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): [#def19]
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: 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): [#def20]
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: 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): [#def21]
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: 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): [#def22]
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: 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): [#def23]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def24]
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...
 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:1025:52: branch_false: ...to here
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): [#def25]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def26]
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...
 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:1025:52: branch_false: ...to here
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): [#def27]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def28]
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...
 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:1025:52: branch_false: ...to here
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): [#def29]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def30]
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...
 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:1025:52: branch_false: ...to here
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): [#def31]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def32]
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...
 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:1025:52: branch_false: ...to here
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): [#def33]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def34]
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...
 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:1025:52: branch_false: ...to here
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): [#def35]
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...
 branch_false: ...to here
nvme-cli-2.15/nvme-rpmb.c:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def36]
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...
 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:1025:52: branch_false: ...to here
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): [#def37]
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): [#def38]
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...
 branch_false: ...to here
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): [#def39]
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...
 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:1025:52: branch_false: ...to here
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): [#def40]
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:982:31: call_function: calling ‘rpmb_read_write_counter’ 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): [#def41]
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:982:31: call_function: calling ‘rpmb_read_write_counter’ from ‘rpmb_cmd_option’
#  125|   	close(outfd);
#  126|   out_close_infd:
#  127|-> 	close(infd);
#  128|   
#  129|   	return hash;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
nvme-cli-2.15/nvme-rpmb.c:171:19: 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’
#  169|   	if (file == NULL) return err;
#  170|   
#  171|-> 	if ((fd = open(file, O_RDONLY)) < 0) {
#  172|   		fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno));
#  173|   		return fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
nvme-cli-2.15/nvme-rpmb.c:178: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’
#  176|   	err = fstat(fd, &sb);
#  177|   	if (err < 0) {
#  178|-> 		perror("fstat");
#  179|   		goto out;
#  180|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
nvme-cli-2.15/nvme-rpmb.c:201:9: 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’
#  199|   	err = 0;
#  200|   out:
#  201|-> 	close(fd);
#  202|   	return err;
#  203|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
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:1025:52: branch_false: ...to here
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-401): [#def46]
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-126): [#def47]
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)...
 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:340:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/huawei/huawei-nvme.c:345:59: branch_false: ...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): [#def48]
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)...
 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: 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): [#def49]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:36:16: 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’
#   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-775): [#def50]
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_false: following ‘false’ branch (when ‘itotal != 0’)...
 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:312:32: branch_true: following ‘true’ branch (when ‘itotal > icur’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:313:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:314:28: branch_true: following ‘true’ branch (when ‘busevsc != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:315:36: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:315:36: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:322:47: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:322:47: call_function: calling ‘nvme_vucmd’ from ‘innogrit_vsc_getcdump’
#   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): [#def51]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:36:16: 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’
#   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): [#def52]
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_false: following ‘false’ branch (when ‘itotal != 0’)...
 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:312:32: branch_true: following ‘true’ branch (when ‘itotal > icur’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:313:25: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:314:28: branch_true: following ‘true’ branch (when ‘busevsc != 0’)...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:315:36: branch_true: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:315:36: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:322:47: branch_false: ...to here
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:322:47: call_function: calling ‘nvme_vucmd’ from ‘innogrit_vsc_getcdump’
#   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-775): [#def53]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:59:16: 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’
#   57|   		.result		= result,
#   58|   	};
#   59|-> 	return nvme_get_log(&args);
#   60|   }
#   61|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:59:16: 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’
#   57|   		.result		= result,
#   58|   	};
#   59|-> 	return nvme_get_log(&args);
#   60|   }
#   61|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def55]
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): [#def56]
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): [#def57]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:241:24: 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:241:24: danger: ‘fp’ leaks here; was opened at [(17)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/16)
#  239|   	ret = parse_and_open(&dev, argc, argv, desc, opts);
#  240|   	if (ret)
#  241|-> 		return ret;
#  242|   
#  243|   	ivsctype = getvsctype(dev);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
nvme-cli-2.15/plugins/innogrit/innogrit-nvme.c:241:24: 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:241:24: danger: ‘fp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/16)
#  239|   	ret = parse_and_open(&dev, argc, argv, desc, opts);
#  240|   	if (ret)
#  241|-> 		return ret;
#  242|   
#  243|   	ivsctype = getvsctype(dev);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def59]
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’)...
 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/13/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): [#def60]
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’)...
 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: danger: ‘fp’ leaks here; was opened at [(17)](sarif:/runs/0/results/14/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): [#def61]
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’)...
 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: danger: ‘fp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/15/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): [#def62]
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): [#def63]
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): [#def64]
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): [#def65]
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): [#def66]
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): [#def67]
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): [#def68]
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: danger: ‘intel’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/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): [#def69]
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: danger: ‘intel’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/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): [#def70]
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/10/codeFlows/0/threadFlows/0/locations/1) could be NULL where non-null expected
#argument 1 of ‘__builtin_memcpy’ must be non-null
# 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): [#def71]
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: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/11/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): [#def72]
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: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/12/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): [#def73]
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: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/14/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): [#def74]
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:1526:9: danger: ‘intel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/16/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-688): [#def75]
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): [#def76]
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): [#def77]
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: 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): [#def78]
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: 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): [#def79]
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: 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): [#def80]
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: 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): [#def81]
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: 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): [#def82]
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: 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): [#def83]
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: 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): [#def84]
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: 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): [#def85]
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: 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): [#def86]
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: 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): [#def87]
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: 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): [#def88]
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: 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): [#def89]
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: 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): [#def90]
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: 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): [#def91]
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: 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): [#def92]
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: 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): [#def93]
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: 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): [#def94]
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: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: danger: ‘raw’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
#  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): [#def95]
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: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: danger: ‘raw’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  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): [#def96]
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: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: danger: ‘raw’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
#  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): [#def97]
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: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: danger: ‘raw’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
#  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): [#def98]
nvme-cli-2.15/plugins/memblaze/memblaze-nvme.c:391:32: 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’
#  389|   			printf("No enough parameters. abort...\n");
#  390|   			va_end(argp);
#  391|-> 			return 1;
#  392|   		}
#  393|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
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:754:15: call_function: inlined call to ‘nvme_get_log_simple’ from ‘mb_high_latency_log_print’
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): [#def100]
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:754:15: call_function: inlined call to ‘nvme_get_log_simple’ from ‘mb_high_latency_log_print’
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): [#def101]
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): [#def102]
nvme-cli-2.15/plugins/micron/micron-nvme.c:143:12: 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:143:12: danger: ‘open(file, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  141|   	ret = read(fd, idstr, sizeof(idstr));
#  142|   	close(fd);
#  143|-> 	if (ret < 0)
#  144|   		perror("read");
#  145|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
nvme-cli-2.15/plugins/micron/micron-nvme.c:471:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pBuffer’
nvme-cli-2.15/plugins/micron/micron-nvme.c:482:12: enter_function: entry to ‘NVMEResetLog’
nvme-cli-2.15/plugins/micron/micron-nvme.c:488:35: acquire_memory: allocated here
nvme-cli-2.15/plugins/micron/micron-nvme.c:489:12: branch_false: following ‘false’ branch (when ‘pBuffer’ is non-NULL)...
 branch_false: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:492:16: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/micron/micron-nvme.c:493:23: branch_true: ...to here
nvme-cli-2.15/plugins/micron/micron-nvme.c:493:23: call_function: calling ‘NVMEGetLogPage’ from ‘NVMEResetLog’
#  469|   		cmd.nsid = 0xFFFFFFFF;
#  470|   		cmd.data_len = uiXferDwords * 4;
#  471|-> 		err = nvme_submit_admin_passthru(nFD, &cmd, NULL);
#  472|   		ullBytesRead += uiXferDwords * 4;
#  473|   		if (ucLogID == 0x07 || ucLogID == 0x08 || ucLogID == 0xE9)

Error: GCC_ANALYZER_WARNING (CWE-131): [#def104]
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): [#def105]
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): [#def106]
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)...
 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: 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): [#def107]
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)...
 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: 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: [#def108]
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): [#def109]
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): [#def110]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:744:16: warning[-Wanalyzer-malloc-leak]: leak of ‘da1_fifo’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:945:12: enter_function: entry to ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:980:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:985:12: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:991:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: call_function: calling ‘print_telemetry_data_area_1’ from ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: return_function: returning to ‘get_telemetry_dump’ from ‘print_telemetry_data_area_1’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1047:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1048:22: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1048:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1058:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1065:28: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1082:42: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1086:31: call_function: calling ‘get_telemetry_data’ from ‘get_telemetry_dump’
#  742|   	cmd.cdw13 = (__u32)((0xFFFFFFFF00000000 & offset) >> 8);
#  743|   	cmd.cdw14 = 0;
#  744|-> 	return nvme_submit_admin_passthru(dev_fd(dev), &cmd, NULL);
#  745|   }
#  746|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:744:16: warning[-Wanalyzer-malloc-leak]: leak of ‘da1_stat’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:945:12: enter_function: entry to ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:980:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:985:12: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:991:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: call_function: calling ‘print_telemetry_data_area_1’ from ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: return_function: returning to ‘get_telemetry_dump’ from ‘print_telemetry_data_area_1’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:999:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1001:17: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1009:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1016:20: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1033:34: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1035:23: call_function: calling ‘get_telemetry_data’ from ‘get_telemetry_dump’
#  742|   	cmd.cdw13 = (__u32)((0xFFFFFFFF00000000 & offset) >> 8);
#  743|   	cmd.cdw14 = 0;
#  744|-> 	return nvme_submit_admin_passthru(dev_fd(dev), &cmd, NULL);
#  745|   }
#  746|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:744:16: warning[-Wanalyzer-malloc-leak]: leak of ‘da2_stat’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:945:12: enter_function: entry to ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:980:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:985:12: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:991:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: call_function: calling ‘print_telemetry_data_area_1’ from ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: return_function: returning to ‘get_telemetry_dump’ from ‘print_telemetry_data_area_1’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1047:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1048:22: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1100:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1101:39: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1107:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1117:30: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1117:28: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1125:20: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1141:34: acquire_memory: allocated here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1143:23: call_function: calling ‘get_telemetry_data’ from ‘get_telemetry_dump’
#  742|   	cmd.cdw13 = (__u32)((0xFFFFFFFF00000000 & offset) >> 8);
#  743|   	cmd.cdw14 = 0;
#  744|-> 	return nvme_submit_admin_passthru(dev_fd(dev), &cmd, NULL);
#  745|   }
#  746|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
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:945:12: enter_function: entry to ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:980:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:985:12: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:991:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: call_function: calling ‘print_telemetry_data_area_1’ from ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: return_function: returning to ‘get_telemetry_dump’ from ‘print_telemetry_data_area_1’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1047:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1048:22: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1155:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1156:22: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1228:12: branch_false: following ‘false’ branch (when ‘size != 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1233:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1234:15: call_function: calling ‘extract_dump_get_log’ from ‘get_telemetry_dump’
#  904|   		};
#  905|   
#  906|-> 		err = nvme_get_log(&args);
#  907|   		if (err) {
#  908|   			if (i > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
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:945:12: enter_function: entry to ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:980:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:985:12: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:991:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: call_function: calling ‘print_telemetry_data_area_1’ from ‘get_telemetry_dump’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:996:9: return_function: returning to ‘get_telemetry_dump’ from ‘print_telemetry_data_area_1’
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1047:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1048:22: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1155:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1156:22: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1228:12: branch_false: following ‘false’ branch (when ‘size != 0’)...
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1233:9: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1234:15: call_function: calling ‘extract_dump_get_log’ from ‘get_telemetry_dump’
#  936|   
#  937|   close_output:
#  938|-> 	close(output);
#  939|   
#  940|   end:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
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: 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): [#def116]
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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/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): [#def117]
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: 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): [#def118]
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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/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): [#def119]
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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/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): [#def120]
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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/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): [#def121]
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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/16/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): [#def122]
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_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:1301:15: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/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): [#def123]
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_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: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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/18/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): [#def124]
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_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: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: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/19/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): [#def125]
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: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/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): [#def126]
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: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/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): [#def127]
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: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/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): [#def128]
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: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/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-401): [#def129]
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: 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): [#def130]
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’
#argument 1 of ‘__builtin_strcat’ must be non-null
#  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): [#def131]
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’
#argument 1 of ‘__builtin_memset’ must be non-null
#  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): [#def132]
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): [#def133]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: 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: danger: ‘fopen(*options.output_file, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1536|   					printf("skip generic_structure_parser\n");
# 1537|   				else
# 1538|-> 					generic_structure_parser(ptelemetry_buffer,
# 1539|   						host_log_page_header,
# 1540|   						ARRAY_SIZE(host_log_page_header),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: 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: danger: ‘fopen(*options.output_file, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1536|   					printf("skip generic_structure_parser\n");
# 1537|   				else
# 1538|-> 					generic_structure_parser(ptelemetry_buffer,
# 1539|   						host_log_page_header,
# 1540|   						ARRAY_SIZE(host_log_page_header),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def135]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1544:33: 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_false: following ‘false’ branch (when the strings are non-equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1543:35: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1543:33: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1544:33: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1544:33: danger: ‘fopen(*options.output_file, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 1542|   			}
# 1543|   			else if (!strcmp(options->telemetry_type, "controller"))
# 1544|-> 				generic_structure_parser(ptelemetry_buffer,
# 1545|   					controller_log_page_header,
# 1546|   					ARRAY_SIZE(controller_log_page_header), NULL, 0, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1544:33: 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_false: following ‘false’ branch (when the strings are non-equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1543:35: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1543:33: branch_true: following ‘true’ branch (when the strings are equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1544:33: branch_true: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1544:33: danger: ‘fopen(*options.output_file, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1542|   			}
# 1543|   			else if (!strcmp(options->telemetry_type, "controller"))
# 1544|-> 				generic_structure_parser(ptelemetry_buffer,
# 1545|   					controller_log_page_header,
# 1546|   					ARRAY_SIZE(controller_log_page_header), NULL, 0, fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def137]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1554:25: 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:1543:33: branch_false: following ‘false’ branch (when the strings are non-equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1547:25: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1554:25: danger: ‘fopen(*options.output_file, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 1552|   				reason_id);
# 1553|   
# 1554|-> 			generic_structure_parser(preason_identifier_offset, reason_identifier,
# 1555|   				ARRAY_SIZE(reason_identifier), NULL, 0, fp);
# 1556|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1554:25: 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:1543:33: branch_false: following ‘false’ branch (when the strings are non-equal)...
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1547:25: branch_false: ...to here
nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1554:25: danger: ‘fopen(*options.output_file, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1552|   				reason_id);
# 1553|   
# 1554|-> 			generic_structure_parser(preason_identifier_offset, reason_identifier,
# 1555|   				ARRAY_SIZE(reason_identifier), NULL, 0, fp);
# 1556|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
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): [#def140]
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:59:12: 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:59:12: danger: ‘open(&vid, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   57|   	close(fd);
#   58|   
#   59|-> 	if (ret < 0) {
#   60|   		fprintf(stderr, "%s: Read of pci vendor id failed\n", __func__);
#   61|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def141]
nvme-cli-2.15/plugins/sandisk/sandisk-utils.c:79:12: 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:79:12: danger: ‘open(&did, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   77|   	close(fd);
#   78|   
#   79|-> 	if (ret < 0) {
#   80|   		fprintf(stderr, "ERROR: SNDK: %s: Read of pci device id failed\n", __func__);
#   81|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
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): [#def143]
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: 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): [#def144]
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_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1285:28: branch_true: ...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: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 [(22)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/21)
# 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): [#def145]
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_true: following ‘true’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1285:28: branch_true: ...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: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 [(22)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/21)
# 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): [#def146]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1171:25: 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...
 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: danger: ‘fopen(output, "w+")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1169|   
# 1170|   			fw_time = ((__u64)info->time_stamp[2] << 32) + ((__u64)info->time_stamp[1] << 16) + (__u64)info->time_stamp[0];
# 1171|-> 			convert_ts(fw_time, str_buffer + str_pos);
# 1172|   			str_pos = strlen(str_buffer);
# 1173|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1171:25: 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...
 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: danger: ‘fopen(output, "w+")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1169|   
# 1170|   			fw_time = ((__u64)info->time_stamp[2] << 32) + ((__u64)info->time_stamp[1] << 16) + (__u64)info->time_stamp[0];
# 1171|-> 			convert_ts(fw_time, str_buffer + str_pos);
# 1172|   			str_pos = strlen(str_buffer);
# 1173|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def148]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1210:25: 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...
 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:1210:25: danger: ‘fopen(output, "w+")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1208|   
# 1209|   		if (!(offset % (log_len / 100)) || (offset == log_len))
# 1210|-> 			util_spinner("Parse", (float) (offset) / (float) (log_len));
# 1211|   	}
# 1212|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1210:25: 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...
 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:1210:25: danger: ‘fopen(output, "w+")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1208|   
# 1209|   		if (!(offset % (log_len / 100)) || (offset == log_len))
# 1210|-> 			util_spinner("Parse", (float) (offset) / (float) (log_len));
# 1211|   	}
# 1212|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def150]
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:1306:25: branch_true: ...to here
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): [#def151]
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:1306:25: branch_true: ...to here
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): [#def152]
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: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/14/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): [#def153]
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: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/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): [#def154]
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: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: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/16/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): [#def155]
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: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: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/17/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-775): [#def156]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1636:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1627:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1636:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1636:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
# 1634|   	len = read(fd, pci_vid, 6);
# 1635|   	if (len < 1) {
# 1636|-> 		perror("Could not read PCIe VID in /sys/");
# 1637|   		close(fd);
# 1638|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def157]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1643:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1627:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1643:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
# 1641|   	close(fd);
# 1642|   
# 1643|-> 	snprintf(path, 512, "/sys/class/nvme/%s/device/device", chr_dev);
# 1644|   	fd = open(path, O_RDONLY);
# 1645|   	if (fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def158]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1653:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1644:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1653:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1653:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/8)
# 1651|   	len = read(fd, pci_did, 6);
# 1652|   	if (len < 1) {
# 1653|-> 		perror("Could not read PCIe DID in /sys/");
# 1654|   		close(fd);
# 1655|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def159]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1660:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1644:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1660:13: danger: ‘open(&path, 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/8)
# 1658|   	close(fd);
# 1659|   
# 1660|-> 	if (strncmp("0xcc53", pci_vid, 6) == 0)
# 1661|   		strncpy(vendor, "ScaleFlux", 10);
# 1662|   	else if (strncmp("0x1dfd", pci_vid, 6) == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def160]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1680:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1671:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1680:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1680:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
# 1678|   	len = read(fd, pci_ssvid, 6);
# 1679|   	if (len < 1) {
# 1680|-> 		perror("could not read PCIe Subsystem Vendor ID in /sys/");
# 1681|   		close(fd);
# 1682|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def161]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1687:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1671:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1687:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(13)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/12)
# 1685|   	close(fd);
# 1686|   
# 1687|-> 	snprintf(path, 512, "/sys/class/nvme/%s/device/current_link_speed", chr_dev);
# 1688|   	fd = open(path, O_RDONLY);
# 1689|   	if (fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def162]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1697:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1688:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1697:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1697:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(17)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/16)
# 1695|   	len = read(fd, link_speed, 20);
# 1696|   	if (len < 1) {
# 1697|-> 		perror("Could not read link speed in /sys/");
# 1698|   		close(fd);
# 1699|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def163]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1688:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(17)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/16)
# 1700|   		goto close_dev;
# 1701|   	}
# 1702|-> 	close(fd);
# 1703|   	// Ending string before "PCIe" and newline
# 1704|   	for (len = 0; (len+2) < 20 && link_speed[len+2] != '\0'; ++len) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def164]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1719:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1710:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1719:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1719:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(23)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/22)
# 1717|   	len = read(fd, link_width, 5);
# 1718|   	if (len < 1) {
# 1719|-> 		perror("Could not read link width in /sys/");
# 1720|   		close(fd);
# 1721|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def165]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1709:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1710:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(25)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/24)
# 1722|   		goto close_dev;
# 1723|   	}
# 1724|-> 	close(fd);
# 1725|   	// Ending string before newline
# 1726|   	for (len = 0; (len) < 5 ; ++len) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def166]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1743:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1734:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1743:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1743:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(33)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/32)
# 1741|   	len = read(fd, numa_node, 5);
# 1742|   	if (len < 1) {
# 1743|-> 		perror("Could not read NUMA node in /sys/");
# 1744|   		close(fd);
# 1745|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def167]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1734:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(33)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/32)
# 1746|   		goto close_dev;
# 1747|   	}
# 1748|-> 	close(fd);
# 1749|   
# 1750|   	for (len = 0; len < 5; ++len) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def168]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1765:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1757:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1765:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1765:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(39)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/38)
# 1763|   	len = read(fd, path, 512);
# 1764|   	if (len < 1) {
# 1765|-> 		perror("Could not read PCIe AER Correctable errors in /sys/");
# 1766|   		close(fd);
# 1767|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def169]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1771:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:32: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1756:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1757:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1771:15: danger: ‘open(&path, 0)’ leaks here; was opened at [(43)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/42)
# 1769|   	}
# 1770|   	close(fd);
# 1771|-> 	len = sscanf(path, "%*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d TOTAL_ERR_COR %d", &pcie_correctable);
# 1772|   	len = 1;
# 1773|   	if (len < 1 || len == EOF) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def170]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1788:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:32: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1756:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1780:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1788:12: danger: ‘open(&path, 0)’ leaks here; was opened at [(47)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/46)
# 1786|   
# 1787|   	len = read(fd, path, 512);
# 1788|-> 	if (len < 1) {
# 1789|   		perror("Could not read PCIe AER Non-Fatal errors in /sys/");
# 1790|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def171]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1794:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:32: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1756:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1780:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1788:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1793:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1794:15: danger: ‘open(&path, 0)’ leaks here; was opened at [(47)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/46)
# 1792|   	}
# 1793|   	close(fd);
# 1794|-> 	len = sscanf(path, "%*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d TOTAL_ERR_NONFATAL %d", &pcie_nonfatal);
# 1795|   	if (len < 1) {
# 1796|   		perror("Could not parse PCIe AER Non-Fatal errors in /sys/");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def172]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1811:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1788:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1793:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1795:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1801:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1802:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1803:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1809:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1810:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1811:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1811:17: danger: ‘open(&path, 0)’ leaks here; was opened at [(49)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/48)
# 1809|   	len = read(fd, path, 512);
# 1810|   	if (len < 1) {
# 1811|-> 		perror("Could not read PCIe AER Fatal errors in /sys/");
# 1812|   		close(fd);
# 1813|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1816:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1788:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1793:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1795:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1801:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1802:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1803:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1809:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1810:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1816:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1816:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(49)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/48)
# 1814|   		goto close_dev;
# 1815|   	}
# 1816|-> 	close(fd);
# 1817|   	len = sscanf(path, "%*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d %*s %*d TOTAL_ERR_FATAL %d", &pcie_fatal);
# 1818|   	if (len < 1) {

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def174]
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1820:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(&path, 0)’
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1788:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1793:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1795:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1801:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1802:14: acquire_resource: opened here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1803:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1809:15: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1810:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1816:9: branch_false: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1816:9: release_resource: first ‘close’ here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1818:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1819:17: branch_true: ...to here
nvme-cli-2.15/plugins/scaleflux/sfx-nvme.c:1820:17: danger: second ‘close’ here; first ‘close’ was at [(55)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/54)
# 1818|   	if (len < 1) {
# 1819|   		perror("Could not parse PCIe AER Fatal errors in /sys/");
# 1820|-> 		close(fd);
# 1821|   		err = -1;
# 1822|   		goto close_dev;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
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: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:1697:23: danger: ‘log’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1695|   			.result     = NULL,
# 1696|   		};
# 1697|-> 		err = nvme_get_log(&args);
# 1698|   		if (!err) {
# 1699|   			offset += (__le64)bytesToGet;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
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: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:1816:23: danger: ‘log’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 1814|   			.result     = NULL,
# 1815|   		};
# 1816|-> 		err = nvme_get_log(&args);
# 1817|   		if (!err) {
# 1818|   			offset += (__le64)bytesToGet;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
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: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:1946:23: danger: ‘log’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 1944|   			.result     = NULL,
# 1945|   		};
# 1946|-> 		err = nvme_get_log(&args);
# 1947|   		if (!err) {
# 1948|   			offset += (__le64)bytesToGet;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def178]
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): [#def179]
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:308:24: 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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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:308:24: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  306|   	err = parse_and_open(&dev, argc, argv, desc, opts);
#  307|   	if (err)
#  308|-> 		return err;
#  309|   
#  310|   	if (!cfg.feature_id) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def180]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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/2/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: [#def181]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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/3/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): [#def182]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/4/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): [#def183]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/5/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): [#def184]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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: 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): [#def185]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/shannon/shannon-nvme.c:322:17: 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: 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): [#def186]
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/0/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): [#def187]
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: 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): [#def188]
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: 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): [#def189]
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: 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): [#def190]
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: 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): [#def191]
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: 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): [#def192]
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: 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: CPPCHECK_WARNING (CWE-457): [#def193]
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): [#def194]
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: 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): [#def195]
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: 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): [#def196]
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: 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): [#def197]
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: 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): [#def198]
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: 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): [#def199]
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: 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): [#def200]
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: 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): [#def201]
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: 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): [#def202]
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: 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): [#def203]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:410:17: 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: 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): [#def204]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:410:17: 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: 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): [#def205]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:410:17: 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: 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): [#def206]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:410:17: 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: 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): [#def207]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:410:17: 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: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: 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): [#def208]
nvme-cli-2.15/plugins/zns/zns.c:621:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:613:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  619|   
#  620|   	if (cfg.file) {
#  621|-> 		ffd = open(cfg.file, O_RDONLY);
#  622|   		if (ffd < 0) {
#  623|   			perror(cfg.file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
nvme-cli-2.15/plugins/zns/zns.c:623:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:613:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:623:32: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:623:25: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  621|   		ffd = open(cfg.file, O_RDONLY);
#  622|   		if (ffd < 0) {
#  623|-> 			perror(cfg.file);
#  624|   			err = -1;
#  625|   			goto free;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def210]
nvme-cli-2.15/plugins/zns/zns.c:631:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/zns/zns.c:631:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:631:17: danger: ‘ffd’ leaks here; was opened at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  629|   	err = read(ffd, (void *)buf, data_len);
#  630|   	if (err < 0) {
#  631|-> 		perror("read");
#  632|   		goto close_ffd;
#  633|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
nvme-cli-2.15/plugins/zns/zns.c:631:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:613:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.15/plugins/zns/zns.c:631:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:631:17: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  629|   	err = read(ffd, (void *)buf, data_len);
#  630|   	if (err < 0) {
#  631|-> 		perror("read");
#  632|   		goto close_ffd;
#  633|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def212]
nvme-cli-2.15/plugins/zns/zns.c:648:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:639:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:648:15: danger: ‘ffd’ leaks here; was opened at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
#  646|   		.result		= NULL,
#  647|   	};
#  648|-> 	err = nvme_zns_mgmt_send(&args);
#  649|   	if (!err)
#  650|   		printf("set-zone-desc: Success, zone:%"PRIx64" nsid:%d\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
nvme-cli-2.15/plugins/zns/zns.c:648:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:613:15: acquire_memory: allocated here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:639:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:648:15: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  646|   		.result		= NULL,
#  647|   	};
#  648|-> 	err = nvme_zns_mgmt_send(&args);
#  649|   	if (!err)
#  650|   		printf("set-zone-desc: Success, zone:%"PRIx64" nsid:%d\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def214]
nvme-cli-2.15/plugins/zns/zns.c:653:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:639:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:649:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:652:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:652:17: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:653:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:653:17: danger: ‘ffd’ leaks here; was opened at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  651|   		       (uint64_t)cfg.zslba, cfg.namespace_id);
#  652|   	else if (err > 0)
#  653|-> 		nvme_show_status(err);
#  654|   	else
#  655|   		perror("zns set-zone-desc");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def215]
nvme-cli-2.15/plugins/zns/zns.c:655:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:639:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:649:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:652:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:652:17: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:655:17: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:655:17: danger: ‘ffd’ leaks here; was opened at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
#  653|   		nvme_show_status(err);
#  654|   	else
#  655|-> 		perror("zns set-zone-desc");
#  656|   close_ffd:
#  657|   	if (cfg.file)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def216]
nvme-cli-2.15/plugins/zns/zns.c:658:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:639:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:649:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:650:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:657:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:658:17: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:658:17: danger: ‘ffd’ leaks here; was opened at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#  656|   close_ffd:
#  657|   	if (cfg.file)
#  658|-> 		close(ffd);
#  659|   free:
#  660|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def217]
nvme-cli-2.15/plugins/zns/zns.c:662:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.15/plugins/zns/zns.c:592:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:595:14: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:605:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:613:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:614:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.15/plugins/zns/zns.c:620:13: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:620:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:621:23: branch_true: ...to here
nvme-cli-2.15/plugins/zns/zns.c:621:23: acquire_resource: opened here
nvme-cli-2.15/plugins/zns/zns.c:622:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:629:15: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:630:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
nvme-cli-2.15/plugins/zns/zns.c:639:35: branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:657:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:662:9: danger: ‘ffd’ leaks here; was opened at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
#  660|   	free(buf);
#  661|   close_dev:
#  662|-> 	dev_close(dev);
#  663|   	return err;
#  664|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
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: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/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): [#def219]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/16/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): [#def220]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/17/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): [#def221]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/18/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): [#def222]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1155:17: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/20/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): [#def223]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1155:17: 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: danger: ‘mfd’ leaks here; was opened at [(19)](sarif:/runs/0/results/19/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): [#def224]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/21/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): [#def225]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/22/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): [#def226]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/23/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): [#def227]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/24/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): [#def228]
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
 branch_true: following ‘true’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1131:9: 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
 branch_false: following ‘false’ branch...
nvme-cli-2.15/plugins/zns/zns.c:1149:25: 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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/25/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): [#def229]
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: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/26/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): [#def230]
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...
 branch_false: ...to here
nvme-cli-2.15/plugins/zns/zns.c:1215:9: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/27/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-775): [#def231]
nvme-cli-2.15/util/cleanup.h:34:12: 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: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:175:26: call_function: inlined call to ‘cleanup_fd’ from ‘perfc_set’
 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’
#   32|   static inline void cleanup_fd(int *fd)
#   33|   {
#   34|-> 	if (*fd > STDERR_FILENO)
#   35|   		close(*fd);
#   36|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def232]
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: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: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-910): [#def233]
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): [#def234]
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-401): [#def235]
nvme-cli-2.15/util/cleanup.h:55:15: warning[-Wanalyzer-malloc-leak]: leak of ‘argv’
nvme-cli-2.15/fabrics.c:708:5: enter_function: entry to ‘nvmf_discover’
nvme-cli-2.15/fabrics.c:751:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:754:15: branch_false: ...to here
nvme-cli-2.15/fabrics.c:755:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:760:14: branch_false: ...to here
nvme-cli-2.15/fabrics.c:766:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:771:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:781:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:787:15: branch_false: ...to here
nvme-cli-2.15/fabrics.c:788:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:791:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:792:12: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:797:13: branch_false: ...to here
nvme-cli-2.15/fabrics.c:806:12: branch_true: following ‘true’ branch...
nvme-cli-2.15/fabrics.c:811:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:814:20: branch_false: ...to here
nvme-cli-2.15/fabrics.c:814:20: branch_false: following ‘false’ branch (when ‘json_config == 0’)...
nvme-cli-2.15/fabrics.c:818:20: branch_false: ...to here
nvme-cli-2.15/fabrics.c:818:20: branch_false: following ‘false’ branch...
nvme-cli-2.15/fabrics.c:821:23: call_function: calling ‘discover_from_conf_file’ from ‘nvmf_discover’
#   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): [#def236]
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): [#def237]
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-476): [#def238]
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|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
nvme-cli-2.15/util/utils.c:208:1: 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:208:1: danger: ‘hex_to_ascii(&buffer)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  206|   		sprintf(datastr, "0x%"PRIx64"", le64_to_cpu(lval_lo));
#  207|   	}
#  208|-> }
#  209|   
#  210|   void process_field_size_7(int offset, char *sfield, __u8 *buf, char *datastr)

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-156.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-gcc-latest-x86_64
project-namenvme-cli-2.15-2.fc44
store-results-to/tmp/tmp554iva4q/nvme-cli-2.15-2.fc44.tar.xz
time-created2025-10-28 19:29:19
time-finished2025-10-28 19:31:51
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp554iva4q/nvme-cli-2.15-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp554iva4q/nvme-cli-2.15-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9