Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] selinux-3.10/sandbox/seunshare.c:753:20: warning[-Wanalyzer-malloc-leak]: leak of ‘new_pid_table’ selinux-3.10/sandbox/seunshare.c:726:12: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:730:21: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:731:12: branch_false: following ‘false’ branch (when ‘pid_table’ is non-NULL)... selinux-3.10/sandbox/seunshare.c:736:25: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:737:12: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:742:33: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:744:12: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:750:13: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:756:20: branch_false: following ‘false’ branch (when ‘pids != max_pids’)... selinux-3.10/sandbox/seunshare.c:772:27: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:756:20: branch_true: following ‘true’ branch (when ‘pids == max_pids’)... selinux-3.10/sandbox/seunshare.c:757:25: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:758:28: branch_false: following ‘false’ branch (when ‘pids < max_pids’)... selinux-3.10/sandbox/seunshare.c:764:48: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:764:48: acquire_memory: allocated here selinux-3.10/sandbox/seunshare.c:765:28: branch_false: following ‘false’ branch (when ‘new_pid_table’ is non-NULL)... selinux-3.10/sandbox/seunshare.c:772:27: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:753:20: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:756:20: branch_true: following ‘true’ branch (when ‘pids == max_pids’)... selinux-3.10/sandbox/seunshare.c:757:25: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:758:28: branch_false: following ‘false’ branch (when ‘pids < max_pids’)... selinux-3.10/sandbox/seunshare.c:764:48: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:765:28: branch_true: following ‘true’ branch (when ‘new_pid_table’ is NULL)... selinux-3.10/sandbox/seunshare.c:766:33: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:753:20: danger: ‘new_pid_table’ leaks here; was allocated at [(21)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/20) # 751| printf("mcs=%s type=%s\n", mcs, type); # 752| while ((de = readdir (dir)) != NULL) { # 753|-> if (!(pid = (pid_t)atoi(de->d_name)) || pid == self) # 754| continue; # 755| Error: GCC_ANALYZER_WARNING (CWE-762): [#def2] selinux-3.10/sandbox/seunshare.c:764:48: warning[-Wanalyzer-mismatching-deallocation]: ‘pid_table’ should have been deallocated with ‘free’ but was deallocated with ‘reallocarray’ selinux-3.10/sandbox/seunshare.c:726:12: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:730:21: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:730:21: acquire_memory: allocated here (expects deallocation with ‘free’) selinux-3.10/sandbox/seunshare.c:731:12: branch_false: following ‘false’ branch (when ‘pid_table’ is non-NULL)... selinux-3.10/sandbox/seunshare.c:736:25: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:737:12: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:742:33: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:744:12: branch_false: following ‘false’ branch... selinux-3.10/sandbox/seunshare.c:750:13: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:756:20: branch_false: following ‘false’ branch (when ‘pids != max_pids’)... selinux-3.10/sandbox/seunshare.c:772:27: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:752:16: branch_true: following ‘true’ branch... selinux-3.10/sandbox/seunshare.c:753:41: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:756:20: branch_true: following ‘true’ branch (when ‘pids == max_pids’)... selinux-3.10/sandbox/seunshare.c:757:25: branch_true: ...to here selinux-3.10/sandbox/seunshare.c:758:28: branch_false: following ‘false’ branch (when ‘pids < max_pids’)... selinux-3.10/sandbox/seunshare.c:764:48: branch_false: ...to here selinux-3.10/sandbox/seunshare.c:764:48: danger: deallocated with ‘reallocarray’ here; allocation at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) expects deallocation with ‘free’ # 762| return -1; # 763| } # 764|-> pid_t *new_pid_table = reallocarray(pid_table, max_pids, sizeof(pid_t)); # 765| if (!new_pid_table) { # 766| free(pid_table);
| analyzer-version-clippy | 1.95.0 |
| analyzer-version-cppcheck | 2.20.0 |
| analyzer-version-gcc | 16.1.1 |
| analyzer-version-gcc-analyzer | 16.1.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.95.0 |
| diffbase-analyzer-version-cppcheck | 2.20.0 |
| diffbase-analyzer-version-gcc | 16.1.1 |
| diffbase-analyzer-version-gcc-analyzer | 16.1.1 |
| 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-90.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.20260524.213755.g3c6d0be.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | policycoreutils-3.10-1.fc44 |
| diffbase-store-results-to | /tmp/tmpoflhj_xj/policycoreutils-3.10-1.fc44.tar.xz |
| diffbase-time-created | 2026-06-01 15:51:51 |
| diffbase-time-finished | 2026-06-01 15:53:54 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpoflhj_xj/policycoreutils-3.10-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpoflhj_xj/policycoreutils-3.10-1.fc44.src.rpm' |
| diffbase-tool-version | csmock-3.8.5.20260529.133039.g6f3b5c6-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-90.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.20260524.213755.g3c6d0be.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | policycoreutils-3.10-4.fc45 |
| store-results-to | /tmp/tmp31ss2m5t/policycoreutils-3.10-4.fc45.tar.xz |
| time-created | 2026-06-01 15:54:15 |
| time-finished | 2026-06-01 15:55:46 |
| title | Newly introduced findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmp31ss2m5t/policycoreutils-3.10-4.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp31ss2m5t/policycoreutils-3.10-4.fc45.src.rpm' |
| tool-version | csmock-3.8.5.20260529.133039.g6f3b5c6-1.el9 |