Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
tdb-1.4.14/common/mutex.c:807:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  805|   		 * exit.
#  806|   		 */
#  807|-> 		pid = waitpid(*child_pid, NULL, options);
#  808|   		if (pid == -1) {
#  809|   			if (errno == EINTR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
tdb-1.4.14/common/mutex.c:807:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tdb’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  805|   		 * exit.
#  806|   		 */
#  807|-> 		pid = waitpid(*child_pid, NULL, options);
#  808|   		if (pid == -1) {
#  809|   			if (errno == EINTR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
tdb-1.4.14/common/mutex.c:904:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  902|   	if (tdb_robust_mutex_pid == 0) {
#  903|   		size_t nwritten;
#  904|-> 		close(pipe_down[1]);
#  905|   		close(pipe_up[0]);
#  906|   		ret = pthread_mutex_lock(m);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
tdb-1.4.14/common/mutex.c:904:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tdb’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  902|   	if (tdb_robust_mutex_pid == 0) {
#  903|   		size_t nwritten;
#  904|-> 		close(pipe_down[1]);
#  905|   		close(pipe_up[0]);
#  906|   		ret = pthread_mutex_lock(m);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
tdb-1.4.14/common/mutex.c:905:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  903|   		size_t nwritten;
#  904|   		close(pipe_down[1]);
#  905|-> 		close(pipe_up[0]);
#  906|   		ret = pthread_mutex_lock(m);
#  907|   		nwritten = write(pipe_up[1], &ret, sizeof(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
tdb-1.4.14/common/mutex.c:905:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tdb’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  903|   		size_t nwritten;
#  904|   		close(pipe_down[1]);
#  905|-> 		close(pipe_up[0]);
#  906|   		ret = pthread_mutex_lock(m);
#  907|   		nwritten = write(pipe_up[1], &ret, sizeof(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
tdb-1.4.14/common/mutex.c:924:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  922|   		goto cleanup;
#  923|   	}
#  924|-> 	close(pipe_down[0]);
#  925|   	pipe_down[0] = -1;
#  926|   	close(pipe_up[1]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
tdb-1.4.14/common/mutex.c:924:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tdb’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  922|   		goto cleanup;
#  923|   	}
#  924|-> 	close(pipe_down[0]);
#  925|   	pipe_down[0] = -1;
#  926|   	close(pipe_up[1]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
tdb-1.4.14/common/mutex.c:926:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  924|   	close(pipe_down[0]);
#  925|   	pipe_down[0] = -1;
#  926|-> 	close(pipe_up[1]);
#  927|   	pipe_up[1] = -1;
#  928|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
tdb-1.4.14/common/mutex.c:926:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tdb’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#  924|   	close(pipe_down[0]);
#  925|   	pipe_down[0] = -1;
#  926|-> 	close(pipe_up[1]);
#  927|   	pipe_up[1] = -1;
#  928|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
tdb-1.4.14/test/run-mutex-die.c:71:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe_down[0]’
tdb-1.4.14/common/mutex.c:829:15: enter_function: entry to ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:844:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:848:9: branch_false: ...to here
tdb-1.4.14/common/mutex.c:851:12: branch_true: following ‘true’ branch...
tdb-1.4.14/common/mutex.c:855:9: branch_true: ...to here
tdb-1.4.14/common/mutex.c:859:12: branch_false: following ‘false’ branch (when ‘ptr != 18446744073709551615’)...
tdb-1.4.14/common/mutex.c:863:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:864:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:867:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:868:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:872:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:873:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:877:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:878:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:881:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:882:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:885:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:886:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:889:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:890:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:895:13: branch_false: ...to here
tdb-1.4.14/common/mutex.c:895:13: call_function: calling ‘tdb_robust_mutex_setup_sigchild’ from ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:895:13: return_function: returning to ‘tdb_runtime_check_for_robust_mutexes’ from ‘tdb_robust_mutex_setup_sigchild’
tdb-1.4.14/common/mutex.c:902:12: branch_true: following ‘true’ branch...
tdb-1.4.14/common/mutex.c:904:17: branch_true: ...to here
tdb-1.4.14/common/mutex.c:907:28: call_function: calling ‘write_check’ from ‘tdb_runtime_check_for_robust_mutexes’
#   69|   	maybe_die(fd);
#   70|   
#   71|-> 	ret = write(fd, buf, count);
#   72|   	if (ret != count)
#   73|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
tdb-1.4.14/test/run-mutex-die.c:71:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe_down[1]’
tdb-1.4.14/common/mutex.c:829:15: enter_function: entry to ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:844:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:848:9: branch_false: ...to here
tdb-1.4.14/common/mutex.c:851:12: branch_true: following ‘true’ branch...
tdb-1.4.14/common/mutex.c:855:9: branch_true: ...to here
tdb-1.4.14/common/mutex.c:859:12: branch_false: following ‘false’ branch (when ‘ptr != 18446744073709551615’)...
tdb-1.4.14/common/mutex.c:863:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:864:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:867:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:868:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:872:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:873:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:877:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:878:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:881:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:882:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:885:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:886:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:889:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:890:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:895:13: branch_false: ...to here
tdb-1.4.14/common/mutex.c:895:13: call_function: calling ‘tdb_robust_mutex_setup_sigchild’ from ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:895:13: return_function: returning to ‘tdb_runtime_check_for_robust_mutexes’ from ‘tdb_robust_mutex_setup_sigchild’
tdb-1.4.14/common/mutex.c:902:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:921:12: branch_false: ...to here
tdb-1.4.14/common/mutex.c:921:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:924:9: branch_false: ...to here
tdb-1.4.14/common/mutex.c:930:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:934:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:935:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:942:13: branch_false: ...to here
tdb-1.4.14/common/mutex.c:942:13: call_function: calling ‘write_check’ from ‘tdb_runtime_check_for_robust_mutexes’
#   69|   	maybe_die(fd);
#   70|   
#   71|-> 	ret = write(fd, buf, count);
#   72|   	if (ret != count)
#   73|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
tdb-1.4.14/test/run-mutex-die.c:71:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe_up[0]’
tdb-1.4.14/common/mutex.c:829:15: enter_function: entry to ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:844:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:848:9: branch_false: ...to here
tdb-1.4.14/common/mutex.c:851:12: branch_true: following ‘true’ branch...
tdb-1.4.14/common/mutex.c:855:9: branch_true: ...to here
tdb-1.4.14/common/mutex.c:859:12: branch_false: following ‘false’ branch (when ‘ptr != 18446744073709551615’)...
tdb-1.4.14/common/mutex.c:863:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:864:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:867:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:868:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:872:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:873:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:877:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:878:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:881:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:882:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:885:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:886:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:889:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:890:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:895:13: branch_false: ...to here
tdb-1.4.14/common/mutex.c:895:13: call_function: calling ‘tdb_robust_mutex_setup_sigchild’ from ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:895:13: return_function: returning to ‘tdb_runtime_check_for_robust_mutexes’ from ‘tdb_robust_mutex_setup_sigchild’
tdb-1.4.14/common/mutex.c:902:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:921:12: branch_false: ...to here
tdb-1.4.14/common/mutex.c:921:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:924:9: branch_false: ...to here
tdb-1.4.14/common/mutex.c:930:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:934:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:935:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:942:13: branch_false: ...to here
tdb-1.4.14/common/mutex.c:942:13: call_function: calling ‘write_check’ from ‘tdb_runtime_check_for_robust_mutexes’
#   69|   	maybe_die(fd);
#   70|   
#   71|-> 	ret = write(fd, buf, count);
#   72|   	if (ret != count)
#   73|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
tdb-1.4.14/test/run-mutex-die.c:71:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe_up[1]’
tdb-1.4.14/common/mutex.c:829:15: enter_function: entry to ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:844:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:848:9: branch_false: ...to here
tdb-1.4.14/common/mutex.c:851:12: branch_true: following ‘true’ branch...
tdb-1.4.14/common/mutex.c:855:9: branch_true: ...to here
tdb-1.4.14/common/mutex.c:859:12: branch_false: following ‘false’ branch (when ‘ptr != 18446744073709551615’)...
tdb-1.4.14/common/mutex.c:863:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:864:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:867:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:868:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:872:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:873:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:877:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:878:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:881:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:882:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:885:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:886:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:889:15: branch_false: ...to here
tdb-1.4.14/common/mutex.c:890:12: branch_false: following ‘false’ branch...
tdb-1.4.14/common/mutex.c:895:13: branch_false: ...to here
tdb-1.4.14/common/mutex.c:895:13: call_function: calling ‘tdb_robust_mutex_setup_sigchild’ from ‘tdb_runtime_check_for_robust_mutexes’
tdb-1.4.14/common/mutex.c:895:13: return_function: returning to ‘tdb_runtime_check_for_robust_mutexes’ from ‘tdb_robust_mutex_setup_sigchild’
tdb-1.4.14/common/mutex.c:902:12: branch_true: following ‘true’ branch...
tdb-1.4.14/common/mutex.c:904:17: branch_true: ...to here
tdb-1.4.14/common/mutex.c:907:28: call_function: calling ‘write_check’ from ‘tdb_runtime_check_for_robust_mutexes’
#   69|   	maybe_die(fd);
#   70|   
#   71|-> 	ret = write(fd, buf, count);
#   72|   	if (ret != count)
#   73|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
tdb-1.4.14/test/run-mutex-die.c:71:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#   69|   	maybe_die(fd);
#   70|   
#   71|-> 	ret = write(fd, buf, count);
#   72|   	if (ret != count)
#   73|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
tdb-1.4.14/test/run-mutex-die.c:71:15: warning[-Wanalyzer-malloc-leak]: leak of ‘tdb’
tdb-1.4.14/test/run-mutex-die.c:138:13: enter_function: entry to ‘prep_db’
tdb-1.4.14/test/run-mutex-die.c:150:15: call_function: calling ‘tdb_open_ex’ from ‘prep_db’
#   69|   	maybe_die(fd);
#   70|   
#   71|-> 	ret = write(fd, buf, count);
#   72|   	if (ret != count)
#   73|   		return ret;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-119.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibtdb-1.4.14-3.fc44
diffbase-store-results-to/tmp/tmp8ah2860h/libtdb-1.4.14-3.fc44.tar.xz
diffbase-time-created2026-01-08 19:17:19
diffbase-time-finished2026-01-08 19:21:31
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp8ah2860h/libtdb-1.4.14-3.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp8ah2860h/libtdb-1.4.14-3.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-119.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibtdb-1.4.14-3.fc43
store-results-to/tmp/tmpbiug2oxn/libtdb-1.4.14-3.fc43.tar.xz
time-created2026-01-08 19:12:11
time-finished2026-01-08 19:16:51
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpbiug2oxn/libtdb-1.4.14-3.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpbiug2oxn/libtdb-1.4.14-3.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9