Task #91648 - added.err

back to task #91648
download
Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1274:14: warning[-Wanalyzer-malloc-leak]: leak of ‘hdr’
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1264:15: acquire_memory: allocated here
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1266:12: branch_false: following ‘false’ branch...
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1272:9: branch_false: ...to here
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1274:14: throw: if ‘open’ throws an exception...
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1274:14: danger: ‘hdr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1272|   	memset(hdr, 0, bs);
# 1273|   
# 1274|-> 	fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
# 1275|   	if (fd < 0) {
# 1276|   		fprintf(stderr, "Failed to open output file %s: %s!\n",

Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1274:14: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1265:25: acquire_memory: allocated here
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1266:12: branch_false: following ‘false’ branch...
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1272:9: branch_false: ...to here
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1274:14: throw: if ‘open’ throws an exception...
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:1274:14: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1272|   	memset(hdr, 0, bs);
# 1273|   
# 1274|-> 	fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
# 1275|   	if (fd < 0) {
# 1276|   		fprintf(stderr, "Failed to open output file %s: %s!\n",

Error: GCC_ANALYZER_WARNING (CWE-775):
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:3005:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:3022:12: enter_function: entry to ‘set_error_injection’
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:3042:12: branch_false: following ‘false’ branch...
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:3051:16: branch_false: ...to here
nvme-cli-2.16/plugins/ocp/ocp-nvme.c:3052:16: call_function: calling ‘error_injection_set’ from ‘set_error_injection’
# 3003|   	args.data = entry;
# 3004|   
# 3005|-> 	err = nvme_set_features(&args);
# 3006|   	if (err) {
# 3007|   		if (err < 0)

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

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

Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:462:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:436:24: acquire_memory: allocated here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:437:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:442:9: branch_false: ...to here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:462:15: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:462:15: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  460|   		.result		= NULL,
#  461|   	};
#  462|-> 	ret = nvme_get_log(&args_len);
#  463|   	if (ret) {
#  464|   		fprintf(stderr,

Error: GCC_ANALYZER_WARNING (CWE-401):
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:500:23: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:436:24: acquire_memory: allocated here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:437:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:442:9: branch_false: ...to here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:463:12: branch_false: following ‘false’ branch...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:471:30: branch_false: ...to here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:473:12: branch_true: following ‘true’ branch...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:475:17: branch_true: ...to here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:476:24: acquire_memory: allocated here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:477:20: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:483:42: branch_false: ...to here
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:500:23: throw: if ‘nvme_get_log’ throws an exception...
nvme-cli-2.16/plugins/sandisk/sandisk-utils.c:500:23: danger: ‘data’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  498|   			.result		= NULL,
#  499|   		};
#  500|-> 		ret = nvme_get_log(&args_data);
#  501|   
#  502|   		if (ret) {