conmon-2.1.10-1.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘process_cgroup_subsystem_path’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:57:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("/proc/%d/cgroup", pid), "re")’
#   55|   {
#   56|   	_cleanup_free_ char *cgroups_file_path = g_strdup_printf("/proc/%d/cgroup", pid);
#   57|-> 	_cleanup_fclose_ FILE *fp = fopen(cgroups_file_path, "re");
#   58|   	if (fp == NULL) {
#   59|   		nwarnf("Failed to open cgroups file: %s", cgroups_file_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:57:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("/proc/%d/cgroup", pid), "re")’
#   55|   {
#   56|   	_cleanup_free_ char *cgroups_file_path = g_strdup_printf("/proc/%d/cgroup", pid);
#   57|-> 	_cleanup_fclose_ FILE *fp = fopen(cgroups_file_path, "re");
#   58|   	if (fp == NULL) {
#   59|   		nwarnf("Failed to open cgroups file: %s", cgroups_file_path);

Error: CLANG_WARNING: [#def3]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:67:10: warning[deadcode.DeadStores]: Although the value stored to 'read' is used in the enclosing expression, the value is never actually read from 'read'
#   65|   	size_t len = 0;
#   66|   	char *ptr, *path;
#   67|-> 	while ((read = getline(&line, &len, fp)) != -1) {
#   68|   		_cleanup_strv_ char **subsystems = NULL;
#   69|   		ptr = strchr(line, ':');

Error: CLANG_WARNING: [#def4]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:131:2: warning[deadcode.DeadStores]: Value stored to 'ifd' is never read
#  129|   	/* Move ownership to inotify_fd.  */
#  130|   	inotify_fd = ifd;
#  131|-> 	ifd = -1;
#  132|   
#  133|   	g_unix_fd_add(inotify_fd, G_IO_IN, oom_cb_cgroup_v2, NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:147:35: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
#  145|   	/* this will be cleaned up in oom_cb_cgroup_v1 */
#  146|   	char *memory_cgroup_file_path = g_build_filename(memory_cgroup_path, "cgroup.event_control", NULL);
#  147|-> 	_cleanup_close_ int cfd = open(memory_cgroup_file_path, O_WRONLY | O_CLOEXEC);
#  148|   	if (cfd == -1) {
#  149|   		nwarnf("Failed to open %s", memory_cgroup_file_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:156:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "memory.oom_control", 0), 524288)’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
#  154|   	_cleanup_free_ char *memory_cgroup_file_oom_path = g_build_filename(memory_cgroup_path, "memory.oom_control", NULL);
#  155|   
#  156|-> 	oom_cgroup_fd = open(memory_cgroup_file_oom_path, O_RDONLY | O_CLOEXEC); /* Not closed */
#  157|   	if (oom_cgroup_fd == -1)
#  158|   		pexitf("Failed to open %s", memory_cgroup_file_oom_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘check_cgroup2_oom’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:278:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_build_filename(cgroup2_path, "memory.events", 0), "re")’
#  276|   	_cleanup_free_ char *memory_events_file_path = g_build_filename(cgroup2_path, "memory.events", NULL);
#  277|   
#  278|-> 	_cleanup_fclose_ FILE *fp = fopen(memory_events_file_path, "re");
#  279|   	if (fp == NULL) {
#  280|   		nwarnf("Failed to open cgroups file: %s", memory_events_file_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:278:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_build_filename(cgroup2_path, "memory.events", 0), "re")’
#  276|   	_cleanup_free_ char *memory_events_file_path = g_build_filename(cgroup2_path, "memory.events", NULL);
#  277|   
#  278|-> 	_cleanup_fclose_ FILE *fp = fopen(memory_events_file_path, "re");
#  279|   	if (fp == NULL) {
#  280|   		nwarnf("Failed to open cgroups file: %s", memory_events_file_path);

Error: CPPCHECK_WARNING: [#def9]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c: scope_hint: In function ‘disconnect_std_streams’
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:29:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(dev_null_r, 0)’
#   27|   static void disconnect_std_streams(int dev_null_r, int dev_null_w)
#   28|   {
#   29|-> 	if (dup2(dev_null_r, STDIN_FILENO) < 0)
#   30|   		pexit("Failed to dup over stdin");
#   31|   	if (dup2(dev_null_w, STDOUT_FILENO) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:31:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(dev_null_w, 1)’
#   29|   	if (dup2(dev_null_r, STDIN_FILENO) < 0)
#   30|   		pexit("Failed to dup over stdin");
#   31|-> 	if (dup2(dev_null_w, STDOUT_FILENO) < 0)
#   32|   		pexit("Failed to dup over stdout");
#   33|   	if (dup2(dev_null_w, STDERR_FILENO) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:33:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(dev_null_w, 2)’
#   31|   	if (dup2(dev_null_w, STDOUT_FILENO) < 0)
#   32|   		pexit("Failed to dup over stdout");
#   33|-> 	if (dup2(dev_null_w, STDERR_FILENO) < 0)
#   34|   		pexit("Failed to dup over stderr");
#   35|   }

Error: CLANG_WARNING: [#def13]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:79:2: warning[deadcode.DeadStores]: Value stored to 'dev_null_r_cleanup' is never read
#   77|   	}
#   78|   
#   79|-> 	dev_null_r_cleanup = dev_null_r = open("/dev/null", O_RDONLY | O_CLOEXEC);
#   80|   	if (dev_null_r < 0)
#   81|   		pexit("Failed to open /dev/null");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c: scope_hint: In function ‘main’
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:79:43: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 524288)’
#   77|   	}
#   78|   
#   79|-> 	dev_null_r_cleanup = dev_null_r = open("/dev/null", O_RDONLY | O_CLOEXEC);
#   80|   	if (dev_null_r < 0)
#   81|   		pexit("Failed to open /dev/null");

Error: CLANG_WARNING: [#def15]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:83:2: warning[deadcode.DeadStores]: Value stored to 'dev_null_w_cleanup' is never read
#   81|   		pexit("Failed to open /dev/null");
#   82|   
#   83|-> 	dev_null_w_cleanup = dev_null_w = open("/dev/null", O_WRONLY | O_CLOEXEC);
#   84|   	if (dev_null_w < 0)
#   85|   		pexit("Failed to open /dev/null");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:83:43: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 524289)’
#   81|   		pexit("Failed to open /dev/null");
#   82|   
#   83|-> 	dev_null_w_cleanup = dev_null_w = open("/dev/null", O_WRONLY | O_CLOEXEC);
#   84|   	if (dev_null_w < 0)
#   85|   		pexit("Failed to open /dev/null");

Error: CLANG_WARNING: [#def17]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:205:3: warning[deadcode.DeadStores]: Value stored to 'dummyfd' is never read
#  203|   	if (opt_bundle_path != NULL && !logging_is_passthrough()) {
#  204|   		attach_symlink_dir_path = setup_attach_socket();
#  205|-> 		dummyfd = setup_terminal_control_fifo();
#  206|   		setup_console_fifo();
#  207|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:244:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(workerfd_stdin, 0)’
#  242|   			if (workerfd_stdin < 0)
#  243|   				workerfd_stdin = dev_null_r;
#  244|-> 			if (dup2(workerfd_stdin, STDIN_FILENO) < 0)
#  245|   				_pexit("Failed to dup over stdin");
#  246|   			if (workerfd_stdin != dev_null_r && fchmod(STDIN_FILENO, 0777) < 0 && errno != EINVAL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:251:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(workerfd_stdout, 1)’
#  249|   			if (workerfd_stdout < 0)
#  250|   				workerfd_stdout = dev_null_w;
#  251|-> 			if (dup2(workerfd_stdout, STDOUT_FILENO) < 0)
#  252|   				_pexit("Failed to dup over stdout");
#  253|   			if (workerfd_stdout != dev_null_w && fchmod(STDOUT_FILENO, 0777) < 0 && errno != EINVAL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:258:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(workerfd_stderr, 2)’
#  256|   			if (workerfd_stderr < 0)
#  257|   				workerfd_stderr = workerfd_stdout;
#  258|-> 			if (dup2(workerfd_stderr, STDERR_FILENO) < 0)
#  259|   				_pexit("Failed to dup over stderr");
#  260|   			if (workerfd_stderr != dev_null_w && fchmod(STDERR_FILENO, 0777) < 0 && errno != EINVAL)

Error: GCC_ANALYZER_WARNING (CWE-910): [#def21]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:287:44: warning[-Wanalyzer-fd-use-after-close]: ‘read’ on closed file descriptor ‘get_pipe_fd_from_env("_OCI_STARTPIPE")’
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:8: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:286:33: note: in expansion of macro ‘ndebug’
#  285|   			if (start_pipe_fd > 0) {
#  286|   				ndebug("exec with attach is waiting for start message from parent");
#  287|-> 				num_read = read(start_pipe_fd, buf, BUF_SIZE);
#  288|   				ndebug("exec with attach got start message from parent");
#  289|   				if (num_read < 0) {

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def22]
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:292:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘get_pipe_fd_from_env("_OCI_STARTPIPE")’
conmon-2.1.10-build/conmon-2.1.10/src/conmon.c:286:33: note: in expansion of macro ‘ndebug’
#  290|   					_pexit("start-pipe read failed");
#  291|   				}
#  292|-> 				close(start_pipe_fd);
#  293|   			}
#  294|   		}

Error: CPPCHECK_WARNING: [#def23]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def24]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:178:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'dname_buf'
#  176|   			return NULL;
#  177|   		}
#  178|-> 		dname = dirname(dname_buf);
#  179|   		if (dname == NULL)
#  180|   			pexitf("Cannot get dirname for %s", csname);

Error: CLANG_WARNING: [#def25]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:186:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'bname_buf'
#  184|   			pexit("Failed to create file for console-socket");
#  185|   
#  186|-> 		bname = basename(bname_buf);
#  187|   		if (bname == NULL)
#  188|   			pexitf("Cannot get basename for %s", csname);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:213:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*fd’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c: scope_hint: In function ‘setup_socket’
#  211|   		pexit("Failed to create socket");
#  212|   	bind_relative_to_dir(sfd, *fd, bname);
#  213|-> 	if (listen(*fd, 128) < 0)
#  214|   		pexit("Failed to listen on console-socket");
#  215|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:274:45: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(socket_parent_dir(use_full_attach_path, 108), 2621440)’
#  272|   	 * to actually refer to the file where the socket will be created below.
#  273|   	 */
#  274|-> 	_cleanup_close_ int parent_dir_fd = open(parent_dir, O_PATH | O_CLOEXEC);
#  275|   	if (parent_dir_fd < 0)
#  276|   		pexitf("failed to open socket path parent dir %s", parent_dir);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def28]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c: scope_hint: In function ‘bind_unix_socket’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:274:45: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘socket_parent_dir(use_full_attach_path, 108)’ where non-null expected
/usr/include/glib-2.0/glib-unix.h:34: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:10: included_from: Included from here.
/usr/include/fcntl.h:209:12: note: argument 1 of ‘open’ must be non-null
#  272|   	 * to actually refer to the file where the socket will be created below.
#  273|   	 */
#  274|-> 	_cleanup_close_ int parent_dir_fd = open(parent_dir, O_PATH | O_CLOEXEC);
#  275|   	if (parent_dir_fd < 0)
#  276|   		pexitf("failed to open socket path parent dir %s", parent_dir);

Error: CLANG_WARNING: [#def29]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:282:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'parent_dir'
#  280|   	 * Cleanup of this variable is up to the caller
#  281|   	 */
#  282|-> 	char *sock_fullpath = g_build_filename(parent_dir, socket_relative_name, NULL);
#  283|   
#  284|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:317:24: warning[-Wanalyzer-malloc-leak]: leak of ‘socket_parent_dir(use_full_attach_path, 108)’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:276:17: note: in expansion of macro ‘pexitf’
#  315|   	/* if we're to use the full path, ignore the socket path and only use the bundle_path */
#  316|   	if (use_full_attach_path)
#  317|-> 		return strdup(opt_bundle_path);
#  318|   
#  319|   	char *base_path = g_build_filename(opt_socket_path, opt_cuuid, NULL);

Error: CPPCHECK_WARNING: [#def31]
conmon-2.1.10-build/conmon-2.1.10/src/ctr_exit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def32]
conmon-2.1.10-build/conmon-2.1.10/src/ctr_logging.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def33]
conmon-2.1.10-build/conmon-2.1.10/src/ctr_stdio.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def34]
conmon-2.1.10-build/conmon-2.1.10/src/ctrl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
conmon-2.1.10-build/conmon-2.1.10/src/ctrl.c: scope_hint: In function ‘setup_fifo’
conmon-2.1.10-build/conmon-2.1.10/src/ctrl.c:273:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(opt_bundle_path,  filename, 0), 526336)’
#  271|   	}
#  272|   
#  273|-> 	if ((*fifo_r = open(fifo_path, O_RDONLY | O_NONBLOCK | O_CLOEXEC)) == -1)
#  274|   		pexitf("Failed to open %s read half", error_var_name);
#  275|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
conmon-2.1.10-build/conmon-2.1.10/src/ctrl.c:276:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(opt_bundle_path,  filename, 0), 524289)’
#  274|   		pexitf("Failed to open %s read half", error_var_name);
#  275|   
#  276|-> 	if ((*fifo_w = open(fifo_path, O_WRONLY | O_CLOEXEC)) == -1)
#  277|   		pexitf("Failed to open %s write half", error_var_name);
#  278|   }

Error: CPPCHECK_WARNING: [#def37]
conmon-2.1.10-build/conmon-2.1.10/src/parent_pipe_fd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def38]
conmon-2.1.10-build/conmon-2.1.10/src/seccomp_notify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def39]
conmon-2.1.10-build/conmon-2.1.10/src/seccomp_notify.c:132:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'b'
#  130|   		pexit("Failed to strdup");
#  131|   	}
#  132|-> 	for (s = 0, it = strtok_r(b, ":", &saveptr); it; s++, it = strtok_r(NULL, ":", &saveptr)) {
#  133|   		run_oci_seccomp_notify_plugin_version_cb version_cb;
#  134|   		run_oci_seccomp_notify_start_cb start_cb;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
conmon-2.1.10-build/conmon-2.1.10/src/seccomp_notify.c: scope_hint: In function ‘seccomp_notify_plugins_load’
conmon-2.1.10-build/conmon-2.1.10/src/seccomp_notify.c:295:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif)’
#  293|   	if (res == NULL)
#  294|   		pexitf("calloc");
#  295|-> 	return res;
#  296|   }
#  297|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
conmon-2.1.10-build/conmon-2.1.10/src/seccomp_notify.c:295:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif_resp)’
#  293|   	if (res == NULL)
#  294|   		pexitf("calloc");
#  295|-> 	return res;
#  296|   }
#  297|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
conmon-2.1.10-build/conmon-2.1.10/src/seccomp_notify.c:295:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(48)’
#  293|   	if (res == NULL)
#  294|   		pexitf("calloc");
#  295|-> 	return res;
#  296|   }
#  297|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:57:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:161:17: note: in expansion of macro ‘pexit’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:161:17: note: in expansion of macro ‘pexit’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:161:17: note: in expansion of macro ‘pexit’
#   55|   	do { \
#   56|   		fprintf(stderr, "[conmon:e]: %s %s\n", s, strerror(errno)); \
#   57|-> 		if (use_syslog) \
#   58|   			syslog(LOG_ERR, "conmon %.20s <error>: %s %s\n", log_cid, s, strerror(errno)); \
#   59|   		exit(EXIT_FAILURE); \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:6: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c: scope_hint: In function ‘setup_socket’
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:57:21: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(path)’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:175:25: note: in expansion of macro ‘pexit’
/usr/include/glib-2.0/glib/gtestutils.h:32: included_from: Included from here.
/usr/include/glib-2.0/glib.h:89: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.h:4: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:3: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:175:25: note: in expansion of macro ‘pexit’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:175:25: note: in expansion of macro ‘pexit’
#   55|   	do { \
#   56|   		fprintf(stderr, "[conmon:e]: %s %s\n", s, strerror(errno)); \
#   57|-> 		if (use_syslog) \
#   58|   			syslog(LOG_ERR, "conmon %.20s <error>: %s %s\n", log_cid, s, strerror(errno)); \
#   59|   		exit(EXIT_FAILURE); \

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:64:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:158:17: note: in expansion of macro ‘pexitf’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
/usr/include/glib-2.0/glib/gtestutils.h:32: included_from: Included from here.
/usr/include/glib-2.0/glib.h:89: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.h:4: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:3: included_from: Included from here.
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:158:17: note: in expansion of macro ‘pexitf’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c:158:17: note: in expansion of macro ‘pexitf’
#   62|   #define pexitf(fmt, ...) \
#   63|   	do { \
#   64|-> 		fprintf(stderr, "[conmon:e]: " fmt " %s\n", ##__VA_ARGS__, strerror(errno)); \
#   65|   		if (use_syslog) \
#   66|   			syslog(LOG_ERR, "conmon %.20s <error>: " fmt ": %s\n", log_cid, ##__VA_ARGS__, strerror(errno)); \

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:65:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(socket_parent_dir(use_full_attach_path, 108), 2621440)’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:291:17: note: in expansion of macro ‘pexitf’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:291:17: note: in expansion of macro ‘pexitf’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:291:17: note: in expansion of macro ‘pexitf’
#   63|   	do { \
#   64|   		fprintf(stderr, "[conmon:e]: " fmt " %s\n", ##__VA_ARGS__, strerror(errno)); \
#   65|-> 		if (use_syslog) \
#   66|   			syslog(LOG_ERR, "conmon %.20s <error>: " fmt ": %s\n", log_cid, ##__VA_ARGS__, strerror(errno)); \
#   67|   		exit(EXIT_FAILURE); \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:65:21: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(path)’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:180:25: note: in expansion of macro ‘pexitf’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:180:25: note: in expansion of macro ‘pexitf’
conmon-2.1.10-build/conmon-2.1.10/src/conn_sock.c:180:25: note: in expansion of macro ‘pexitf’
#   63|   	do { \
#   64|   		fprintf(stderr, "[conmon:e]: " fmt " %s\n", ##__VA_ARGS__, strerror(errno)); \
#   65|-> 		if (use_syslog) \
#   66|   			syslog(LOG_ERR, "conmon %.20s <error>: " fmt ": %s\n", log_cid, ##__VA_ARGS__, strerror(errno)); \
#   67|   		exit(EXIT_FAILURE); \

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
conmon-2.1.10-build/conmon-2.1.10/src/utils.h:179:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
conmon-2.1.10-build/conmon-2.1.10/src/cgroup.c: scope_hint: In function ‘setup_oom_handling_cgroup_v1’
#  177|   static inline void closep(int *fd)
#  178|   {
#  179|-> 	if (*fd >= 0)
#  180|   		close(*fd);
#  181|   	*fd = -1;

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-78.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameconmon-2.1.10-1.fc41
store-results-to/tmp/tmp3gg4a6r7/conmon-2.1.10-1.fc41.tar.xz
time-created2024-07-03 12:11:12
time-finished2024-07-03 12:12:08
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp3gg4a6r7/conmon-2.1.10-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp3gg4a6r7/conmon-2.1.10-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9