Task #91447 - fixed.err

back to task #91447
download
Error: GCC_ANALYZER_WARNING (CWE-401):
libnftnl-1.2.9/src/str_array.c:60:20: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(mnl_attr_get_str(attr))'
libnftnl-1.2.9/src/str_array.c:42:5: enter_function: entry to 'nftnl_parse_devs'
libnftnl-1.2.9/src/str_array.c:53:9: call_function: calling 'nftnl_str_array_clear' from 'nftnl_parse_devs'
libnftnl-1.2.9/src/str_array.c:53:9: return_function: returning to 'nftnl_parse_devs' from 'nftnl_str_array_clear'
libnftnl-1.2.9/src/str_array.c:55:12: branch_false: following 'false' branch...
libnftnl-1.2.9/src/str_array.c:58:9: branch_false: ...to here
libnftnl-1.2.9/src/str_array.c:58:9: branch_true: following 'true' branch...
libnftnl-1.2.9/src/str_array.c:59:38: branch_true: ...to here
libnftnl-1.2.9/src/str_array.c:59:38: acquire_memory: allocated here
libnftnl-1.2.9/src/str_array.c:60:20: danger: 'strdup(mnl_attr_get_str(attr))' leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#   58|   	mnl_attr_for_each_nested(attr, nest) {
#   59|   		sa->array[sa->len] = strdup(mnl_attr_get_str(attr));
#   60|-> 		if (!sa->array[sa->len]) {
#   61|   			nftnl_str_array_clear(sa);
#   62|   			return -1;