Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:484:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c: scope_hint: In function ‘agent_create_request_full’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:1762:9: note: in expansion of macro ‘LIST_FOREACH’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c: scope_hint: In function ‘agent_create_request_full’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:287:57: note: in expansion of macro ‘malloc0’ # 482| # 483| Agent *agent_ref(Agent *agent) { # 484|-> assert(agent->ref_count > 0); # 485| # 486| agent->ref_count++; Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:484:21: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c: scope_hint: In function ‘agent_create_request_full’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/network.h:17: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:16: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:2934:9: note: in expansion of macro ‘bc_log_infof’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c: scope_hint: In function ‘agent_create_request_full’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.c:287:57: note: in expansion of macro ‘malloc0’ # 482| # 483| Agent *agent_ref(Agent *agent) { # 484|-> assert(agent->ref_count > 0); # 485| # 486| agent->ref_count++; Error: CPPCHECK_WARNING (CWE-401): [#def3] bluechi-0.11.0-build/bluechi-0.11.0/src/controller/node.c:1559: error[memleak]: Memory leak: setup # 1557| } # 1558| # 1559|-> return steal_pointer(&setup); # 1560| } # 1561| Error: CPPCHECK_WARNING (CWE-401): [#def4] bluechi-0.11.0-build/bluechi-0.11.0/src/controller/node.c:1954: error[memleak]: Memory leak: unit_name_copy # 1952| dep = malloc0(sizeof(ProxyDependency)); # 1953| if (dep == NULL) { # 1954|-> return -ENOMEM; # 1955| } # 1956| Error: CPPCHECK_WARNING (CWE-401): [#def5] bluechi-0.11.0-build/bluechi-0.11.0/src/controller/proxy_monitor.c:43: error[memleak]: Memory leak: monitor # 41| monitor->unit_name = strdup(unit_name); # 42| if (monitor->unit_name == NULL) { # 43|-> return NULL; # 44| } # 45| Error: CPPCHECK_WARNING (CWE-401): [#def6] bluechi-0.11.0-build/bluechi-0.11.0/src/controller/proxy_monitor.c:48: error[memleak]: Memory leak: monitor # 46| monitor->proxy_object_path = strdup(proxy_object_path); # 47| if (monitor->proxy_object_path == NULL) { # 48|-> return NULL; # 49| } # 50| Error: CPPCHECK_WARNING (CWE-401): [#def7] bluechi-0.11.0-build/bluechi-0.11.0/src/controller/proxy_monitor.c:48: error[memleak]: Memory leak: monitor.unit_name # 46| monitor->proxy_object_path = strdup(proxy_object_path); # 47| if (monitor->proxy_object_path == NULL) { # 48|-> return NULL; # 49| } # 50| Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] bluechi-0.11.0-build/bluechi-0.11.0/src/is-online/is-online.c: scope_hint: In function ‘handle_connection_state_changed’ bluechi-0.11.0-build/bluechi-0.11.0/src/is-online/is-online.c:130:1: warning[-Wanalyzer-malloc-leak]: leak of ‘con_state’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:17: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/bus/utils.h:11: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/is-online/is-online.c:7: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/is-online/is-online.c:167:21: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/is-online/is-online.c: scope_hint: In function ‘handle_connection_state_changed’ # 128| # 129| return 0; # 130|-> } # 131| # 132| static int handle_controller_address_changed(IsOnlineCli *is_online_cli) { Error: CPPCHECK_WARNING (CWE-401): [#def9] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/cli/command.c:117: error[memleak]: Memory leak: opt # 115| opt->value = strdup(value); # 116| if (opt->value == NULL) { # 117|-> return -ENOMEM; # 118| } # 119| } else { Error: GCC_ANALYZER_WARNING (CWE-415): [#def10] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:41:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*(void **)&msg’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/common/parse-util_test.c: scope_hint: In function ‘test_parse_long’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/common/parse-util_test.c: scope_hint: In function ‘test_parse_long’ # 39| # 40| static inline void freep(void *p) { # 41|-> free(*(void **) p); # 42| } # 43| Error: GCC_ANALYZER_WARNING (CWE-401): [#def11] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/bus/utils.h:11: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/controller/controller.c:10: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h: scope_hint: In function ‘agent_fleet_request_start’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:71:44: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc0_array(24, 24, (long unsigned int)*controller.number_of_nodes)’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:82:16: note: in expansion of macro ‘malloc0’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:82:16: note: in expansion of macro ‘malloc0’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:15: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/controller/controller.c:896:9: note: in expansion of macro ‘LIST_FOREACH’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h: scope_hint: In function ‘agent_fleet_request_start’ # 69| static inline void *malloc0_array(size_t base_size, size_t element_size, size_t n_elements) { # 70| /* Check for overflow of multiplication */ # 71|-> if (element_size > 0 && n_elements > SIZE_MAX / element_size) { # 72| return NULL; # 73| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def12] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:17: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/agent/agent.h:15: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/agent/test/agent/agent_apply_config_test.c:10: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/agent/test/agent/agent_apply_config_test.c: scope_hint: In function ‘check_str’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/string-util.h:18:22: warning[-Wanalyzer-null-argument]: use of NULL ‘expected’ where non-null expected bluechi-0.11.0-build/bluechi-0.11.0/src/agent/test/agent/agent_apply_config_test.c:36:14: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/test/agent/agent_apply_config_test.c:36:14: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/agent/test/agent/agent_apply_config_test.c:36:14: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:9: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 16| #define SYMBOL_GLOB_ONE '?' # 17| # 18|-> #define streq(a, b) (strcmp((a), (b)) == 0) # 19| #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) # 20| Error: GCC_ANALYZER_WARNING (CWE-688): [#def13] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:17: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/cli/command.h:8: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.h:10: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:6: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c: scope_hint: In function ‘node_connection_fmt_last_seen’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/string-util.h:18:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*con.state’ where non-null expected bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:485:13: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:476:24: note: in expansion of macro ‘malloc0’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c: scope_hint: In function ‘node_connection_fmt_last_seen’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:761:21: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:458:28: note: in expansion of macro ‘malloc0’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:15: included_from: Included from here. bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/list.h:52:17: note: in expansion of macro ‘LIST_FIND_TAIL’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:471:9: note: in expansion of macro ‘LIST_APPEND’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/list.h:53:17: note: in expansion of macro ‘LIST_INSERT_AFTER’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:471:9: note: in expansion of macro ‘LIST_APPEND’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/list.h:53:17: note: in expansion of macro ‘LIST_INSERT_AFTER’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:471:9: note: in expansion of macro ‘LIST_APPEND’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/list.h:53:17: note: in expansion of macro ‘LIST_INSERT_AFTER’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:471:9: note: in expansion of macro ‘LIST_APPEND’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:549:9: note: in expansion of macro ‘LIST_FOREACH_SAFE’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:549:9: note: in expansion of macro ‘LIST_FOREACH_SAFE’ bluechi-0.11.0-build/bluechi-0.11.0/src/client/method-status.c:485:13: note: in expansion of macro ‘streq’ bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/common.h:9: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 16| #define SYMBOL_GLOB_ONE '?' # 17| # 18|-> #define streq(a, b) (strcmp((a), (b)) == 0) # 19| #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) # 20| Error: CPPCHECK_WARNING (CWE-476): [#def14] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/common/time-util.c:74: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: timebuf_full # 72| uint64_t millis = (uint64_t) ((double) time.tv_nsec * nanosec_to_millisec_multiplier); # 73| strftime(offsetbuf, timestamp_offset_size, "%z", time_tm); # 74|-> snprintf(timebuf_full, # 75| timestamp_full_size, # 76| "%s,%03" PRIu64 "%s", Error: CPPCHECK_WARNING (CWE-476): [#def15] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/common/network/assemble_tcp_address.c:77: warning[nullPointer]: Possible null pointer dereference: expectedResult # 75| _cleanup_free_ char *result = assemble_tcp_address(input); # 76| if ((result == NULL && expectedResult != NULL) || (result != NULL && expectedResult == NULL) || # 77|-> (result != NULL && !streq(result, expectedResult))) { # 78| _cleanup_free_ char *msg = NULL; # 79| int r = asprintf( Error: CPPCHECK_WARNING (CWE-476): [#def16] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/common/network/is_ipv4_test.c:21: warning[nullPointer]: Possible null pointer dereference: in # 19| fprintf(stdout, # 20| "FAILED: is_ipv4('%s') - Expected %s, but got %s\n", # 21|-> in, # 22| bool_to_str(expected), # 23| bool_to_str(result)); Error: CPPCHECK_WARNING (CWE-476): [#def17] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/common/network/is_ipv6_test.c:21: warning[nullPointer]: Possible null pointer dereference: in # 19| fprintf(stdout, # 20| "FAILED: is_ipv6('%s') - Expected %s, but got %s\n", # 21|-> in, # 22| bool_to_str(expected), # 23| bool_to_str(result)); Error: CPPCHECK_WARNING (CWE-476): [#def18] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/log/log_target_to_str_test.c:24: warning[nullPointer]: Possible null pointer dereference: expected_log_target # 22| fprintf(stdout, # 23| "FAILED: string_to_log_level - Expected '%s', but got '%s'\n", # 24|-> expected_log_target, # 25| result); # 26| return false; Error: CPPCHECK_WARNING (CWE-476): [#def19] bluechi-0.11.0-build/bluechi-0.11.0/src/libbluechi/test/log/string_to_log_level_test.c:20: warning[nullPointer]: Possible null pointer dereference: in # 18| fprintf(stdout, # 19| "FAILED: string_to_log_level('%s') - Expected %s, but got %s\n", # 20|-> in, # 21| log_level_to_string(expected_log_level), # 22| log_level_to_string(result));
| analyzer-version-clippy | 1.86.0 |
| analyzer-version-cppcheck | 2.17.1 |
| analyzer-version-gcc | 15.0.1 |
| analyzer-version-gcc-analyzer | 15.0.1 |
| analyzer-version-shellcheck | 0.10.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-240.us-west-2.compute.internal |
| mock-config | fedora-rawhide-x86_64 |
| project-name | bluechi-0.11.0-0.202504091237.git979a98f |
| store-results-to | /tmp/tmp9drqdk39/bluechi-0.11.0-0.202504091237.git979a98f.tar.xz |
| time-created | 2025-04-09 12:48:30 |
| time-finished | 2025-04-09 12:50:00 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,shellcheck,unicontrol,clippy,gcc' '-o' '/tmp/tmp9drqdk39/bluechi-0.11.0-0.202504091237.git979a98f.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp9drqdk39/bluechi-0.11.0-0.202504091237.git979a98f.src.rpm' |
| tool-version | csmock-3.8.0-1.el9 |