Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘hdr’ nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1255:15: acquire_memory: allocated here nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch... nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: throw: if ‘open’ throws an exception... nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: danger: ‘hdr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0) # 1264| # 1265| sprintf(file_path, DEFAULT_TELEMETRY_BIN); # 1266|-> fd = open(file_path, O_WRONLY | O_CREAT | O_TRUNC, 0666); # 1267| if (fd < 0) { # 1268| fprintf(stderr, "Failed to open output file %s: %s!\n", Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘telemetry_log’ nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1256:25: acquire_memory: allocated here nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1257:12: branch_false: following ‘false’ branch... nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1263:9: branch_false: ...to here nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: throw: if ‘open’ throws an exception... nvme-cli-2.15/plugins/ocp/ocp-nvme.c:1266:14: danger: ‘telemetry_log’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0) # 1264| # 1265| sprintf(file_path, DEFAULT_TELEMETRY_BIN); # 1266|-> fd = open(file_path, O_WRONLY | O_CREAT | O_TRUNC, 0666); # 1267| if (fd < 0) { # 1268| fprintf(stderr, "Failed to open output file %s: %s!\n", Error: GCC_ANALYZER_WARNING (CWE-775): [#def3] nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*options.output_file, "w")’ nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1526:12: branch_true: following ‘true’ branch... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: branch_true: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: acquire_resource: opened here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1529:20: branch_true: following ‘true’ branch... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1530:25: branch_true: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:28: branch_true: following ‘true’ branch (when the strings are equal)... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:37: branch_true: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:36: branch_false: following ‘false’ branch... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: branch_false: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: throw: if ‘generic_structure_parser’ throws an exception... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: danger: ‘fopen(*options.output_file, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2) # 1531| fprintf(fp, "%s\n", STR_LOG_PAGE_HEADER); # 1532| fprintf(fp, STR_LINE); # 1533|-> if (!strcmp(options->telemetry_type, "host")) { # 1534| if ((ptelemetry_buffer == NULL) || # 1535| (ARRAY_SIZE(host_log_page_header) == 0)) Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*options.output_file, "w")’ nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1526:12: branch_true: following ‘true’ branch... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: branch_true: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1527:28: acquire_memory: allocated here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1529:20: branch_true: following ‘true’ branch... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1530:25: branch_true: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:28: branch_true: following ‘true’ branch (when the strings are equal)... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:37: branch_true: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1534:36: branch_false: following ‘false’ branch... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: branch_false: ...to here nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1538:41: throw: if ‘generic_structure_parser’ throws an exception... nvme-cli-2.15/plugins/ocp/ocp-telemetry-decode.c:1533:37: danger: ‘fopen(*options.output_file, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2) # 1531| fprintf(fp, "%s\n", STR_LOG_PAGE_HEADER); # 1532| fprintf(fp, STR_LINE); # 1533|-> if (!strcmp(options->telemetry_type, "host")) { # 1534| if ((ptelemetry_buffer == NULL) || # 1535| (ARRAY_SIZE(host_log_page_header) == 0))
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.0 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.92.0 |
| diffbase-analyzer-version-cppcheck | 2.19.1 |
| diffbase-analyzer-version-gcc | 16.0.0 |
| diffbase-analyzer-version-gcc-analyzer | 16.0.0 |
| diffbase-analyzer-version-shellcheck | 0.11.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-79.us-west-2.compute.internal |
| diffbase-known-false-positives | /usr/share/csmock/known-false-positives.js |
| diffbase-known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | nvme-cli-2.16-1.fc44 |
| diffbase-store-results-to | /tmp/tmp0bc8olow/nvme-cli-2.16-1.fc44.tar.xz |
| diffbase-time-created | 2026-01-08 19:47:02 |
| diffbase-time-finished | 2026-01-08 19:49:23 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp0bc8olow/nvme-cli-2.16-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp0bc8olow/nvme-cli-2.16-1.fc44.src.rpm' |
| diffbase-tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-79.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | nvme-cli-2.15-2.fc43 |
| store-results-to | /tmp/tmpe_wrocd0/nvme-cli-2.15-2.fc43.tar.xz |
| time-created | 2026-01-08 19:43:37 |
| time-finished | 2026-01-08 19:46:28 |
| title | Fixed findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpe_wrocd0/nvme-cli-2.15-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpe_wrocd0/nvme-cli-2.15-2.fc43.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |