xdp-tools-1.6.0-1.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-758): [#def1]
/usr/share/xdp-tools/test_config.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> # Test config for having tools in $PATH - to be installed along with the
#    2|   # test runners in /usr/share/xdp-tools
#    3|   

Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/usr/share/xdp-tools/test_config.sh:4:1: warning[SC2034]: XDPDUMP appears unused. Verify use (or export if used externally).
#    2|   # test runners in /usr/share/xdp-tools
#    3|   
#    4|-> XDPDUMP=xdpdump
#    5|   XDP_BENCH=xdp-bench
#    6|   XDP_FILTER=xdp-filter

Error: SHELLCHECK_WARNING (CWE-563): [#def3]
/usr/share/xdp-tools/test_config.sh:5:1: warning[SC2034]: XDP_BENCH appears unused. Verify use (or export if used externally).
#    3|   
#    4|   XDPDUMP=xdpdump
#    5|-> XDP_BENCH=xdp-bench
#    6|   XDP_FILTER=xdp-filter
#    7|   XDP_FORWARD=xdp-forward

Error: SHELLCHECK_WARNING (CWE-563): [#def4]
/usr/share/xdp-tools/test_config.sh:6:1: warning[SC2034]: XDP_FILTER appears unused. Verify use (or export if used externally).
#    4|   XDPDUMP=xdpdump
#    5|   XDP_BENCH=xdp-bench
#    6|-> XDP_FILTER=xdp-filter
#    7|   XDP_FORWARD=xdp-forward
#    8|   XDP_LOADER=xdp-loader

Error: SHELLCHECK_WARNING (CWE-563): [#def5]
/usr/share/xdp-tools/test_config.sh:7:1: warning[SC2034]: XDP_FORWARD appears unused. Verify use (or export if used externally).
#    5|   XDP_BENCH=xdp-bench
#    6|   XDP_FILTER=xdp-filter
#    7|-> XDP_FORWARD=xdp-forward
#    8|   XDP_LOADER=xdp-loader
#    9|   XDP_MONITOR=xdp-monitor

Error: SHELLCHECK_WARNING (CWE-563): [#def6]
/usr/share/xdp-tools/test_config.sh:8:1: warning[SC2034]: XDP_LOADER appears unused. Verify use (or export if used externally).
#    6|   XDP_FILTER=xdp-filter
#    7|   XDP_FORWARD=xdp-forward
#    8|-> XDP_LOADER=xdp-loader
#    9|   XDP_MONITOR=xdp-monitor
#   10|   XDP_TRAFFICGEN=xdp-trafficgen

Error: SHELLCHECK_WARNING (CWE-563): [#def7]
/usr/share/xdp-tools/test_config.sh:9:1: warning[SC2034]: XDP_MONITOR appears unused. Verify use (or export if used externally).
#    7|   XDP_FORWARD=xdp-forward
#    8|   XDP_LOADER=xdp-loader
#    9|-> XDP_MONITOR=xdp-monitor
#   10|   XDP_TRAFFICGEN=xdp-trafficgen

Error: SHELLCHECK_WARNING (CWE-563): [#def8]
/usr/share/xdp-tools/test_config.sh:10:1: warning[SC2034]: XDP_TRAFFICGEN appears unused. Verify use (or export if used externally).
#    8|   XDP_LOADER=xdp-loader
#    9|   XDP_MONITOR=xdp-monitor
#   10|-> XDP_TRAFFICGEN=xdp-trafficgen

Error: SHELLCHECK_WARNING (CWE-563): [#def9]
/usr/share/xdp-tools/test_runner.sh:19:1: warning[SC2034]: IP6_FULL_PREFIX_SIZE appears unused. Verify use (or export if used externally).
#   17|   IP6_SUBNET=fc42:dead:cafe # must have exactly three :-separated elements
#   18|   IP6_PREFIX_SIZE=64 # Size of assigned prefixes
#   19|-> IP6_FULL_PREFIX_SIZE=48 # Size of IP6_SUBNET
#   20|   IP4_SUBNET=10.11
#   21|   IP4_PREFIX_SIZE=24 # Size of assigned prefixes

Error: SHELLCHECK_WARNING (CWE-563): [#def10]
/usr/share/xdp-tools/test_runner.sh:22:1: warning[SC2034]: IP4_FULL_PREFIX_SIZE appears unused. Verify use (or export if used externally).
#   20|   IP4_SUBNET=10.11
#   21|   IP4_PREFIX_SIZE=24 # Size of assigned prefixes
#   22|-> IP4_FULL_PREFIX_SIZE=16 # Size of IP4_SUBNET
#   23|   GENERATED_NAME_PREFIX="xdptest"
#   24|   ALL_TESTS=""

Error: SHELLCHECK_WARNING (CWE-563): [#def11]
/usr/share/xdp-tools/test_runner.sh:37:5: warning[SC2034]: PING6 appears unused. Verify use (or export if used externally).
#   35|       PING6=ping6
#   36|   else
#   37|->     PING6=ping
#   38|   fi
#   39|   

Error: SHELLCHECK_WARNING (CWE-563): [#def12]
/usr/share/xdp-tools/test_runner.sh:45:1: warning[SC2034]: CMD appears unused. Verify use (or export if used externally).
#   43|   # Global state variables that will be set by options etc below
#   44|   STATEDIR=
#   45|-> CMD=
#   46|   NS=
#   47|   NS_NAMES=()

Error: SHELLCHECK_WARNING (CWE-563): [#def13]
/usr/share/xdp-tools/test_runner.sh:273:11: warning[SC2034]: pids appears unused. Verify use (or export if used externally).
#  271|   
#  272|       local OUTPUT_FILE="${STATEDIR}/proc/${PID}"
#  273|->     local pids
#  274|   
#  275|       kill_process_group $PID

Error: SHELLCHECK_WARNING (CWE-571): [#def14]
/usr/share/xdp-tools/test_runner.sh:286:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  284|   check_prereq()
#  285|   {
#  286|->     local max_locked_mem=$(ulimit -l)
#  287|   
#  288|       for t in $NEEDED_TOOLS; do

Error: SHELLCHECK_WARNING (CWE-569): [#def15]
/usr/share/xdp-tools/test_runner.sh:344:14: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems.
#  342|       local sysctls_on=(forwarding)
#  343|   
#  344|->     for s in ${sysctls_off_v6[*]}; do
#  345|           $nscmd sysctl -w net.ipv6.conf.$iface.${s}=0 >/dev/null
#  346|       done

Error: SHELLCHECK_WARNING (CWE-569): [#def16]
/usr/share/xdp-tools/test_runner.sh:347:14: warning[SC2048]: Use "${array[@]}" (with quotes) to prevent whitespace problems.
#  345|           $nscmd sysctl -w net.ipv6.conf.$iface.${s}=0 >/dev/null
#  346|       done
#  347|->     for s in ${sysctls_on[*]}; do
#  348|           $nscmd sysctl -w net.ipv6.conf.$iface.${s}=1 >/dev/null
#  349|           $nscmd sysctl -w net.ipv6.conf.all.${s}=1 >/dev/null

Error: SHELLCHECK_WARNING (CWE-140): [#def17]
/usr/share/xdp-tools/test_runner.sh:405:22: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#  403|       ip -n "$nsname" -6 route add default via $OUTSIDE_IP6 dev veth0
#  404|   
#  405|->     ALL_INSIDE_IP4+=($INSIDE_IP4)
#  406|       ALL_INSIDE_IP6+=($INSIDE_IP6)
#  407|   }

Error: SHELLCHECK_WARNING (CWE-140): [#def18]
/usr/share/xdp-tools/test_runner.sh:406:22: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#  404|   
#  405|       ALL_INSIDE_IP4+=($INSIDE_IP4)
#  406|->     ALL_INSIDE_IP6+=($INSIDE_IP6)
#  407|   }
#  408|   

Error: SHELLCHECK_WARNING (CWE-140): [#def19]
/usr/share/xdp-tools/test_runner.sh:420:20: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#  418|           nsname=$(gen_nsname)
#  419|           init_ns $nsname $i
#  420|->         NS_NAMES+=($nsname)
#  421|       done
#  422|   

Error: SHELLCHECK_WARNING (CWE-138): [#def20]
/usr/share/xdp-tools/test_runner.sh:472:20: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#  470|       "$@"
#  471|       ret=$?
#  472|->     echo "Command '$@' exited with status $ret"
#  473|       echo ""
#  474|       if [ "$ret" -ne "0" ]; then

Error: SHELLCHECK_WARNING (CWE-563): [#def21]
/usr/share/xdp-tools/test_runner.sh:580:1: warning[SC2034]: TOOL_TESTS_DIR appears unused. Verify use (or export if used externally).
#  578|   source "$TEST_DEFINITIONS"
#  579|   
#  580|-> TOOL_TESTS_DIR="$(dirname "$TEST_DEFINITIONS")"
#  581|   
#  582|   shift

Error: SHELLCHECK_WARNING (CWE-758): [#def22]
/usr/share/xdp-tools/tests/libxdp/test-libxdp.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
#    2|   
#    3|   ALL_TESTS="test_link_so test_link_a test_old_dispatcher test_xdp_devbound test_xdp_frags test_xsk_prog_refcnt_bpffs test_xsk_prog_refcnt_legacy test_xsk_non_privileged test_link_detach test_xsk_umem_flags"

Error: SHELLCHECK_WARNING (CWE-563): [#def23]
/usr/share/xdp-tools/tests/libxdp/test-libxdp.sh:3:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
#    2|   
#    3|-> ALL_TESTS="test_link_so test_link_a test_old_dispatcher test_xdp_devbound test_xdp_frags test_xsk_prog_refcnt_bpffs test_xsk_prog_refcnt_legacy test_xsk_non_privileged test_link_detach test_xsk_umem_flags"
#    4|   
#    5|   TESTS_DIR=$(dirname "${BASH_SOURCE[0]}")

Error: SHELLCHECK_WARNING (CWE-758): [#def24]
/usr/share/xdp-tools/tests/xdp-bench/test-xdp-bench.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_BENCH=${XDP_BENCH:-./xdp-bench}
#    3|   ALL_TESTS="test_drop test_pass test_tx test_xdp_load_bytes test_rxq_stats test_redirect test_redirect_cpu test_redirect_map test_redirect_map_egress test_redirect_multi test_redirect_multi_egress test_xsk_drop test_xsk_tx"

Error: SHELLCHECK_WARNING (CWE-563): [#def25]
/usr/share/xdp-tools/tests/xdp-bench/test-xdp-bench.sh:3:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_BENCH=${XDP_BENCH:-./xdp-bench}
#    3|-> ALL_TESTS="test_drop test_pass test_tx test_xdp_load_bytes test_rxq_stats test_redirect test_redirect_cpu test_redirect_map test_redirect_map_egress test_redirect_multi test_redirect_multi_egress test_xsk_drop test_xsk_tx"
#    4|   
#    5|   test_basic()

Error: SHELLCHECK_WARNING: [#def26]
/usr/share/xdp-tools/tests/xdp-bench/test-xdp-bench.sh:185:13: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  183|       if [ "$hugepg" -lt "8" ]; then
#  184|           echo 8 > /proc/sys/vm/nr_hugepages
#  185|->         res=$?
#  186|       else
#  187|           res=0

Error: SHELLCHECK_WARNING (CWE-758): [#def27]
/usr/share/xdp-tools/tests/xdp-filter/test-xdp-filter.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_FILTER=${XDP_FILTER:-./xdp-filter}
#    3|   ALL_TESTS="test_load test_print test_output_remove test_ports_allow test_ports_deny test_ipv6_allow test_ipv6_deny test_ipv4_allow test_ipv4_deny test_ether_allow test_ether_deny"

Error: SHELLCHECK_WARNING (CWE-563): [#def28]
/usr/share/xdp-tools/tests/xdp-filter/test-xdp-filter.sh:3:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_FILTER=${XDP_FILTER:-./xdp-filter}
#    3|-> ALL_TESTS="test_load test_print test_output_remove test_ports_allow test_ports_deny test_ipv6_allow test_ipv6_deny test_ipv4_allow test_ipv4_deny test_ether_allow test_ether_deny"
#    4|   
#    5|   try_feat()

Error: SHELLCHECK_WARNING (CWE-563): [#def29]
/usr/share/xdp-tools/tests/xdp-filter/test-xdp-filter.sh:357:18: warning[SC2034]: available appears unused. Verify use (or export if used externally).
#  355|       if [[ -z "${PYTHON:-}" ]]; then
#  356|           local -a possible=(python3 python)
#  357|->         local -a available
#  358|   
#  359|           local found=0

Error: SHELLCHECK_WARNING (CWE-758): [#def30]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_FORWARD=${XDP_FORWARD:-./xdp-forward}
#    3|   ALL_TESTS="test_ping test_load test_load_high_ifindex test_fwd_full test_fwd_direct test_flowtable"

Error: SHELLCHECK_WARNING (CWE-563): [#def31]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:3:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_FORWARD=${XDP_FORWARD:-./xdp-forward}
#    3|-> ALL_TESTS="test_ping test_load test_load_high_ifindex test_fwd_full test_fwd_direct test_flowtable"
#    4|   
#    5|   test_ping()

Error: SHELLCHECK_WARNING (CWE-88): [#def32]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:20:33: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   18|   {
#   19|   
#   20|->     check_run $XDP_FORWARD load ${NS_NAMES[@]}
#   21|       check_run $XDP_FORWARD unload ${NS_NAMES[@]}
#   22|   }

Error: SHELLCHECK_WARNING (CWE-88): [#def33]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:21:35: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   19|   
#   20|       check_run $XDP_FORWARD load ${NS_NAMES[@]}
#   21|->     check_run $XDP_FORWARD unload ${NS_NAMES[@]}
#   22|   }
#   23|   

Error: SHELLCHECK_WARNING (CWE-563): [#def34]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:27:5: warning[SC2034]: i appears unused. Verify use (or export if used externally).
#   25|   {
#   26|       # Add a bunch of interfaces to run up the ifindex counter
#   27|->     for i in $(seq 64); do
#   28|           ip link add dev veth-forw-test type veth
#   29|           ip link del dev veth-forw-test

Error: SHELLCHECK_WARNING (CWE-88): [#def35]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:42:48: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   40|       skip_if_missing_kernel_symbol veth_set_features
#   41|   
#   42|->     check_run $XDP_FORWARD load -f fib -F full ${NS_NAMES[@]}
#   43|       for ip in "${ALL_INSIDE_IP4[@]}"; do
#   44|           check_run ns_exec ping -c 1 -W 2 $ip

Error: SHELLCHECK_WARNING (CWE-88): [#def36]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:49:35: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   47|           check_run ns_exec $PING6 -c 1 -W 2 $ip
#   48|       done
#   49|->     check_run $XDP_FORWARD unload ${NS_NAMES[@]}
#   50|   }
#   51|   

Error: SHELLCHECK_WARNING (CWE-88): [#def37]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:57:50: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   55|       skip_if_missing_kernel_symbol veth_set_features
#   56|   
#   57|->     check_run $XDP_FORWARD load -f fib -F direct ${NS_NAMES[@]}
#   58|       for ip in "${ALL_INSIDE_IP4[@]}"; do
#   59|           check_run ns_exec ping -c 1 -W 2 $ip

Error: SHELLCHECK_WARNING (CWE-88): [#def38]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:64:35: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   62|           check_run ns_exec $PING6 -c 1 -W 2 $ip
#   63|       done
#   64|->     check_run $XDP_FORWARD unload ${NS_NAMES[@]}
#   65|   }
#   66|   

Error: SHELLCHECK_WARNING (CWE-88): [#def39]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:76:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   74|       # disable {tx,rx} checksum offload since it is not currently suported
#   75|       # by XDP_REDIRECT
#   76|->     for n in ${NS_NAMES[@]}; do
#   77|           ip netns exec $n ethtool -K veth0 tx-checksumming off rx-checksumming off
#   78|           ethtool -K $n tx-checksumming off rx-checksumming off

Error: SHELLCHECK_WARNING (CWE-88): [#def40]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:125:46: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#  123|   }
#  124|   EOF
#  125|->     check_run $XDP_FORWARD load -f flowtable ${NS_NAMES[@]}
#  126|   
#  127|       PID=$(start_socat_ns "socat -dd -4 TCP-LISTEN:10000,reuseaddr,fork -")

Error: SHELLCHECK_WARNING (CWE-88): [#def41]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:135:35: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#  133|       stop_background $PID
#  134|   
#  135|->     check_run $XDP_FORWARD unload ${NS_NAMES[@]}
#  136|   }
#  137|   

Error: SHELLCHECK_WARNING (CWE-88): [#def42]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:141:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#  139|   {
#  140|       # enable {tx,rx} checksum offload
#  141|->     for n in ${NS_NAMES[@]}; do
#  142|           ip netns exec $n ethtool -K veth0 tx-checksumming on rx-checksumming on
#  143|           ethtool -K $n tx-checksumming on rx-checksumming on

Error: SHELLCHECK_WARNING (CWE-88): [#def43]
/usr/share/xdp-tools/tests/xdp-forward/test-xdp-forward.sh:146:29: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#  144|       done >/dev/null 2>&1
#  145|       {
#  146|->         $XDP_FORWARD unload ${NS_NAMES[@]}
#  147|           $XDP_LOADER unload $NS --all
#  148|           check_run ip netns exec ${NS_NAMES[-1]} nft flush ruleset

Error: SHELLCHECK_WARNING (CWE-758): [#def44]
/usr/share/xdp-tools/tests/xdp-loader/test-xdp-loader.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   ALL_TESTS="test_load test_section test_prog_name test_load_adjust_tail test_load_multi test_load_incremental test_load_clobber test_features"
#    3|   

Error: SHELLCHECK_WARNING (CWE-563): [#def45]
/usr/share/xdp-tools/tests/xdp-loader/test-xdp-loader.sh:2:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|-> ALL_TESTS="test_load test_section test_prog_name test_load_adjust_tail test_load_multi test_load_incremental test_load_clobber test_features"
#    3|   
#    4|   test_load()

Error: SHELLCHECK_WARNING (CWE-563): [#def46]
/usr/share/xdp-tools/tests/xdp-loader/test-xdp-loader.sh:37:11: warning[SC2034]: iface appears unused. Verify use (or export if used externally).
#   35|   check_progs_loaded()
#   36|   {
#   37|->     local iface="$1"
#   38|       local num=$2
#   39|       local num_loaded

Error: SHELLCHECK_WARNING (CWE-758): [#def47]
/usr/share/xdp-tools/tests/xdp-monitor/test-xdp-monitor.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_MONITOR=${XDP_MONITOR:-./xdp-monitor}
#    3|   ALL_TESTS="test_monitor"

Error: SHELLCHECK_WARNING (CWE-563): [#def48]
/usr/share/xdp-tools/tests/xdp-monitor/test-xdp-monitor.sh:3:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_MONITOR=${XDP_MONITOR:-./xdp-monitor}
#    3|-> ALL_TESTS="test_monitor"
#    4|   
#    5|   test_monitor()

Error: SHELLCHECK_WARNING (CWE-758): [#def49]
/usr/share/xdp-tools/tests/xdp-trafficgen/test-xdp-trafficgen.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_TRAFFICGEN=${XDP_TRAFFICGEN:-./xdp-trafficgen}
#    3|   ALL_TESTS="test_udp test_tcp test_no_support test_xsk_udp"

Error: SHELLCHECK_WARNING (CWE-563): [#def50]
/usr/share/xdp-tools/tests/xdp-trafficgen/test-xdp-trafficgen.sh:3:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    1|   XDP_LOADER=${XDP_LOADER:-./xdp-loader}
#    2|   XDP_TRAFFICGEN=${XDP_TRAFFICGEN:-./xdp-trafficgen}
#    3|-> ALL_TESTS="test_udp test_tcp test_no_support test_xsk_udp"
#    4|   
#    5|   PIDS=""

Error: SHELLCHECK_WARNING (CWE-563): [#def51]
/usr/share/xdp-tools/tests/xdp-trafficgen/test-xdp-trafficgen.sh:5:1: warning[SC2034]: PIDS appears unused. Verify use (or export if used externally).
#    3|   ALL_TESTS="test_udp test_tcp test_no_support test_xsk_udp"
#    4|   
#    5|-> PIDS=""
#    6|   
#    7|   skip_if_missing_kernel_support()

Error: SHELLCHECK_WARNING: [#def52]
/usr/share/xdp-tools/tests/xdp-trafficgen/test-xdp-trafficgen.sh:71:13: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#   69|       if [ "$hugepg" -lt "8" ]; then
#   70|           echo 8 > /proc/sys/vm/nr_hugepages
#   71|->         res=$?
#   72|       else
#   73|           res=0

Error: SHELLCHECK_WARNING (CWE-758): [#def53]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Test scrip to do basic xdpdump checks
#    3|   #

Error: SHELLCHECK_WARNING (CWE-563): [#def54]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:6:1: warning[SC2034]: ALL_TESTS appears unused. Verify use (or export if used externally).
#    4|   # shellcheck disable=2039
#    5|   #
#    6|-> ALL_TESTS="test_help test_interfaces test_capt_pcap test_capt_pcapng test_capt_term test_exitentry test_snap test_multi_pkt test_perf_wakeup test_promiscuous_selfload test_promiscuous_preload test_none_xdp test_pname_parse test_multi_prog test_xdp_load"
#    7|   
#    8|   XDPDUMP=${XDPDUMP:-./xdpdump}

Error: SHELLCHECK_WARNING (CWE-563): [#def55]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:10:1: warning[SC2034]: TEST_RETRIES appears unused. Verify use (or export if used externally).
#    8|   XDPDUMP=${XDPDUMP:-./xdpdump}
#    9|   XDP_LOADER=${XDP_LOADER:-../xdp-loader/xdp-loader}
#   10|-> TEST_RETRIES=3
#   11|   
#   12|   RESULT=""

Error: SHELLCHECK_WARNING (CWE-398): [#def56]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:76:28: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
#   74|       local NO_PROG_REGEX="($NS +<No XDP program loaded!>)"
#   75|       if is_multiprog_supported; then
#   76|->         local PROG_REGEX="($NS[[:space:]]+xdp_dispatcher.+xdp_drop)"
#   77|       else
#   78|           local PROG_REGEX="($NS[[:space:]]+xdp_drop)"

Error: SHELLCHECK_WARNING (CWE-398): [#def57]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:78:28: error[SC1087]: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
#   76|           local PROG_REGEX="($NS[[:space:]]+xdp_dispatcher.+xdp_drop)"
#   77|       else
#   78|->         local PROG_REGEX="($NS[[:space:]]+xdp_drop)"
#   79|       fi
#   80|   

Error: SHELLCHECK_WARNING (CWE-571): [#def58]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:138:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  136|       local PCAP_FILE="/tmp/${NS}_PID_$$_$RANDOM.pcap"
#  137|       local PASS_PKT="IP6 $INSIDE_IP6 > $OUTSIDE_IP6: ICMP6, echo reply(, id [0-9]+)?, seq 1, length 64"
#  138|->     local HW=$(uname -m | sed -e 's/[]\/$*+.^|[]/\\&/g')
#  139|       local OS=$(uname -snrv | sed -e 's/[]\/$+*.^()|[]/\\&/g')
#  140|       local INFOS_REGEX=""

Error: SHELLCHECK_WARNING (CWE-571): [#def59]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:139:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  137|       local PASS_PKT="IP6 $INSIDE_IP6 > $OUTSIDE_IP6: ICMP6, echo reply(, id [0-9]+)?, seq 1, length 64"
#  138|       local HW=$(uname -m | sed -e 's/[]\/$*+.^|[]/\\&/g')
#  139|->     local OS=$(uname -snrv | sed -e 's/[]\/$+*.^()|[]/\\&/g')
#  140|       local INFOS_REGEX=""
#  141|       local OLD_CAPINFOS=0

Error: SHELLCHECK_WARNING (CWE-571): [#def60]
/usr/share/xdp-tools/tests/xdpdump/test-xdpdump.sh:142:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  140|       local INFOS_REGEX=""
#  141|       local OLD_CAPINFOS=0
#  142|->     local TSHARK_VERSION=$(tshark --version 2> /dev/null | sed -ne 's/^TShark (Wireshark) \([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')
#  143|   
#  144|       if [[ "$(capinfos --help)" == *"Capinfos (Wireshark) 2."* ]]; then

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
xdp-tools-1.6.0/headers/linux/err.h:26:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xdp_multiprog__new(ifindex)’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2553:30: enter_function: entry to ‘xdp_multiprog__from_fd’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2559:14: call_function: calling ‘xdp_multiprog__new’ from ‘xdp_multiprog__from_fd’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2559:14: return_function: returning to ‘xdp_multiprog__from_fd’ from ‘xdp_multiprog__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2560:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2563:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2563:15: call_function: calling ‘xdp_multiprog__fill_from_fd’ from ‘xdp_multiprog__from_fd’
#   24|   static inline bool IS_ERR(const void *ptr)
#   25|   {
#   26|-> 	return IS_ERR_VALUE((unsigned long)ptr);
#   27|   }
#   28|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
xdp-tools-1.6.0/headers/linux/err.h:26:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xdp_program__new()’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: throw: if ‘bpf_program__name’ throws an exception...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:13: call_function: inlined call to ‘IS_ERR’ from ‘xdp_program__create_from_obj’
#   24|   static inline bool IS_ERR(const void *ptr)
#   25|   {
#   26|-> 	return IS_ERR_VALUE((unsigned long)ptr);
#   27|   }
#   28|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:225:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1191:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:15: call_function: calling ‘xdp_program__parse_btf’ from ‘xdp_program__create_from_obj’
#  223|   
#  224|   	va_start(args, format);
#  225|-> 	__libxdp_pr(level, format, args);
#  226|   	va_end(args);
#  227|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def64]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:225:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1457:21: enter_function: entry to ‘xdp_program__from_pin’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1465:17: call_function: calling ‘libxdp_print’ from ‘xdp_program__from_pin’
#  223|   
#  224|   	va_start(args, format);
#  225|-> 	__libxdp_pr(level, format, args);
#  226|   	va_end(args);
#  227|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:925:20: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1191:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:15: call_function: calling ‘xdp_program__parse_btf’ from ‘xdp_program__create_from_obj’
#  923|   	len = strlen(func_name);
#  924|   
#  925|-> 	nr_types = btf__type_cnt(btf);
#  926|   	for (i = 1; i < nr_types; i++) {
#  927|   		t = btf__type_by_id(btf, i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:927:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1191:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:15: call_function: calling ‘xdp_program__parse_btf’ from ‘xdp_program__create_from_obj’
#  925|   	nr_types = btf__type_cnt(btf);
#  926|   	for (i = 1; i < nr_types; i++) {
#  927|-> 		t = btf__type_by_id(btf, i);
#  928|   		if (!btf_is_func(t))
#  929|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:931:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1191:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:15: call_function: calling ‘xdp_program__parse_btf’ from ‘xdp_program__create_from_obj’
#  929|   			continue;
#  930|   
#  931|-> 		name = btf__name_by_offset(btf, t->name_off);
#  932|   		if (!strncmp(name, func_name, len)) {
#  933|   			pr_debug("Found func %s matching %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1068:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1191:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:15: call_function: calling ‘xdp_program__parse_btf’ from ‘xdp_program__create_from_obj’
# 1066|   		func = btf_get_function(btf, xdp_prog->prog_name);
# 1067|   		if (func) {
# 1068|-> 			name = strdup(btf__name_by_offset(btf, func->name_off));
# 1069|   			if (!name)
# 1070|   				return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1161:28: enter_function: entry to ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1180:12: branch_false: following ‘false’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: call_function: calling ‘xdp_program__new’ from ‘xdp_program__create_from_obj’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1186:20: return_function: returning to ‘xdp_program__create_from_obj’ from ‘xdp_program__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1187:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1190:31: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1191:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: throw: if ‘bpf_object__btf’ throws an exception...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1196:48: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/10)
# 1194|   	}
# 1195|   
# 1196|-> 	err = xdp_program__parse_btf(xdp_prog, bpf_object__btf(obj));
# 1197|   	if (err && err != -ENOENT)
# 1198|   		goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:1390:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2553:30: enter_function: entry to ‘xdp_multiprog__from_fd’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2559:14: call_function: calling ‘xdp_multiprog__new’ from ‘xdp_multiprog__from_fd’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2559:14: return_function: returning to ‘xdp_multiprog__from_fd’ from ‘xdp_multiprog__new’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2560:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2563:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2563:15: call_function: calling ‘xdp_multiprog__fill_from_fd’ from ‘xdp_multiprog__from_fd’
# 1388|   
# 1389|   	if (info.btf_id && !xdp_prog->btf) {
# 1390|-> 		btf = btf__load_from_kernel_by_id(info.btf_id);
# 1391|   		if (!btf) {
# 1392|   			pr_warn("Couldn't get BTF for ID %ul\n", info.btf_id);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2306:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2459:12: enter_function: entry to ‘xdp_multiprog__fill_from_fd’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2468:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2471:12: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2471:12: branch_true: following ‘true’ branch (when ‘prog_fd > 0’)...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2472:17: branch_true: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2476:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2481:22: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2481:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2487:23: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2488:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2493:23: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:2493:23: call_function: calling ‘check_dispatcher_version’ from ‘xdp_multiprog__fill_from_fd’
# 2304|   	}
# 2305|   
# 2306|-> 	err = bpf_map_lookup_elem(map_fd, &map_key, buf);
# 2307|   	if (err) {
# 2308|   		err = -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3561:36: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pin_path)’
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3547:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3550:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3551:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3554:13: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3554:13: acquire_memory: allocated here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3555:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3561:36: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3561:36: throw: if ‘readdir’ throws an exception...
xdp-tools-1.6.0/lib/libxdp/libxdp.c:3561:36: danger: ‘opendir(&pin_path)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/4)
# 3559|   	}
# 3560|   
# 3561|-> 	for (struct dirent *dent = readdir(d); dent; dent = readdir(d)) {
# 3562|   		/* skip . and .. */
# 3563|   		if (dent->d_type == DT_DIR)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
xdp-tools-1.6.0/lib/libxdp/xsk.c:731:22: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  729|   	int err;
#  730|   
#  731|-> 	multi_prog = xdp_multiprog__get_from_ifindex(ifindex);
#  732|   	if (IS_ERR(multi_prog))
#  733|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
xdp-tools-1.6.0/lib/libxdp/xsk.c:735:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  733|   		return NULL;
#  734|   
#  735|-> 	if (xdp_multiprog__is_legacy(multi_prog)) {
#  736|   		prog = xdp_multiprog__main_prog(multi_prog);
#  737|   		prog = strcmp(xdp_program__name(prog), prog_name) ? NULL : prog;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
xdp-tools-1.6.0/lib/libxdp/xsk.c:736:24: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  734|   
#  735|   	if (xdp_multiprog__is_legacy(multi_prog)) {
#  736|-> 		prog = xdp_multiprog__main_prog(multi_prog);
#  737|   		prog = strcmp(xdp_program__name(prog), prog_name) ? NULL : prog;
#  738|   		goto check;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
xdp-tools-1.6.0/lib/libxdp/xsk.c:737:24: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  735|   	if (xdp_multiprog__is_legacy(multi_prog)) {
#  736|   		prog = xdp_multiprog__main_prog(multi_prog);
#  737|-> 		prog = strcmp(xdp_program__name(prog), prog_name) ? NULL : prog;
#  738|   		goto check;
#  739|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
xdp-tools-1.6.0/lib/libxdp/xsk.c:741:24: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  739|   	}
#  740|   
#  741|-> 	while ((prog = xdp_multiprog__next_prog(prog, multi_prog)))
#  742|   		if (!strcmp(xdp_program__name(prog), prog_name))
#  743|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
xdp-tools-1.6.0/lib/libxdp/xsk.c:742:22: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  740|   
#  741|   	while ((prog = xdp_multiprog__next_prog(prog, multi_prog)))
#  742|-> 		if (!strcmp(xdp_program__name(prog), prog_name))
#  743|   			break;
#  744|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
xdp-tools-1.6.0/lib/libxdp/xsk.c:749:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
#  747|   		goto out;
#  748|   
#  749|-> 	err = check_xdp_prog_version(xdp_program__btf(prog), version_name, &version);
#  750|   	if (err) {
#  751|   		prog = ERR_PTR(err);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
xdp-tools-1.6.0/lib/libxdp/xsk.c:784:19: warning[-Wanalyzer-malloc-leak]: leak of ‘value_data’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1330:13: enter_function: entry to ‘xsk_release_xdp_prog’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1335:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1338:17: call_function: inlined call to ‘xsk_decr_prog_refcnt’ from ‘xsk_release_xdp_prog’
#  782|   		return -ENOMEM;
#  783|   
#  784|-> 	lock_fd = xdp_lock_acquire();
#  785|   	if (lock_fd < 0) {
#  786|   		ret = lock_fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
xdp-tools-1.6.0/lib/libxdp/xsk.c:795:15: warning[-Wanalyzer-malloc-leak]: leak of ‘value_data’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1330:13: enter_function: entry to ‘xsk_release_xdp_prog’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1335:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1338:17: call_function: inlined call to ‘xsk_decr_prog_refcnt’ from ‘xsk_release_xdp_prog’
#  793|   	 * when reading refcount, but map key always stays zero
#  794|   	 */
#  795|-> 	ret = bpf_map_lookup_elem(refcnt_map_fd, &key, value_data);
#  796|   	if (ret)
#  797|   		goto unlock;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
xdp-tools-1.6.0/lib/libxdp/xsk.c:1250:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1257:5: enter_function: entry to ‘xsk_socket__create_shared’
xdp-tools-1.6.0/lib/libxdp/xsk.c:1268:12: branch_false: following ‘false’ branch (when ‘xsk_ptr’ is non-NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1271:9: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1277:12: branch_false: following ‘false’ branch (when ‘usr_config’ is NULL)...
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: branch_false: ...to here
xdp-tools-1.6.0/lib/libxdp/xsk.c:1284:15: call_function: calling ‘xsk_socket__create_opts’ from ‘xsk_socket__create_shared’
# 1248|   out_socket:
# 1249|   	if (--umem->refcount)
# 1250|-> 		close(xsk->fd);
# 1251|   out_xsk_alloc:
# 1252|   	free(xsk);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
xdp-tools-1.6.0/lib/util/params.c:604:41: warning[-Wanalyzer-malloc-leak]: leak of ‘new_options’
xdp-tools-1.6.0/lib/util/params.c:580:34: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/params.c:581:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/params.c:583:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/params.c:584:26: branch_true: ...to here
xdp-tools-1.6.0/lib/util/params.c:591:23: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/params.c:592:12: branch_false: following ‘false’ branch (when ‘new_options’ is non-NULL)...
xdp-tools-1.6.0/lib/util/params.c:595:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/params.c:598:9: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/params.c:599:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/params.c:601:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/params.c:601:20: branch_true: ...to here
xdp-tools-1.6.0/lib/util/params.c:602:39: branch_true: following ‘true’ branch (when ‘c > i’)...
xdp-tools-1.6.0/lib/util/params.c:603:37: branch_true: ...to here
xdp-tools-1.6.0/lib/util/params.c:604:41: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/lib/util/params.c:604:41: danger: ‘new_options’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  602|   			for (i = buf; i < c; i++) {
#  603|   				if (*i == opt->short_opt) {
#  604|-> 					pr_warn("Duplicate option char: %c\n",
#  605|   						opt->short_opt);
#  606|   					goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
xdp-tools-1.6.0/lib/util/stats.c:156:15: warning[-Wanalyzer-malloc-leak]: leak of ‘values’
xdp-tools-1.6.0/lib/util/stats.c:174:12: enter_function: entry to ‘map_collect’
xdp-tools-1.6.0/lib/util/stats.c:180:15: call_function: calling ‘gettime’ from ‘map_collect’
xdp-tools-1.6.0/lib/util/stats.c:180:15: return_function: returning to ‘map_collect’ from ‘gettime’
xdp-tools-1.6.0/lib/util/stats.c:181:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/stats.c:184:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/stats.c:189:23: call_function: calling ‘map_get_value_percpu_array’ from ‘map_collect’
#  154|   		return -ENOMEM;
#  155|   
#  156|-> 	err = bpf_map_lookup_elem(fd, &key, values);
#  157|   	if (err) {
#  158|   		pr_debug("bpf_map_lookup_elem failed key:0x%X\n", key);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
xdp-tools-1.6.0/lib/util/util.c:361:42: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pin_path)’
xdp-tools-1.6.0/lib/util/util.c:349:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/util.c:352:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/util.c:352:14: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/util.c:353:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/util.c:360:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/util.c:360:12: branch_true: following ‘true’ branch (when ‘ifindex == 0’)...
xdp-tools-1.6.0/lib/util/util.c:361:42: branch_true: ...to here
xdp-tools-1.6.0/lib/util/util.c:362:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/util.c:363:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/util.c:363:17: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/lib/util/util.c:361:42: danger: ‘opendir(&pin_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  359|   
#  360|   	if (!ifindex)
#  361|-> 		ifindex = if_nametoindex(iface->ifname);
#  362|   	if (!ifindex) {
#  363|   		pr_debug("Interface %s no longer exists\n", iface->ifname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
xdp-tools-1.6.0/lib/util/util.c:368:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pin_path)’
xdp-tools-1.6.0/lib/util/util.c:349:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/util.c:352:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/util.c:352:14: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/util.c:353:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/util.c:360:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/util.c:368:22: throw: if ‘readdir’ throws an exception...
xdp-tools-1.6.0/lib/util/util.c:368:22: danger: ‘opendir(&pin_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  366|   	}
#  367|   
#  368|-> 	while ((de = readdir(dr)) != NULL) {
#  369|   		DECLARE_LIBXDP_OPTS(xdp_program_opts, opts, 0);
#  370|   		struct xdp_program *prog;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
xdp-tools-1.6.0/lib/util/util.c:437:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pin_path)’
xdp-tools-1.6.0/lib/util/util.c:430:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/util.c:433:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/util.c:433:14: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/util.c:434:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/util.c:434:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/util.c:437:22: throw: if ‘readdir’ throws an exception...
xdp-tools-1.6.0/lib/util/util.c:437:22: danger: ‘opendir(&pin_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  435|   		return -ENOENT;
#  436|   
#  437|-> 	while ((de = readdir(dr)) != NULL) {
#  438|   		enum xdp_attach_mode mode = XDP_MODE_UNSPEC;
#  439|   		struct xdp_program *prog = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
xdp-tools-1.6.0/lib/util/xdp_sample.c:249:17: warning[-Wanalyzer-malloc-leak]: leak of ‘x’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1521:12: enter_function: entry to ‘print_stats’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1527:15: call_function: calling ‘sample_stats_collect’ from ‘print_stats’
#  247|   	res = clock_gettime(CLOCK_MONOTONIC, &t);
#  248|   	if (res < 0) {
#  249|-> 		pr_warn("Error with gettimeofday! (%i)\n", res);
#  250|   		return UINT64_MAX;
#  251|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
xdp-tools-1.6.0/lib/util/xdp_sample.c:271:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  269|   	array = calloc(nr_entries, sizeof(*array));
#  270|   	if (!array) {
#  271|-> 		pr_warn("Failed to allocate memory (nr_entries: %u)\n", nr_entries);
#  272|   		return NULL;
#  273|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
xdp-tools-1.6.0/lib/util/xdp_sample.c:271:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  269|   	array = calloc(nr_entries, sizeof(*array));
#  270|   	if (!array) {
#  271|-> 		pr_warn("Failed to allocate memory (nr_entries: %u)\n", nr_entries);
#  272|   		return NULL;
#  273|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
xdp-tools-1.6.0/lib/util/xdp_sample.c:271:17: warning[-Wanalyzer-malloc-leak]: leak of ‘x’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1521:12: enter_function: entry to ‘print_stats’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1527:15: call_function: calling ‘sample_stats_collect’ from ‘print_stats’
#  269|   	array = calloc(nr_entries, sizeof(*array));
#  270|   	if (!array) {
#  271|-> 		pr_warn("Failed to allocate memory (nr_entries: %u)\n", nr_entries);
#  272|   		return NULL;
#  273|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
xdp-tools-1.6.0/lib/util/xdp_sample.c:282:22: warning[-Wanalyzer-malloc-leak]: leak of ‘x’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1521:12: enter_function: entry to ‘print_stats’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1527:15: call_function: calling ‘sample_stats_collect’ from ‘print_stats’
#  280|   	INIT_HLIST_NODE(&e->node);
#  281|   	e->val.timestamp = gettime();
#  282|-> 	e->val.cpu = alloc_records(libbpf_num_possible_cpus());
#  283|   	if (!e->val.cpu)
#  284|   		return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
xdp-tools-1.6.0/lib/util/xdp_sample.c:368:23: warning[-Wanalyzer-malloc-leak]: leak of ‘keys’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1521:12: enter_function: entry to ‘print_stats’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1527:15: call_function: calling ‘sample_stats_collect’ from ‘print_stats’
#  366|   		bool exit = false;
#  367|   
#  368|-> 		ret = bpf_map_lookup_batch(map_fd, init ? &batch : NULL, &batch,
#  369|   					   keys, values, (__u32 *)&count, NULL);
#  370|   		if (ret < 0 && errno != ENOENT)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
xdp-tools-1.6.0/lib/util/xdp_sample.c:368:23: warning[-Wanalyzer-malloc-leak]: leak of ‘values’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1521:12: enter_function: entry to ‘print_stats’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1527:15: call_function: calling ‘sample_stats_collect’ from ‘print_stats’
#  366|   		bool exit = false;
#  367|   
#  368|-> 		ret = bpf_map_lookup_batch(map_fd, init ? &batch : NULL, &batch,
#  369|   					   keys, values, (__u32 *)&count, NULL);
#  370|   		if (ret < 0 && errno != ENOENT)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
xdp-tools-1.6.0/lib/util/xdp_sample.c:427:35: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  425|   
#  426|   	if (sample_mask & SAMPLE_RX_CNT) {
#  427|-> 		rec->rx_cnt.cpu = alloc_records(libbpf_num_possible_cpus());
#  428|   		if (!rec->rx_cnt.cpu) {
#  429|   			pr_warn("Failed to allocate rx_cnt per-CPU array\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
xdp-tools-1.6.0/lib/util/xdp_sample.c:429:25: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  427|   		rec->rx_cnt.cpu = alloc_records(libbpf_num_possible_cpus());
#  428|   		if (!rec->rx_cnt.cpu) {
#  429|-> 			pr_warn("Failed to allocate rx_cnt per-CPU array\n");
#  430|   			goto end_rec;
#  431|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
xdp-tools-1.6.0/lib/util/xdp_sample.c:435:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  433|   	if (sample_mask & SAMPLE_RXQ_STATS) {
#  434|   		if (sample_n_rxqs <= 0) {
#  435|-> 			pr_warn("Invalid number of RXQs: %d\n", sample_n_rxqs);
#  436|   			goto end_rx_cnt;
#  437|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
xdp-tools-1.6.0/lib/util/xdp_sample.c:435:25: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  433|   	if (sample_mask & SAMPLE_RXQ_STATS) {
#  434|   		if (sample_n_rxqs <= 0) {
#  435|-> 			pr_warn("Invalid number of RXQs: %d\n", sample_n_rxqs);
#  436|   			goto end_rx_cnt;
#  437|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
xdp-tools-1.6.0/lib/util/xdp_sample.c:441:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  439|   		rec->rxq_cnt.rxq = alloc_records(sample_n_rxqs);
#  440|   		if (!rec->rxq_cnt.rxq) {
#  441|-> 			pr_warn("Failed to allocate rxq_cnt per RXQ array\n");
#  442|   			goto end_rx_cnt;
#  443|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
xdp-tools-1.6.0/lib/util/xdp_sample.c:441:25: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  439|   		rec->rxq_cnt.rxq = alloc_records(sample_n_rxqs);
#  440|   		if (!rec->rxq_cnt.rxq) {
#  441|-> 			pr_warn("Failed to allocate rxq_cnt per RXQ array\n");
#  442|   			goto end_rx_cnt;
#  443|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
xdp-tools-1.6.0/lib/util/xdp_sample.c:447:49: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  445|   	if (sample_mask & (SAMPLE_REDIRECT_CNT | SAMPLE_REDIRECT_ERR_CNT)) {
#  446|   		for (i = 0; i < XDP_REDIRECT_ERR_MAX; i++) {
#  447|-> 			rec->redir_err[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  448|   			if (!rec->redir_err[i].cpu) {
#  449|   				pr_warn("Failed to allocate redir_err per-CPU array for \"%s\" case\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
xdp-tools-1.6.0/lib/util/xdp_sample.c:447:49: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  445|   	if (sample_mask & (SAMPLE_REDIRECT_CNT | SAMPLE_REDIRECT_ERR_CNT)) {
#  446|   		for (i = 0; i < XDP_REDIRECT_ERR_MAX; i++) {
#  447|-> 			rec->redir_err[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  448|   			if (!rec->redir_err[i].cpu) {
#  449|   				pr_warn("Failed to allocate redir_err per-CPU array for \"%s\" case\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
xdp-tools-1.6.0/lib/util/xdp_sample.c:449:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  447|   			rec->redir_err[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  448|   			if (!rec->redir_err[i].cpu) {
#  449|-> 				pr_warn("Failed to allocate redir_err per-CPU array for \"%s\" case\n",
#  450|   					xdp_redirect_err_names[i]);
#  451|   				while (i--)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
xdp-tools-1.6.0/lib/util/xdp_sample.c:449:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  447|   			rec->redir_err[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  448|   			if (!rec->redir_err[i].cpu) {
#  449|-> 				pr_warn("Failed to allocate redir_err per-CPU array for \"%s\" case\n",
#  450|   					xdp_redirect_err_names[i]);
#  451|   				while (i--)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
xdp-tools-1.6.0/lib/util/xdp_sample.c:458:36: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  456|   	}
#  457|   	if (sample_mask & SAMPLE_CPUMAP_KTHREAD_CNT) {
#  458|-> 		rec->kthread.cpu = alloc_records(libbpf_num_possible_cpus());
#  459|   		if (!rec->kthread.cpu) {
#  460|   			pr_warn("Failed to allocate kthread per-CPU array\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
xdp-tools-1.6.0/lib/util/xdp_sample.c:458:36: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  456|   	}
#  457|   	if (sample_mask & SAMPLE_CPUMAP_KTHREAD_CNT) {
#  458|-> 		rec->kthread.cpu = alloc_records(libbpf_num_possible_cpus());
#  459|   		if (!rec->kthread.cpu) {
#  460|   			pr_warn("Failed to allocate kthread per-CPU array\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
xdp-tools-1.6.0/lib/util/xdp_sample.c:460:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  458|   		rec->kthread.cpu = alloc_records(libbpf_num_possible_cpus());
#  459|   		if (!rec->kthread.cpu) {
#  460|-> 			pr_warn("Failed to allocate kthread per-CPU array\n");
#  461|   			goto end_redir;
#  462|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
xdp-tools-1.6.0/lib/util/xdp_sample.c:460:25: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  458|   		rec->kthread.cpu = alloc_records(libbpf_num_possible_cpus());
#  459|   		if (!rec->kthread.cpu) {
#  460|-> 			pr_warn("Failed to allocate kthread per-CPU array\n");
#  461|   			goto end_redir;
#  462|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
xdp-tools-1.6.0/lib/util/xdp_sample.c:466:49: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  464|   	if (sample_mask & SAMPLE_EXCEPTION_CNT) {
#  465|   		for (i = 0; i < XDP_ACTION_MAX; i++) {
#  466|-> 			rec->exception[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  467|   			if (!rec->exception[i].cpu) {
#  468|   				pr_warn("Failed to allocate exception per-CPU array for \"%s\" case\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
xdp-tools-1.6.0/lib/util/xdp_sample.c:466:49: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  464|   	if (sample_mask & SAMPLE_EXCEPTION_CNT) {
#  465|   		for (i = 0; i < XDP_ACTION_MAX; i++) {
#  466|-> 			rec->exception[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  467|   			if (!rec->exception[i].cpu) {
#  468|   				pr_warn("Failed to allocate exception per-CPU array for \"%s\" case\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
xdp-tools-1.6.0/lib/util/xdp_sample.c:468:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  466|   			rec->exception[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  467|   			if (!rec->exception[i].cpu) {
#  468|-> 				pr_warn("Failed to allocate exception per-CPU array for \"%s\" case\n",
#  469|   					xdp_action2str(i));
#  470|   				while (i--)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
xdp-tools-1.6.0/lib/util/xdp_sample.c:468:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  466|   			rec->exception[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  467|   			if (!rec->exception[i].cpu) {
#  468|-> 				pr_warn("Failed to allocate exception per-CPU array for \"%s\" case\n",
#  469|   					xdp_action2str(i));
#  470|   				while (i--)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
xdp-tools-1.6.0/lib/util/xdp_sample.c:477:40: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  475|   	}
#  476|   	if (sample_mask & SAMPLE_DEVMAP_XMIT_CNT) {
#  477|-> 		rec->devmap_xmit.cpu = alloc_records(libbpf_num_possible_cpus());
#  478|   		if (!rec->devmap_xmit.cpu) {
#  479|   			pr_warn("Failed to allocate devmap_xmit per-CPU array\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
xdp-tools-1.6.0/lib/util/xdp_sample.c:477:40: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  475|   	}
#  476|   	if (sample_mask & SAMPLE_DEVMAP_XMIT_CNT) {
#  477|-> 		rec->devmap_xmit.cpu = alloc_records(libbpf_num_possible_cpus());
#  478|   		if (!rec->devmap_xmit.cpu) {
#  479|   			pr_warn("Failed to allocate devmap_xmit per-CPU array\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
xdp-tools-1.6.0/lib/util/xdp_sample.c:479:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  477|   		rec->devmap_xmit.cpu = alloc_records(libbpf_num_possible_cpus());
#  478|   		if (!rec->devmap_xmit.cpu) {
#  479|-> 			pr_warn("Failed to allocate devmap_xmit per-CPU array\n");
#  480|   			goto end_exception;
#  481|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
xdp-tools-1.6.0/lib/util/xdp_sample.c:479:25: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  477|   		rec->devmap_xmit.cpu = alloc_records(libbpf_num_possible_cpus());
#  478|   		if (!rec->devmap_xmit.cpu) {
#  479|-> 			pr_warn("Failed to allocate devmap_xmit per-CPU array\n");
#  480|   			goto end_exception;
#  481|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
xdp-tools-1.6.0/lib/util/xdp_sample.c:487:43: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  485|   	if (sample_mask & SAMPLE_CPUMAP_ENQUEUE_CNT) {
#  486|   		for (i = 0; i < sample_n_cpus; i++) {
#  487|-> 			rec->enq[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  488|   			if (!rec->enq[i].cpu) {
#  489|   				pr_warn("Failed to allocate enqueue per-CPU array for CPU %d\n", i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
xdp-tools-1.6.0/lib/util/xdp_sample.c:487:43: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  485|   	if (sample_mask & SAMPLE_CPUMAP_ENQUEUE_CNT) {
#  486|   		for (i = 0; i < sample_n_cpus; i++) {
#  487|-> 			rec->enq[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  488|   			if (!rec->enq[i].cpu) {
#  489|   				pr_warn("Failed to allocate enqueue per-CPU array for CPU %d\n", i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
xdp-tools-1.6.0/lib/util/xdp_sample.c:489:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  487|   			rec->enq[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  488|   			if (!rec->enq[i].cpu) {
#  489|-> 				pr_warn("Failed to allocate enqueue per-CPU array for CPU %d\n", i);
#  490|   				while (i--)
#  491|   					free(rec->enq[i].cpu);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
xdp-tools-1.6.0/lib/util/xdp_sample.c:489:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1574:5: enter_function: entry to ‘sample_run’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1583:12: branch_false: following ‘false’ branch (when ‘interval != 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1587:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1592:12: branch_false: following ‘false’ branch (when ‘timerfd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1594:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1603:15: call_function: calling ‘alloc_stats_record’ from ‘sample_run’
#  487|   			rec->enq[i].cpu = alloc_records(libbpf_num_possible_cpus());
#  488|   			if (!rec->enq[i].cpu) {
#  489|-> 				pr_warn("Failed to allocate enqueue per-CPU array for CPU %d\n", i);
#  490|   				while (i--)
#  491|   					free(rec->enq[i].cpu);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def121]
xdp-tools-1.6.0/lib/util/xdp_sample.c:1682:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1660:14: acquire_resource: datagram socket created here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1661:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1664:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1664:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1665:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1682:9: throw: if ‘close’ throws an exception...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1682:9: danger: ‘fd’ leaks here
# 1680|   end:
# 1681|   	r = errno;
# 1682|-> 	close(fd);
# 1683|   	return r == EOPNOTSUPP ? "loopback" : "[error]";
# 1684|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def122]
xdp-tools-1.6.0/lib/util/xdp_sample.c:1712:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xdp-tools-1.6.0/lib/util/xdp_sample.c:1692:14: acquire_resource: datagram socket created here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1693:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1696:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1696:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1697:22: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdp_sample.c:1712:9: throw: if ‘close’ throws an exception...
xdp-tools-1.6.0/lib/util/xdp_sample.c:1712:9: danger: ‘fd’ leaks here
# 1710|   
# 1711|   end:
# 1712|-> 	close(fd);
# 1713|   	return r;
# 1714|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
xdp-tools-1.6.0/lib/util/xdpsock.c:277:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: call_function: calling ‘get_interrupt_number’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: return_function: returning to ‘xsk_ctx__create’ from ‘get_interrupt_number’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: call_function: calling ‘get_irqs’ from ‘xsk_ctx__create’
#  275|   	if (f_count_proc == NULL) {
#  276|   		ret = -errno;
#  277|-> 		pr_warn("Failed to open %s: %s\n", count_path, strerror(-ret));
#  278|   		return ret;
#  279|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
xdp-tools-1.6.0/lib/util/xdpsock.c:283:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&count_path, "r")’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: call_function: calling ‘get_interrupt_number’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: return_function: returning to ‘xsk_ctx__create’ from ‘get_interrupt_number’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: call_function: calling ‘get_irqs’ from ‘xsk_ctx__create’
#  281|   	if (fgets(line, sizeof(line), f_count_proc) == NULL ||
#  282|   			line[strlen(line) - 1] != '\n') {
#  283|-> 		pr_warn("Error reading from %s\n", count_path);
#  284|   		ret = -ENOENT;
#  285|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
xdp-tools-1.6.0/lib/util/xdpsock.c:283:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: call_function: calling ‘get_interrupt_number’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: return_function: returning to ‘xsk_ctx__create’ from ‘get_interrupt_number’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: call_function: calling ‘get_irqs’ from ‘xsk_ctx__create’
#  281|   	if (fgets(line, sizeof(line), f_count_proc) == NULL ||
#  282|   			line[strlen(line) - 1] != '\n') {
#  283|-> 		pr_warn("Error reading from %s\n", count_path);
#  284|   		ret = -ENOENT;
#  285|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
xdp-tools-1.6.0/lib/util/xdpsock.c:283:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&count_path, "r")’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: call_function: calling ‘get_interrupt_number’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: return_function: returning to ‘xsk_ctx__create’ from ‘get_interrupt_number’
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1781:31: call_function: calling ‘get_irqs’ from ‘xsk_ctx__create’
#  281|   	if (fgets(line, sizeof(line), f_count_proc) == NULL ||
#  282|   			line[strlen(line) - 1] != '\n') {
#  283|-> 		pr_warn("Error reading from %s\n", count_path);
#  284|   		ret = -ENOENT;
#  285|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
xdp-tools-1.6.0/lib/util/xdpsock.c:1012:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1744:16: call_function: calling ‘xsk_configure_umem’ from ‘xsk_ctx__create’
# 1010|   		return ERR_PTR(-errno);
# 1011|   
# 1012|-> 	ret = xsk_umem__create(&umem->umem, buffer, size, &umem->fq, &umem->cq,
# 1013|   			       &cfg);
# 1014|   	if (ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
xdp-tools-1.6.0/lib/util/xdpsock.c:1012:15: warning[-Wanalyzer-malloc-leak]: leak of ‘umem’
xdp-tools-1.6.0/lib/util/xdpsock.c:1008:16: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1009:12: branch_false: following ‘false’ branch (when ‘umem’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1012:15: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1012:15: throw: if ‘xsk_umem__create’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1012:15: danger: ‘umem’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1010|   		return ERR_PTR(-errno);
# 1011|   
# 1012|-> 	ret = xsk_umem__create(&umem->umem, buffer, size, &umem->fq, &umem->cq,
# 1013|   			       &cfg);
# 1014|   	if (ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
xdp-tools-1.6.0/lib/util/xdpsock.c:1076:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: call_function: calling ‘xsk_configure_socket’ from ‘xsk_ctx__create’
# 1074|   	rxr = rx ? &xsk->rx : NULL;
# 1075|   	txr = tx ? &xsk->tx : NULL;
# 1076|-> 	ret = xsk_socket__create(&xsk->xsk, opt->iface.ifname, opt->queue_idx,
# 1077|   				 umem->umem, rxr, txr, &cfg);
# 1078|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
xdp-tools-1.6.0/lib/util/xdpsock.c:1076:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xsk’
xdp-tools-1.6.0/lib/util/xdpsock.c:1056:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1057:12: branch_false: following ‘false’ branch (when ‘xsk’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1060:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1074:15: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1075:15: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1075:15: branch_false: following ‘false’ branch (when ‘tx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1076:15: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1076:15: throw: if ‘xsk_socket__create’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1076:15: danger: ‘xsk’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 1074|   	rxr = rx ? &xsk->rx : NULL;
# 1075|   	txr = tx ? &xsk->tx : NULL;
# 1076|-> 	ret = xsk_socket__create(&xsk->xsk, opt->iface.ifname, opt->queue_idx,
# 1077|   				 umem->umem, rxr, txr, &cfg);
# 1078|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
xdp-tools-1.6.0/lib/util/xdpsock.c:1549:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:57: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1790:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1793:24: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1795:12: branch_false: following ‘false’ branch (when ‘bench != 1’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1799:32: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1802:48: call_function: calling ‘load_xdp_program’ from ‘xsk_ctx__create’
# 1547|   	if (!skel) {
# 1548|   		err = -errno;
# 1549|-> 		pr_warn("Failed to load skeleton: %s\n", strerror(-err));
# 1550|   		goto err;
# 1551|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
xdp-tools-1.6.0/lib/util/xdpsock.c:1604:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:57: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1790:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1793:24: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1795:12: branch_false: following ‘false’ branch (when ‘bench != 1’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1799:32: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1802:48: call_function: calling ‘load_xdp_program’ from ‘xsk_ctx__create’
# 1602|   	return ret_prog;
# 1603|   err:
# 1604|-> 	xdp_program__close(xdp_prog);
# 1605|   	xdpsock__destroy(skel);
# 1606|   	return ERR_PTR(err);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
xdp-tools-1.6.0/lib/util/xdpsock.c:1614:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1768:29: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:71: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:31: call_function: calling ‘apply_busy_poll_opts’ from ‘xsk_ctx__create’
# 1612|   
# 1613|   	sock_opt = 1;
# 1614|-> 	if (setsockopt(xsk_socket__fd(xsk), SOL_SOCKET, SO_PREFER_BUSY_POLL,
# 1615|   		       (void *)&sock_opt, sizeof(sock_opt)) < 0)
# 1616|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
xdp-tools-1.6.0/lib/util/xdpsock.c:1619:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1768:29: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:71: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:31: call_function: calling ‘apply_busy_poll_opts’ from ‘xsk_ctx__create’
# 1617|   
# 1618|   	sock_opt = 20;
# 1619|-> 	if (setsockopt(xsk_socket__fd(xsk), SOL_SOCKET, SO_BUSY_POLL,
# 1620|   		       (void *)&sock_opt, sizeof(sock_opt)) < 0)
# 1621|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
xdp-tools-1.6.0/lib/util/xdpsock.c:1624:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1768:29: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:71: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:31: call_function: calling ‘apply_busy_poll_opts’ from ‘xsk_ctx__create’
# 1622|   
# 1623|   	sock_opt = batch_size;
# 1624|-> 	if (setsockopt(xsk_socket__fd(xsk), SOL_SOCKET, SO_BUSY_POLL_BUDGET,
# 1625|   		       (void *)&sock_opt, sizeof(sock_opt)) < 0)
# 1626|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
xdp-tools-1.6.0/lib/util/xdpsock.c:1694:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:57: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:15: call_function: calling ‘xsk_set_sched_priority’ from ‘xsk_ctx__create’
# 1692|   	ret = sched_setscheduler(0, sched_policy, &schparam);
# 1693|   	if (ret)
# 1694|-> 		pr_warn("Error(%d) in setting priority(%d): %s\n",
# 1695|   			errno, sched_prio, strerror(errno));
# 1696|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
xdp-tools-1.6.0/lib/util/xdpsock.c:1739:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_true: following ‘true’ branch (when ‘bufs == 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1739:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1739:17: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1739:17: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
# 1737|   		    MAP_PRIVATE | MAP_ANONYMOUS | mmap_flags, -1, 0);
# 1738|   	if (bufs == MAP_FAILED) {
# 1739|-> 		pr_warn("ERROR: mmap failed\n");
# 1740|   		goto err;
# 1741|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
xdp-tools-1.6.0/lib/util/xdpsock.c:1771:33: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:12: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1768:29: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1769:71: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1770:28: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1771:33: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1771:33: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1771:33: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/0)
# 1769|   			ret = apply_busy_poll_opts(ctx->xsks[i]->xsk, opt->batch_size);
# 1770|   			if (ret) {
# 1771|-> 				pr_warn("ERROR: Couldn't apply busy poll options: %s\n",
# 1772|   					strerror(-ret));
# 1773|   				goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
xdp-tools-1.6.0/lib/util/xdpsock.c:1783:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1780:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1783:25: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1783:25: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1783:25: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
# 1781|   			ret = get_irqs(ctx);
# 1782|   		if (ret < 0) {
# 1783|-> 			pr_warn("ERROR: Failed to get irqs for %s\n", opt->irq_string);
# 1784|   			goto err;
# 1785|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
xdp-tools-1.6.0/lib/util/xdpsock.c:1842:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_true: following ‘true’ branch (when ‘bench <= 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_true: following ‘true’ branch (when ‘rx != 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1753:52: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1761:31: call_function: inlined call to ‘PTR_ERR’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1841:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1843:37: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1842:17: throw: if ‘xdp_program__detach’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1842:17: danger: ‘ctx’ leaks here; was allocated at [(4)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/3)
# 1840|   err:
# 1841|   	if (ctx->xdp_prog) {
# 1842|-> 		xdp_program__detach(ctx->xdp_prog, ctx->opt.iface.ifindex,
# 1843|   				    ctx->opt.attach_mode, 0);
# 1844|   		xdp_program__close(ctx->xdp_prog);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
xdp-tools-1.6.0/lib/util/xdpsock.c:1844:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_true: following ‘true’ branch (when ‘bench <= 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_true: following ‘true’ branch (when ‘rx != 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1753:52: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1761:31: call_function: inlined call to ‘PTR_ERR’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1841:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1843:37: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1844:17: throw: if ‘xdp_program__close’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1844:17: danger: ‘ctx’ leaks here; was allocated at [(4)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/3)
# 1842|   		xdp_program__detach(ctx->xdp_prog, ctx->opt.iface.ifindex,
# 1843|   				    ctx->opt.attach_mode, 0);
# 1844|-> 		xdp_program__close(ctx->xdp_prog);
# 1845|   	}
# 1846|   	for (i = 0; i < ctx->num_socks; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
xdp-tools-1.6.0/lib/util/xdpsock.c:1847:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_true: following ‘true’ branch (when ‘bench <= 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_true: following ‘true’ branch (when ‘rx != 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1753:52: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1761:31: call_function: inlined call to ‘PTR_ERR’ from ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1846:21: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1847:36: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1847:17: throw: if ‘xsk_socket__delete’ throws an exception...
xdp-tools-1.6.0/lib/util/xdpsock.c:1847:17: danger: ‘ctx’ leaks here; was allocated at [(4)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/3)
# 1845|   	}
# 1846|   	for (i = 0; i < ctx->num_socks; i++) {
# 1847|-> 		xsk_socket__delete(ctx->xsks[i]->xsk);
# 1848|   		free(ctx->xsks[i]);
# 1849|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:47:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:57: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1790:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1793:24: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1795:12: branch_false: following ‘false’ branch (when ‘bench != 1’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1799:32: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1802:48: call_function: calling ‘load_xdp_program’ from ‘xsk_ctx__create’
#   45|   		return;
#   46|   	if (obj->skeleton)
#   47|-> 		bpf_object__destroy_skeleton(obj->skeleton);
#   48|   	free(obj);
#   49|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:70:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdpsock.c:1534:28: enter_function: entry to ‘load_xdp_program’
xdp-tools-1.6.0/lib/util/xdpsock.c:1546:16: call_function: inlined call to ‘xdpsock__open’ from ‘load_xdp_program’
#   68|   		goto err_out;
#   69|   
#   70|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   71|   	if (err)
#   72|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:70:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:57: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1790:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1793:24: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1795:12: branch_false: following ‘false’ branch (when ‘bench != 1’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1799:32: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1802:48: call_function: calling ‘load_xdp_program’ from ‘xsk_ctx__create’
#   68|   		goto err_out;
#   69|   
#   70|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   71|   	if (err)
#   72|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:70:15: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/lib/util/xdpsock.c:1534:28: enter_function: entry to ‘load_xdp_program’
xdp-tools-1.6.0/lib/util/xdpsock.c:1546:16: call_function: inlined call to ‘xdpsock__open’ from ‘load_xdp_program’
#   68|   		goto err_out;
#   69|   
#   70|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   71|   	if (err)
#   72|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:179:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/lib/util/xdpsock.c:1534:28: enter_function: entry to ‘load_xdp_program’
xdp-tools-1.6.0/lib/util/xdpsock.c:1546:16: call_function: inlined call to ‘xdpsock__open’ from ‘load_xdp_program’
#  177|   	return 0;
#  178|   err:
#  179|-> 	bpf_object__destroy_skeleton(s);
#  180|   	return err;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:179:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: enter_function: entry to ‘xsk_ctx__create’
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: following ‘false’ branch (when ‘bench > 2’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1700:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1731:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xdpsock.c:1732:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1737:21: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1738:12: branch_false: following ‘false’ branch (when ‘bufs != 18446744073709551615’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1745:35: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1752:12: branch_false: following ‘false’ branch (when ‘rx == 0’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_true: following ‘true’ branch (when ‘num_xsks > i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1759:47: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1760:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1764:27: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1758:21: branch_false: following ‘false’ branch (when ‘num_xsks <= i’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1767:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1778:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1789:57: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1790:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xdpsock.c:1793:24: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1795:12: branch_false: following ‘false’ branch (when ‘bench != 1’)...
xdp-tools-1.6.0/lib/util/xdpsock.c:1799:32: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xdpsock.c:1802:48: call_function: calling ‘load_xdp_program’ from ‘xsk_ctx__create’
#  177|   	return 0;
#  178|   err:
#  179|-> 	bpf_object__destroy_skeleton(s);
#  180|   	return err;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:179:9: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/lib/util/xdpsock.c:1534:28: enter_function: entry to ‘load_xdp_program’
xdp-tools-1.6.0/lib/util/xdpsock.c:1546:16: call_function: inlined call to ‘xdpsock__open’ from ‘load_xdp_program’
#  177|   	return 0;
#  178|   err:
#  179|-> 	bpf_object__destroy_skeleton(s);
#  180|   	return err;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
xdp-tools-1.6.0/lib/util/xdpsock.skel.h:179:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xdp-tools-1.6.0/lib/util/xdpsock.c:1534:28: enter_function: entry to ‘load_xdp_program’
xdp-tools-1.6.0/lib/util/xdpsock.c:1546:16: call_function: inlined call to ‘xdpsock__open’ from ‘load_xdp_program’
#  177|   	return 0;
#  178|   err:
#  179|-> 	bpf_object__destroy_skeleton(s);
#  180|   	return err;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
xdp-tools-1.6.0/lib/util/xpcapng.c:269:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pd’
xdp-tools-1.6.0/lib/util/xpcapng.c:539:24: enter_function: entry to ‘xpcapng_dump_open’
xdp-tools-1.6.0/lib/util/xpcapng.c:547:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xpcapng.c:553:12: branch_false: following ‘false’ branch (when ‘pd’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:559:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:567:14: call_function: calling ‘pcapng_write_shb’ from ‘xpcapng_dump_open’
#  267|   
#  268|   	/* Write the SHB, and free its memory. */
#  269|-> 	rc = write(pd->pd_fd, shb, shb_length);
#  270|   	free(shb);
#  271|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
xdp-tools-1.6.0/lib/util/xpcapng.c:269:14: warning[-Wanalyzer-malloc-leak]: leak of ‘shb’
xdp-tools-1.6.0/lib/util/xpcapng.c:539:24: enter_function: entry to ‘xpcapng_dump_open’
xdp-tools-1.6.0/lib/util/xpcapng.c:547:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:553:12: branch_false: following ‘false’ branch (when ‘pd’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:559:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:567:14: call_function: calling ‘pcapng_write_shb’ from ‘xpcapng_dump_open’
#  267|   
#  268|   	/* Write the SHB, and free its memory. */
#  269|-> 	rc = write(pd->pd_fd, shb, shb_length);
#  270|   	free(shb);
#  271|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
xdp-tools-1.6.0/lib/util/xpcapng.c:366:14: warning[-Wanalyzer-malloc-leak]: leak of ‘idb’
xdp-tools-1.6.0/lib/util/xpcapng.c:281:13: enter_function: entry to ‘pcapng_write_idb’
xdp-tools-1.6.0/lib/util/xpcapng.c:291:12: branch_false: following ‘false’ branch (when ‘pd’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:299:12: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:321:15: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xpcapng.c:322:12: branch_false: following ‘false’ branch (when ‘idb’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:327:9: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:362:15: call_function: inlined call to ‘pcapng_add_option’ from ‘pcapng_write_idb’
xdp-tools-1.6.0/lib/util/xpcapng.c:366:14: throw: if ‘write’ throws an exception...
xdp-tools-1.6.0/lib/util/xpcapng.c:366:14: danger: ‘idb’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  364|   
#  365|   	/* Write the IDB, and free it's memory. */
#  366|-> 	rc = write(pd->pd_fd, idb, idb_length);
#  367|   	free(idb);
#  368|   

Error: CPPCHECK_WARNING (CWE-562): [#def154]
xdp-tools-1.6.0/lib/util/xpcapng.c:523: error[invalidLifetime]: Using pointer to local variable 'opt' that is out of scope.
#  521|   
#  522|   	/* Write other options and final EPB size. */
#  523|-> 	iov[i].iov_base = options;
#  524|   	iov[i++].iov_len = 8 + (epb_options->flags ? 8 : 0) +
#  525|   		(epb_options->dropcount ? 12 : 0) +

Error: CPPCHECK_WARNING (CWE-562): [#def155]
xdp-tools-1.6.0/lib/util/xpcapng.c:524: error[invalidLifetime]: Using pointer to local variable 'opt' that is out of scope.
#  522|   	/* Write other options and final EPB size. */
#  523|   	iov[i].iov_base = options;
#  524|-> 	iov[i++].iov_len = 8 + (epb_options->flags ? 8 : 0) +
#  525|   		(epb_options->dropcount ? 12 : 0) +
#  526|   		(epb_options->packetid ? 12 : 0) +

Error: CPPCHECK_WARNING (CWE-562): [#def156]
xdp-tools-1.6.0/lib/util/xpcapng.c:529: error[invalidLifetime]: Using pointer to local variable 'opt' that is out of scope.
#  527|   		(epb_options->queue ? 8 : 0) +
#  528|   		(epb_options->xdp_verdict ? 16 : 0);
#  529|-> 	rc = writev(pd->pd_fd, iov, i);
#  530|   	if ((size_t)rc != epb_length)
#  531|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
xdp-tools-1.6.0/lib/util/xpcapng.c:562:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pd’
xdp-tools-1.6.0/lib/util/xpcapng.c:547:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xpcapng.c:553:12: branch_false: following ‘false’ branch (when ‘pd’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:559:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:559:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xdp-tools-1.6.0/lib/util/xpcapng.c:562:29: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:562:29: throw: if ‘open’ throws an exception...
xdp-tools-1.6.0/lib/util/xpcapng.c:562:29: danger: ‘pd’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  560|   		pd->pd_fd = STDOUT_FILENO;
#  561|   	} else {
#  562|-> 		pd->pd_fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
#  563|   		if (pd->pd_fd < 0)
#  564|   			goto error_exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
xdp-tools-1.6.0/lib/util/xpcapng.c:575:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pd’
xdp-tools-1.6.0/lib/util/xpcapng.c:539:24: enter_function: entry to ‘xpcapng_dump_open’
xdp-tools-1.6.0/lib/util/xpcapng.c:547:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:552:14: acquire_memory: allocated here
xdp-tools-1.6.0/lib/util/xpcapng.c:553:12: branch_false: following ‘false’ branch (when ‘pd’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:559:13: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:567:14: call_function: calling ‘pcapng_write_shb’ from ‘xpcapng_dump_open’
xdp-tools-1.6.0/lib/util/xpcapng.c:567:14: return_function: returning to ‘xpcapng_dump_open’ from ‘pcapng_write_shb’
xdp-tools-1.6.0/lib/util/xpcapng.c:567:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/lib/util/xpcapng.c:568:17: branch_false: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:573:12: branch_true: following ‘true’ branch (when ‘pd’ is non-NULL)...
xdp-tools-1.6.0/lib/util/xpcapng.c:574:21: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:574:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/lib/util/xpcapng.c:575:25: branch_true: ...to here
xdp-tools-1.6.0/lib/util/xpcapng.c:575:25: throw: if ‘close’ throws an exception...
xdp-tools-1.6.0/lib/util/xpcapng.c:575:25: danger: ‘pd’ leaks here; was allocated at [(4)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/3)
#  573|   	if (pd) {
#  574|   		if (pd->pd_fd >= 0 && pd->pd_fd != STDOUT_FILENO)
#  575|-> 			close(pd->pd_fd);
#  576|   
#  577|   		free(pd);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def159]
xdp-tools-1.6.0/xdp-bench/hash_func01.h:23:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(const __u16 *)&cpu_hash’
xdp-tools-1.6.0/xdp-bench/xdp_redirect_cpumap.bpf.c:511:6: enter_function: entry to ‘cpumap_l4_hash’
xdp-tools-1.6.0/xdp-bench/xdp_redirect_cpumap.bpf.c:528:12: branch_false: following ‘false’ branch (when ‘rec’ is non-NULL)...
xdp-tools-1.6.0/xdp-bench/xdp_redirect_cpumap.bpf.c:530:9: call_function: inlined call to ‘__read_once_size’ from ‘cpumap_l4_hash’
xdp-tools-1.6.0/xdp-bench/xdp_redirect_cpumap.bpf.c:533:12: branch_false: following ‘false’ branch (when ‘cpu_max’ is non-NULL)...
xdp-tools-1.6.0/xdp-bench/xdp_redirect_cpumap.bpf.c:536:15: call_function: inlined call to ‘parse_eth’ from ‘cpumap_l4_hash’
xdp-tools-1.6.0/xdp-bench/xdp_redirect_cpumap.bpf.c:542:28: call_function: inlined call to ‘get_ipv4_hash_ip_pair’ from ‘cpumap_l4_hash’
#   21|   #pragma clang loop unroll(full)
#   22|   	for (;len > 0; len--) {
#   23|-> 		hash  += get16bits (data);
#   24|   		tmp    = (get16bits (data+2) << 11) ^ hash;
#   25|   		hash   = (hash << 16) ^ tmp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
xdp-tools-1.6.0/xdp-dump/xdpdump.c:750:37: warning[-Wanalyzer-malloc-leak]: leak of ‘program_names’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:745:25: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:746:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:749:34: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:750:55: branch_true: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:750:37: throw: if ‘xdp_program__name’ throws an exception...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:750:37: danger: ‘program_names’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  748|   
#  749|   	for (unsigned int i = 0; i < progs->nr_of_progs; i++) {
#  750|-> 		const char *kname = xdp_program__name(progs->progs[i].prog);
#  751|   		const char *fname = progs->progs[i].func;
#  752|   		uint32_t id = xdp_program__id(progs->progs[i].prog);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
xdp-tools-1.6.0/xdp-dump/xdpdump.c:752:31: warning[-Wanalyzer-malloc-leak]: leak of ‘program_names’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:745:25: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:746:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:746:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:749:34: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:750:55: branch_true: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:752:31: throw: if ‘xdp_program__id’ throws an exception...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:752:31: danger: ‘program_names’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  750|   		const char *kname = xdp_program__name(progs->progs[i].prog);
#  751|   		const char *fname = progs->progs[i].func;
#  752|-> 		uint32_t id = xdp_program__id(progs->progs[i].prog);
#  753|   
#  754|   		if (skip_index != (int)i) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def162]
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1221:32: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1191:14: enter_function: entry to ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1199:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: call_function: calling ‘append_snprintf’ from ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: return_function: returning to ‘get_loaded_program_info’ from ‘append_snprintf’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1208:14: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1209:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1218:45: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:21: call_function: calling ‘append_snprintf’ from ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:21: return_function: returning to ‘get_loaded_program_info’ from ‘append_snprintf’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:20: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1221:32: throw: if ‘xdp_multiprog__next_prog’ throws an exception...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1221:32: danger: ‘info’ leaks here; was allocated at [(25)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/24)
# 1219|   			goto error_out;
# 1220|   
# 1221|-> 		while ((prog = xdp_multiprog__next_prog(prog, mp))) {
# 1222|   			if (append_snprintf(&info, &info_size, &info_offset,
# 1223|   					    "    %s()\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1222:29: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1191:14: enter_function: entry to ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1199:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: call_function: calling ‘append_snprintf’ from ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: return_function: returning to ‘get_loaded_program_info’ from ‘append_snprintf’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1208:14: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1209:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1218:45: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:21: call_function: calling ‘append_snprintf’ from ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:21: return_function: returning to ‘get_loaded_program_info’ from ‘append_snprintf’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:20: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1221:24: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1222:29: branch_true: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1222:29: throw: if ‘xdp_program__name’ throws an exception...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1222:29: danger: ‘info’ leaks here; was allocated at [(25)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/24)
# 1220|   
# 1221|   		while ((prog = xdp_multiprog__next_prog(prog, mp))) {
# 1222|-> 			if (append_snprintf(&info, &info_size, &info_offset,
# 1223|   					    "    %s()\n",
# 1224|   					    xdp_program__name(prog)) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1228:17: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1191:14: enter_function: entry to ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1199:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: call_function: calling ‘append_snprintf’ from ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:13: return_function: returning to ‘get_loaded_program_info’ from ‘append_snprintf’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1202:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1208:14: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1209:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1218:45: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:21: call_function: calling ‘append_snprintf’ from ‘get_loaded_program_info’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:21: return_function: returning to ‘get_loaded_program_info’ from ‘append_snprintf’
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1216:20: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1221:24: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1228:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1228:17: throw: if ‘xdp_multiprog__close’ throws an exception...
xdp-tools-1.6.0/xdp-dump/xdpdump.c:1228:17: danger: ‘info’ leaks here; was allocated at [(25)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/24)
# 1226|   		}
# 1227|   
# 1228|-> 		xdp_multiprog__close(mp);
# 1229|   	}
# 1230|   	return info;

Error: COMPILER_WARNING: [#def165] [important]
xdp-tools-1.6.0/xdp-dump/xdpdump.h:49:34: error[error]: field ‘header’ has incomplete type
#   47|   #ifndef __bpf__
#   48|   struct perf_sample_event {
#   49|-> 	struct perf_event_header header;
#   50|   	__u64 time;
#   51|   	__u32 size;

Error: COMPILER_WARNING: [#def166] [important]
xdp-tools-1.6.0/xdp-dump/xdpdump.h:57:34: error[error]: field ‘header’ has incomplete type
#   55|   
#   56|   struct perf_lost_event {
#   57|-> 	struct perf_event_header header;
#   58|   	__u64 id;
#   59|   	__u64 lost;

Error: COMPILER_WARNING (CWE-9001): [#def167]
xdp-tools-1.6.0/xdp-dump/xdpdump_bpf.c:25:1: warning[-Wattributes]: ‘preserve_access_index’ attribute directive ignored
#   23|   	 */
#   24|   	int ifindex;
#   25|-> } __attribute__((preserve_access_index));
#   26|   
#   27|   struct xdp_rxq_info {

Error: COMPILER_WARNING (CWE-9001): [#def168]
xdp-tools-1.6.0/xdp-dump/xdpdump_bpf.c:33:1: warning[-Wattributes]: ‘preserve_access_index’ attribute directive ignored
#   31|   	struct net_device *dev;
#   32|   	__u32 queue_index;
#   33|-> } __attribute__((preserve_access_index));
#   34|   
#   35|   struct xdp_buff {

Error: COMPILER_WARNING (CWE-9001): [#def169]
xdp-tools-1.6.0/xdp-dump/xdpdump_bpf.c:42:1: warning[-Wattributes]: ‘preserve_access_index’ attribute directive ignored
#   40|   	unsigned long handle;
#   41|   	struct xdp_rxq_info *rxq;
#   42|-> } __attribute__((preserve_access_index));
#   43|   
#   44|   /*****************************************************************************

Error: GCC_ANALYZER_WARNING (CWE-401): [#def170]
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:56:36: warning[-Wanalyzer-malloc-leak]: leak of ‘find_prog_file(features)’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:254:5: enter_function: entry to ‘do_load’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:267:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:272:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:273:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:276:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:277:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:285:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:298:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:304:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:307:20: call_function: calling ‘find_prog_file’ from ‘do_load’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:307:20: return_function: returning to ‘do_load’ from ‘find_prog_file’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:308:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:313:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:313:9: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:56:36: danger: ‘find_prog_file(features)’ leaks here; was allocated at [(16)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/15)
#   54|   		return NULL;
#   55|   
#   56|-> 	for (feat = prog_features; feat->prog_name; feat++) {
#   57|   		if ((ntohl(feat->features) & features) == features)
#   58|   			return strdup(feat->prog_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:89:13: warning[-Wanalyzer-malloc-leak]: leak of ‘values’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:82:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:85:18: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:85:18: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:86:12: branch_false: following ‘false’ branch (when ‘values’ is non-NULL)...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:89:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:89:13: throw: if ‘bpf_map_lookup_elem’ throws an exception...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:89:13: danger: ‘values’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   87|   		return -ENOMEM;
#   88|   
#   89|-> 	if ((bpf_map_lookup_elem(fd, key, values)) != 0) {
#   90|   		err = -ENOENT;
#   91|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:126:13: warning[-Wanalyzer-malloc-leak]: leak of ‘values’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:119:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:122:18: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:122:18: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:123:12: branch_false: following ‘false’ branch (when ‘values’ is non-NULL)...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:126:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:126:13: throw: if ‘bpf_map_lookup_elem’ throws an exception...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:126:13: danger: ‘values’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  124|   		return -ENOMEM;
#  125|   
#  126|-> 	if (bpf_map_lookup_elem(fd, key, values) != 0) {
#  127|   		memset(values, 0, sizeof(*values) * nr_cpus);
#  128|   	} else if (!flags && delete_empty) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:372:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(pin_root_path, 65536)’
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:362:18: acquire_resource: opened here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:363:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:372:14: branch_false: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:372:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:373:23: branch_true: ...to here
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:373:23: throw: if ‘unlink_pinned_map’ throws an exception...
xdp-tools-1.6.0/xdp-filter/xdp-filter.c:372:14: danger: ‘open(pin_root_path, 65536)’ leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  370|   	}
#  371|   
#  372|-> 	if (!(features & (FEAT_TCP | FEAT_UDP))) {
#  373|   		err = unlink_pinned_map(dir_fd, textify(MAP_NAME_PORTS));
#  374|   		if (err)

Error: COMPILER_WARNING: [#def174] [important]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.bpf.c:150:17: error[-Wimplicit-function-declaration]: implicit declaration of function ‘__builtin_preserve_access_index’
#  148|   		 *   the host.
#  149|   		 */
#  150|-> 		bpf_core_read(&nat_port, bpf_core_type_size(nat_port),
#  151|   			      &flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.dst_port);
#  152|   		ports->source = nat_port;

Error: COMPILER_WARNING: [#def175] [important]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.bpf.c:150:17: error[-Wimplicit-function-declaration]: implicit declaration of function ‘__builtin_preserve_type_info’
#  148|   		 *   the host.
#  149|   		 */
#  150|-> 		bpf_core_read(&nat_port, bpf_core_type_size(nat_port),
#  151|   			      &flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.dst_port);
#  152|   		ports->source = nat_port;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:53:1: enter_function: entry to ‘xdp_flowtable__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:59:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: call_function: calling ‘xdp_flowtable__create_skeleton’ from ‘xdp_flowtable__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: return_function: returning to ‘xdp_flowtable__open_opts’ from ‘xdp_flowtable__create_skeleton’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:65:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/7)
#   66|   		goto err_out;
#   67|   
#   68|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   69|   	if (err)
#   70|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:53:1: enter_function: entry to ‘xdp_flowtable__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:58:39: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:59:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: call_function: calling ‘xdp_flowtable__create_skeleton’ from ‘xdp_flowtable__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: return_function: returning to ‘xdp_flowtable__open_opts’ from ‘xdp_flowtable__create_skeleton’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:65:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:68:15: danger: ‘obj’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
#   66|   		goto err_out;
#   67|   
#   68|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   69|   	if (err)
#   70|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:131:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:143:46: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:145:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:151:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:158:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:160:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  174|   	return 0;
#  175|   err:
#  176|-> 	bpf_object__destroy_skeleton(s);
#  177|   	return err;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:53:1: enter_function: entry to ‘xdp_flowtable__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:58:39: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:59:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:64:15: call_function: calling ‘xdp_flowtable__create_skeleton’ from ‘xdp_flowtable__open_opts’
#  174|   	return 0;
#  175|   err:
#  176|-> 	bpf_object__destroy_skeleton(s);
#  177|   	return err;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:130:43: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:131:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:145:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable.skel.h:176:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  174|   	return 0;
#  175|   err:
#  176|-> 	bpf_object__destroy_skeleton(s);
#  177|   	return err;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:48:1: enter_function: entry to ‘xdp_flowtable_sample__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:54:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: call_function: calling ‘xdp_flowtable_sample__create_skeleton’ from ‘xdp_flowtable_sample__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: return_function: returning to ‘xdp_flowtable_sample__open_opts’ from ‘xdp_flowtable_sample__create_skeleton’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:60:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/7)
#   61|   		goto err_out;
#   62|   
#   63|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   64|   	if (err)
#   65|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:48:1: enter_function: entry to ‘xdp_flowtable_sample__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:53:46: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:54:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: call_function: calling ‘xdp_flowtable_sample__create_skeleton’ from ‘xdp_flowtable_sample__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: return_function: returning to ‘xdp_flowtable_sample__open_opts’ from ‘xdp_flowtable_sample__create_skeleton’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:60:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:63:15: danger: ‘obj’ leaks here; was allocated at [(2)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/1)
#   61|   		goto err_out;
#   62|   
#   63|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   64|   	if (err)
#   65|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:153:9: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:48:1: enter_function: entry to ‘xdp_flowtable_sample__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:53:46: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:54:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:59:15: call_function: calling ‘xdp_flowtable_sample__create_skeleton’ from ‘xdp_flowtable_sample__open_opts’
#  151|   	return 0;
#  152|   err:
#  153|-> 	bpf_object__destroy_skeleton(s);
#  154|   	return err;
#  155|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:153:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:125:43: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:126:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:131:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:139:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:141:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:153:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_flowtable_sample.skel.h:153:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  151|   	return 0;
#  152|   err:
#  153|-> 	bpf_object__destroy_skeleton(s);
#  154|   	return err;
#  155|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:53:1: enter_function: entry to ‘xdp_forward__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:59:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: call_function: calling ‘xdp_forward__create_skeleton’ from ‘xdp_forward__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: return_function: returning to ‘xdp_forward__open_opts’ from ‘xdp_forward__create_skeleton’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:65:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   66|   		goto err_out;
#   67|   
#   68|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   69|   	if (err)
#   70|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:53:1: enter_function: entry to ‘xdp_forward__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:58:37: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:59:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: call_function: calling ‘xdp_forward__create_skeleton’ from ‘xdp_forward__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: return_function: returning to ‘xdp_forward__open_opts’ from ‘xdp_forward__create_skeleton’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:65:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:68:15: danger: ‘obj’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#   66|   		goto err_out;
#   67|   
#   68|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   69|   	if (err)
#   70|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:131:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:143:46: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:145:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:151:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:158:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:160:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  174|   	return 0;
#  175|   err:
#  176|-> 	bpf_object__destroy_skeleton(s);
#  177|   	return err;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:53:1: enter_function: entry to ‘xdp_forward__open_opts’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:58:37: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:59:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:64:15: call_function: calling ‘xdp_forward__create_skeleton’ from ‘xdp_forward__open_opts’
#  174|   	return 0;
#  175|   err:
#  176|-> 	bpf_object__destroy_skeleton(s);
#  177|   	return err;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:130:43: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:131:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:145:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-forward/xdp_forward.skel.h:176:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  174|   	return 0;
#  175|   err:
#  176|-> 	bpf_object__destroy_skeleton(s);
#  177|   	return err;
#  178|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def190]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  134|   	}
#  135|   
#  136|-> 	pr_debug("Loading %zu files on interface '%s'.\n",
#  137|   		 num_progs, opt->iface.ifname);
#  138|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def191]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:143:9: throw: if ‘silence_libbpf_logging’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:143:9: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  141|   	 * is a noop if verbose logging is enabled.
#  142|   	 */
#  143|-> 	silence_libbpf_logging();
#  144|   
#  145|   retry:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:152:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:151:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:152:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:152:25: throw: if ‘xdp_program__close’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:152:25: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  150|   		p = progs[i];
#  151|   		if (p)
#  152|-> 			xdp_program__close(p);
#  153|   
#  154|   		if (opt->prog_name) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:159:29: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:155:50: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:159:29: throw: if ‘xdp_program__create’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:159:29: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  157|   			xdp_opts.opts = &opts;
#  158|   
#  159|-> 			p = xdp_program__create(&xdp_opts);
#  160|   		} else {
#  161|   			p = xdp_program__open_file(opt->filenames.strings[i],

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:161:29: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:161:29: throw: if ‘xdp_program__open_file’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:161:29: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  159|   			p = xdp_program__create(&xdp_opts);
#  160|   		} else {
#  161|-> 			p = xdp_program__open_file(opt->filenames.strings[i],
#  162|   						   opt->section_name, &opts);
#  163|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:165:23: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:165:23: throw: if ‘libxdp_get_error’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:165:23: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  163|   		}
#  164|   
#  165|-> 		err = libxdp_get_error(p);
#  166|   		if (err) {
#  167|   			if (err == -EPERM && !double_rlimit())

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:47: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_true: following ‘true’ branch (when ‘err == -1’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:47: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:47: throw: if ‘double_rlimit’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:47: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  165|   		err = libxdp_get_error(p);
#  166|   		if (err) {
#  167|-> 			if (err == -EPERM && !double_rlimit())
#  168|   				goto retry;
#  169|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:170:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_false: following ‘false’ branch (when ‘err != -1’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:170:25: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:170:25: throw: if ‘libxdp_strerror’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:170:25: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  168|   				goto retry;
#  169|   
#  170|-> 			libxdp_strerror(err, errmsg, sizeof(errmsg));
#  171|   			pr_warn("Couldn't open file '%s': %s\n",
#  172|   				opt->filenames.strings[i], errmsg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:171:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_false: following ‘false’ branch (when ‘err != -1’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:170:25: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:171:25: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:171:25: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  169|   
#  170|   			libxdp_strerror(err, errmsg, sizeof(errmsg));
#  171|-> 			pr_warn("Couldn't open file '%s': %s\n",
#  172|   				opt->filenames.strings[i], errmsg);
#  173|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: throw: if ‘xdp_program__bpf_obj’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  178|   		 * actually loading
#  179|   		 */
#  180|-> 		bpf_object__for_each_program(bpf_prog, xdp_program__bpf_obj(p))
#  181|   			bpf_program__set_autoload(bpf_prog, false);
#  182|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:181:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_true: following ‘true’ branch (when ‘bpf_prog’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:181:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:181:25: throw: if ‘bpf_program__set_autoload’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:181:25: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  179|   		 */
#  180|   		bpf_object__for_each_program(bpf_prog, xdp_program__bpf_obj(p))
#  181|-> 			bpf_program__set_autoload(bpf_prog, false);
#  182|   
#  183|   		if (opt->prio) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:184:31: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: following ‘false’ branch (when ‘bpf_prog’ is NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:183:21: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:183:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:184:31: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:184:31: throw: if ‘xdp_program__set_run_prio’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:184:31: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  182|   
#  183|   		if (opt->prio) {
#  184|-> 			err = xdp_program__set_run_prio(p, opt->prio);
#  185|   			if (err) {
#  186|   				pr_warn("Error setting run priority: %u\n", opt->prio);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:186:33: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:183:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:184:31: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:185:28: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:186:33: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:186:33: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:186:33: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  184|   			err = xdp_program__set_run_prio(p, opt->prio);
#  185|   			if (err) {
#  186|-> 				pr_warn("Error setting run priority: %u\n", opt->prio);
#  187|   				goto out;
#  188|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:195:39: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:183:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:191:21: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:191:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:191:20: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:194:47: branch_true: following ‘true’ branch (when ‘a != 5’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:195:81: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:195:39: throw: if ‘xdp_program__set_chain_call_enabled’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:195:39: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  193|   
#  194|   			for (a = XDP_ABORTED; a <= XDP_REDIRECT; a++) {
#  195|-> 				err = xdp_program__set_chain_call_enabled(p, a, opt->actions & (1U << a));
#  196|   				if (err) {
#  197|   					pr_warn("Error setting chain call action: %u\n", a);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:197:41: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:191:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:191:20: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:194:47: branch_true: following ‘true’ branch (when ‘a != 5’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:195:81: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:196:36: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:197:41: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:197:41: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:197:41: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  195|   				err = xdp_program__set_chain_call_enabled(p, a, opt->actions & (1U << a));
#  196|   				if (err) {
#  197|-> 					pr_warn("Error setting chain call action: %u\n", a);
#  198|   					goto out;
#  199|   				}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def205]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:203:17: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:203:17: throw: if ‘xdp_program__print_chain_call_actions’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:203:17: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  201|   		}
#  202|   
#  203|-> 		xdp_program__print_chain_call_actions(p, errmsg, sizeof(errmsg));
#  204|   		pr_debug("XDP program %zu: Run prio: %d. Chain call actions: %s\n",
#  205|   			 i, xdp_program__run_prio(p), errmsg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:204:17: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:204:17: throw: if ‘xdp_program__run_prio’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:204:17: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  202|   
#  203|   		xdp_program__print_chain_call_actions(p, errmsg, sizeof(errmsg));
#  204|-> 		pr_debug("XDP program %zu: Run prio: %d. Chain call actions: %s\n",
#  205|   			 i, xdp_program__run_prio(p), errmsg);
#  206|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:207:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: throw: if ‘xdp_program__bpf_obj’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  208|   			struct bpf_map *map;
#  209|   
#  210|-> 			bpf_object__for_each_map(map, xdp_program__bpf_obj(p)) {
#  211|   				err = bpf_map__set_pin_path(map, NULL);
#  212|   				if (err) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:211:39: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:207:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: branch_true: following ‘true’ branch (when ‘map’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:211:39: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:211:39: throw: if ‘bpf_map__set_pin_path’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:211:39: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  209|   
#  210|   			bpf_object__for_each_map(map, xdp_program__bpf_obj(p)) {
#  211|-> 				err = bpf_map__set_pin_path(map, NULL);
#  212|   				if (err) {
#  213|   					pr_warn("Error clearing map pin path: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:154:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:162:52: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_false: following ‘false’ branch (when ‘err == 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:180:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:207:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:210:25: branch_true: following ‘true’ branch (when ‘map’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:211:39: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:213:41: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:213:41: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  211|   				err = bpf_map__set_pin_path(map, NULL);
#  212|   				if (err) {
#  213|-> 					pr_warn("Error clearing map pin path: %s\n",
#  214|   						strerror(-err));
#  215|   					goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:223:15: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:20: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_false: following ‘false’ branch (when ‘i >= num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:224:61: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:223:15: throw: if ‘xdp_program__attach_multi’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:223:15: danger: ‘progs’ leaks here; was allocated at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
#  221|   	}
#  222|   
#  223|-> 	err = xdp_program__attach_multi(progs, num_progs,
#  224|   					opt->iface.ifindex, opt->mode, 0);
#  225|   	if (err) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:245:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progs’
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:122:12: branch_false: following ‘false’ branch (when ‘num_progs != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:125:19: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:130:17: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:131:12: branch_false: following ‘false’ branch (when ‘progs’ is non-NULL)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:136:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:146:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:147:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:166:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:167:28: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:243:21: branch_true: following ‘true’ branch (when ‘i < num_progs’)...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:244:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:244:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:245:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:245:25: throw: if ‘xdp_program__close’ throws an exception...
xdp-tools-1.6.0/xdp-loader/xdp-loader.c:245:25: danger: ‘progs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  243|   	for (i = 0; i < num_progs; i++)
#  244|   		if (progs[i])
#  245|-> 			xdp_program__close(progs[i]);
#  246|   	free(progs);
#  247|   	return err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:82:1: enter_function: entry to ‘xdp_monitor__open_opts’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:88:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: call_function: calling ‘xdp_monitor__create_skeleton’ from ‘xdp_monitor__open_opts’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: return_function: returning to ‘xdp_monitor__open_opts’ from ‘xdp_monitor__create_skeleton’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:94:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   95|   		goto err_out;
#   96|   
#   97|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   98|   	if (err)
#   99|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:82:1: enter_function: entry to ‘xdp_monitor__open_opts’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:87:37: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:88:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: call_function: calling ‘xdp_monitor__create_skeleton’ from ‘xdp_monitor__open_opts’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: return_function: returning to ‘xdp_monitor__open_opts’ from ‘xdp_monitor__create_skeleton’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:94:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:97:15: danger: ‘obj’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#   95|   		goto err_out;
#   96|   
#   97|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#   98|   	if (err)
#   99|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:160:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:165:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:172:46: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:174:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:180:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:225:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:227:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  265|   	return 0;
#  266|   err:
#  267|-> 	bpf_object__destroy_skeleton(s);
#  268|   	return err;
#  269|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:82:1: enter_function: entry to ‘xdp_monitor__open_opts’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:87:37: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:88:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:93:15: call_function: calling ‘xdp_monitor__create_skeleton’ from ‘xdp_monitor__open_opts’
#  265|   	return 0;
#  266|   err:
#  267|-> 	bpf_object__destroy_skeleton(s);
#  268|   	return err;
#  269|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:159:43: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:160:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:165:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:174:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:176:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-monitor/xdp_monitor.skel.h:267:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  265|   	return 0;
#  266|   err:
#  267|-> 	bpf_object__destroy_skeleton(s);
#  268|   	return err;
#  269|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def217]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:286:17: warning[-Wanalyzer-malloc-leak]: leak of ‘threads’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:278:19: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_true: following ‘true’ branch (when ‘t’ is NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:286:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:286:17: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:286:17: danger: ‘threads’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  284|   	t = calloc(num_threads, sizeof(struct thread_config));
#  285|   	if (!t) {
#  286|-> 		pr_warn("Couldn't allocate memory\n");
#  287|   		free(threads);
#  288|   		return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:295:29: warning[-Wanalyzer-malloc-leak]: leak of ‘threads’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:278:19: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:295:29: throw: if ‘xdp_program__clone’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:295:29: danger: ‘threads’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  293|   		tcfg->cpu_core_id++;
#  294|   
#  295|-> 		t[i].prog = xdp_program__clone(prog, 0);
#  296|   		err = libxdp_get_error(t[i].prog);
#  297|   		if (err) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def219]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:295:29: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:295:29: throw: if ‘xdp_program__clone’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:295:29: danger: ‘t’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  293|   		tcfg->cpu_core_id++;
#  294|   
#  295|-> 		t[i].prog = xdp_program__clone(prog, 0);
#  296|   		err = libxdp_get_error(t[i].prog);
#  297|   		if (err) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:296:23: warning[-Wanalyzer-malloc-leak]: leak of ‘threads’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:278:19: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:296:23: throw: if ‘libxdp_get_error’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:296:23: danger: ‘threads’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  294|   
#  295|   		t[i].prog = xdp_program__clone(prog, 0);
#  296|-> 		err = libxdp_get_error(t[i].prog);
#  297|   		if (err) {
#  298|   			pr_warn("Failed to clone xdp_program: %s\n", strerror(-err));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def221]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:296:23: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:296:23: throw: if ‘libxdp_get_error’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:296:23: danger: ‘t’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  294|   
#  295|   		t[i].prog = xdp_program__clone(prog, 0);
#  296|-> 		err = libxdp_get_error(t[i].prog);
#  297|   		if (err) {
#  298|   			pr_warn("Failed to clone xdp_program: %s\n", strerror(-err));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: warning[-Wanalyzer-malloc-leak]: leak of ‘threads’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:278:19: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:297:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: danger: ‘threads’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  296|   		err = libxdp_get_error(t[i].prog);
#  297|   		if (err) {
#  298|-> 			pr_warn("Failed to clone xdp_program: %s\n", strerror(-err));
#  299|   			t[i].prog = NULL;
#  300|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:297:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: danger: ‘t’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  296|   		err = libxdp_get_error(t[i].prog);
#  297|   		if (err) {
#  298|-> 			pr_warn("Failed to clone xdp_program: %s\n", strerror(-err));
#  299|   			t[i].prog = NULL;
#  300|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:17: warning[-Wanalyzer-malloc-leak]: leak of ‘threads’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:278:19: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:297:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:316:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:39: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:17: throw: if ‘pthread_cancel’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:17: danger: ‘threads’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  315|   err:
#  316|   	for (i = 0; i < num_threads; i++) {
#  317|-> 		pthread_cancel(threads[i]);
#  318|   		xdp_program__close(t[i].prog);
#  319|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:17: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:297:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:316:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:39: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:17: throw: if ‘pthread_cancel’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:17: danger: ‘t’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  315|   err:
#  316|   	for (i = 0; i < num_threads; i++) {
#  317|-> 		pthread_cancel(threads[i]);
#  318|   		xdp_program__close(t[i].prog);
#  319|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:318:17: warning[-Wanalyzer-malloc-leak]: leak of ‘threads’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:278:19: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:297:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:316:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:39: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:318:17: throw: if ‘xdp_program__close’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:318:17: danger: ‘threads’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  316|   	for (i = 0; i < num_threads; i++) {
#  317|   		pthread_cancel(threads[i]);
#  318|-> 		xdp_program__close(t[i].prog);
#  319|   	}
#  320|   	free(t);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:318:17: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:279:12: branch_false: following ‘false’ branch (when ‘threads’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:284:13: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:285:12: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:291:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:292:26: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:297:20: branch_true: following ‘true’ branch (when ‘err != 0’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:298:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:316:21: branch_true: following ‘true’ branch (when ‘i < num_threads’)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:317:39: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:318:17: throw: if ‘xdp_program__close’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:318:17: danger: ‘t’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  316|   	for (i = 0; i < num_threads; i++) {
#  317|   		pthread_cancel(threads[i]);
#  318|-> 		xdp_program__close(t[i].prog);
#  319|   	}
#  320|   	free(t);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pkt’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:379:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:386:12: branch_false: following ‘false’ branch (when ‘pkt’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:389:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:14: throw: if ‘macaddr_is_null’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:14: danger: ‘pkt’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  395|   
#  396|   	memcpy(pkt->eth.h_source, &src_mac, sizeof(src_mac));
#  397|-> 	if (!macaddr_is_null(&cfg->dst_mac))
#  398|   		memcpy(pkt->eth.h_dest, &cfg->dst_mac, sizeof(cfg->dst_mac));
#  399|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pkt’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:379:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:386:12: branch_false: following ‘false’ branch (when ‘pkt’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:389:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: throw: if ‘ipaddr_is_null’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: danger: ‘pkt’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  398|   		memcpy(pkt->eth.h_dest, &cfg->dst_mac, sizeof(cfg->dst_mac));
#  399|   
#  400|-> 	if (!ipaddr_is_null(&cfg->src_ip)) {
#  401|   		if (cfg->src_ip.af != AF_INET6) {
#  402|   			pr_warn("Only IPv6 is supported\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:402:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pkt’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:379:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:386:12: branch_false: following ‘false’ branch (when ‘pkt’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:389:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:401:21: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:401:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:402:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:402:25: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:402:25: danger: ‘pkt’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  400|   	if (!ipaddr_is_null(&cfg->src_ip)) {
#  401|   		if (cfg->src_ip.af != AF_INET6) {
#  402|-> 			pr_warn("Only IPv6 is supported\n");
#  403|   			goto err;
#  404|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:408:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pkt’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:379:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:386:12: branch_false: following ‘false’ branch (when ‘pkt’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:389:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:408:14: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:408:14: throw: if ‘ipaddr_is_null’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:408:14: danger: ‘pkt’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  406|   	}
#  407|   
#  408|-> 	if (!ipaddr_is_null(&cfg->dst_ip)) {
#  409|   		if (cfg->dst_ip.af != AF_INET6) {
#  410|   			pr_warn("Only IPv6 is supported\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def232]
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:410:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pkt’
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:379:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:385:15: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:386:12: branch_false: following ‘false’ branch (when ‘pkt’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:389:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:397:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:14: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:400:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:408:14: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:408:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:409:21: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:409:20: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:410:25: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:410:25: throw: if ‘logging_print’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp-trafficgen.c:410:25: danger: ‘pkt’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  408|   	if (!ipaddr_is_null(&cfg->dst_ip)) {
#  409|   		if (cfg->dst_ip.af != AF_INET6) {
#  410|-> 			pr_warn("Only IPv6 is supported\n");
#  411|   			goto err;
#  412|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:97:1: enter_function: entry to ‘xdp_trafficgen__open_opts’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:103:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: call_function: calling ‘xdp_trafficgen__create_skeleton’ from ‘xdp_trafficgen__open_opts’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: return_function: returning to ‘xdp_trafficgen__open_opts’ from ‘xdp_trafficgen__create_skeleton’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:109:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  110|   		goto err_out;
#  111|   
#  112|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#  113|   	if (err)
#  114|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:97:1: enter_function: entry to ‘xdp_trafficgen__open_opts’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:102:40: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:103:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: call_function: calling ‘xdp_trafficgen__create_skeleton’ from ‘xdp_trafficgen__open_opts’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: return_function: returning to ‘xdp_trafficgen__open_opts’ from ‘xdp_trafficgen__create_skeleton’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:109:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: throw: if ‘bpf_object__open_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:112:15: danger: ‘obj’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  110|   		goto err_out;
#  111|   
#  112|-> 	err = bpf_object__open_skeleton(obj->skeleton, opts);
#  113|   	if (err)
#  114|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:175:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:180:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:187:46: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:189:12: branch_false: following ‘false’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:195:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:248:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:250:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  312|   	return 0;
#  313|   err:
#  314|-> 	bpf_object__destroy_skeleton(s);
#  315|   	return err;
#  316|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:97:1: enter_function: entry to ‘xdp_trafficgen__open_opts’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:102:40: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:103:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:108:15: call_function: calling ‘xdp_trafficgen__create_skeleton’ from ‘xdp_trafficgen__open_opts’
#  312|   	return 0;
#  313|   err:
#  314|-> 	bpf_object__destroy_skeleton(s);
#  315|   	return err;
#  316|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:174:43: acquire_memory: allocated here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:175:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:180:9: branch_false: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:189:12: branch_true: following ‘true’ branch...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:191:17: branch_true: ...to here
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: throw: if ‘bpf_object__destroy_skeleton’ throws an exception...
xdp-tools-1.6.0/xdp-trafficgen/xdp_trafficgen.skel.h:314:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  312|   	return 0;
#  313|   err:
#  314|-> 	bpf_object__destroy_skeleton(s);
#  315|   	return err;
#  316|   }

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
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-188.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-namexdp-tools-1.6.0-1.fc44
store-results-to/tmp/tmpei3a679n/xdp-tools-1.6.0-1.fc44.tar.xz
time-created2026-01-08 22:19:36
time-finished2026-01-08 22:21:39
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpei3a679n/xdp-tools-1.6.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpei3a679n/xdp-tools-1.6.0-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9