Task #4348 - fixed.err

back to task #4348
download
Error: GCC_ANALYZER_WARNING (CWE-401):
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/bus/utils.h:11: included_from: Included from here.
bluechi-0.9.0-build/bluechi-0.9.0/src/controller/controller.c:10: included_from: Included from here.
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/common/common.h: scope_hint: In function ‘controller_method_list_units’
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/common/common.h:56:44: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc0_array(16, 24, (long unsigned int)*(Controller *)userdata.number_of_nodes)’
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/common/common.h:67:16: note: in expansion of macro ‘malloc0’
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/common/common.h:67:16: note: in expansion of macro ‘malloc0’
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/common/common.h:15: included_from: Included from here.
bluechi-0.9.0-build/bluechi-0.9.0/src/controller/controller.c:745:9: note: in expansion of macro ‘LIST_FOREACH’
bluechi-0.9.0-build/bluechi-0.9.0/src/libbluechi/common/common.h: scope_hint: In function ‘controller_method_list_units’
#   54|   static inline void *malloc0_array(size_t base_size, size_t element_size, size_t n_elements) {
#   55|           /* Check for overflow of multiplication */
#   56|->         if (element_size > 0 && n_elements > SIZE_MAX / element_size) {
#   57|                   return NULL;
#   58|           }