xen-4.20.2-2.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-571): [#def1]
/etc/xen/scripts/block:101:13: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   99|       if [ -e "$file" ]
#  100|       then
#  101|->       local d=$(device_major_minor "$file")
#  102|   
#  103|         # checking for $d in $devmm is best through the [[...]] bashism

Error: SHELLCHECK_WARNING (CWE-571): [#def2]
/etc/xen/scripts/block:130:17: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  128|             fi
#  129|           else
#  130|->           local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
#  131|             m=$(canonicalise_mode "$m")
#  132|   

Error: SHELLCHECK_WARNING (CWE-571): [#def3]
/etc/xen/scripts/block:158:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  156|   {
#  157|     local dev="$1"
#  158|->   local mode=$(canonicalise_mode "$2")
#  159|     local type="device"
#  160|     local result

Error: SHELLCHECK_WARNING (CWE-457): [#def4]
/etc/xen/scripts/block:250:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#  248|   fi
#  249|   
#  250|-> case "$command" in
#  251|     add)
#  252|       phys=$(xenstore_read_default "$XENBUS_PATH/physical-device" 'MISSING')

Error: SHELLCHECK_WARNING (CWE-563): [#def5]
/etc/xen/scripts/block:261:5: warning[SC2034]: FRONTEND_UUID appears unused. Verify use (or export if used externally).
#  259|   
#  260|       FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
#  261|->     FRONTEND_UUID=$(xenstore_read_default \
#  262|               "/local/domain/$FRONTEND_ID/vm" 'unknown')
#  263|   

Error: SHELLCHECK_WARNING (CWE-758): [#def6]
/etc/xen/scripts/block-common.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Copyright (c) 2005 XenSource Ltd.
#    3|   #

Error: SHELLCHECK_WARNING (CWE-457): [#def7]
/etc/xen/scripts/block-common.sh:23:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   21|   findCommand "$@"
#   22|   
#   23|-> if [ "$command" != "add" ] &&
#   24|      [ "$command" != "remove" ]
#   25|   then

Error: SHELLCHECK_WARNING (CWE-571): [#def8]
/etc/xen/scripts/block-common.sh:111:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  109|     # VM is the same as FRONTEND_UUID, because that way the 'sharing' will be
#  110|     # allowed.
#  111|->   local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
#  112|                     "$FRONTEND_UUID")
#  113|     local target=$(xenstore_read_default  "/local/domain/$FRONTEND_ID/target"   \

Error: SHELLCHECK_WARNING (CWE-571): [#def9]
/etc/xen/scripts/block-common.sh:113:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  111|     local othervm=$(xenstore_read_default "/local/domain/$otherdom/vm"         \
#  112|                     "$FRONTEND_UUID")
#  113|->   local target=$(xenstore_read_default  "/local/domain/$FRONTEND_ID/target"   \
#  114|                    "-1")
#  115|     local targetvm=$(xenstore_read_default "/local/domain/$target/vm" "No Target")

Error: SHELLCHECK_WARNING (CWE-571): [#def10]
/etc/xen/scripts/block-common.sh:115:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  113|     local target=$(xenstore_read_default  "/local/domain/$FRONTEND_ID/target"   \
#  114|                    "-1")
#  115|->   local targetvm=$(xenstore_read_default "/local/domain/$target/vm" "No Target")
#  116|     local otarget=$(xenstore_read_default  "/local/domain/$otherdom/target"   \
#  117|                    "-1")

Error: SHELLCHECK_WARNING (CWE-571): [#def11]
/etc/xen/scripts/block-common.sh:116:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  114|                    "-1")
#  115|     local targetvm=$(xenstore_read_default "/local/domain/$target/vm" "No Target")
#  116|->   local otarget=$(xenstore_read_default  "/local/domain/$otherdom/target"   \
#  117|                    "-1")
#  118|     local otvm=$(xenstore_read_default  "/local/domain/$otarget/vm"   \

Error: SHELLCHECK_WARNING (CWE-571): [#def12]
/etc/xen/scripts/block-common.sh:118:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  116|     local otarget=$(xenstore_read_default  "/local/domain/$otherdom/target"   \
#  117|                    "-1")
#  118|->   local otvm=$(xenstore_read_default  "/local/domain/$otarget/vm"   \
#  119|                    "No Other Target")
#  120|   

Error: SHELLCHECK_WARNING (CWE-477): [#def13]
/etc/xen/scripts/block-common.sh:123:35: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  121|     local frontend_uuid=${FRONTEND_UUID%-1}
#  122|     
#  123|->   [ "$frontend_uuid" = "$othervm" -o "$targetvm" = "$othervm" -o \
#  124|       "$frontend_uuid" = "$otvm" -o "$targetvm" = "$otvm" ]
#  125|   }

Error: SHELLCHECK_WARNING (CWE-477): [#def14]
/etc/xen/scripts/block-common.sh:123:63: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  121|     local frontend_uuid=${FRONTEND_UUID%-1}
#  122|     
#  123|->   [ "$frontend_uuid" = "$othervm" -o "$targetvm" = "$othervm" -o \
#  124|       "$frontend_uuid" = "$otvm" -o "$targetvm" = "$otvm" ]
#  125|   }

Error: SHELLCHECK_WARNING (CWE-477): [#def15]
/etc/xen/scripts/block-common.sh:124:32: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  122|     
#  123|     [ "$frontend_uuid" = "$othervm" -o "$targetvm" = "$othervm" -o \
#  124|->     "$frontend_uuid" = "$otvm" -o "$targetvm" = "$otvm" ]
#  125|   }
#  126|   

Error: SHELLCHECK_WARNING (CWE-140): [#def16]
/etc/xen/scripts/block-drbd-probe:34:26: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   32|   {
#   33|       local drbd_dev=$1
#   34|->     local drbd_dev_list=($(drbdadm sh-dev all))
#   35|       local drbd_res_list=($(drbdadm sh-resource all))
#   36|       local temp_drbd_dev temp_drbd_res

Error: SHELLCHECK_WARNING (CWE-140): [#def17]
/etc/xen/scripts/block-drbd-probe:35:26: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   33|       local drbd_dev=$1
#   34|       local drbd_dev_list=($(drbdadm sh-dev all))
#   35|->     local drbd_res_list=($(drbdadm sh-resource all))
#   36|       local temp_drbd_dev temp_drbd_res
#   37|       local found=0

Error: SHELLCHECK_WARNING (CWE-88): [#def18]
/etc/xen/scripts/block-drbd-probe:39:26: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   37|       local found=0
#   38|   
#   39|->     for temp_drbd_dev in ${drbd_dev_list[@]}; do
#   40|           if [[ "$temp_drbd_dev" == "$drbd_dev" ]]; then
#   41|               found=1

Error: SHELLCHECK_WARNING (CWE-88): [#def19]
/etc/xen/scripts/block-drbd-probe:50:26: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   48|       fi
#   49|   
#   50|->     for temp_drbd_res in ${drbd_res_list[@]}; do
#   51|           temp_drbd_dev=$(drbdadm sh-dev $temp_drbd_res)
#   52|           if [[ "$temp_drbd_dev" == "$drbd_dev" ]]; then

Error: SHELLCHECK_WARNING (CWE-140): [#def20]
/etc/xen/scripts/block-dummy:39:13: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   37|   parse_target()
#   38|   {
#   39|->     params=($(echo "$1" | tr ":" "\n"))
#   40|   
#   41|       type=${params[0]}

Error: SHELLCHECK_WARNING (CWE-457): [#def21]
/etc/xen/scripts/block-enbd:13:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   11|   . "$dir/block-common.sh"
#   12|   
#   13|-> case "$command" in
#   14|     add)
#   15|       for dev in /dev/nd*; do

Error: SHELLCHECK_WARNING (CWE-149): [#def22]
/etc/xen/scripts/block-iscsi:31:26: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   29|   remove_label()
#   30|   {
#   31|->     echo $1 | sed "s/^\("$2"\)//"
#   32|   }
#   33|   

Error: SHELLCHECK_WARNING: [#def23]
/etc/xen/scripts/block-iscsi:76:18: error[SC2144]: -e doesn't work with globs. Use a for loop.
#   74|   {
#   75|       count=0
#   76|->     while [ ! -e /dev/disk/by-path/*"$iqn"-lun-0 ]; do
#   77|           sleep 1
#   78|           count=`expr $count + 1`

Error: SHELLCHECK_WARNING (CWE-398): [#def24]
/etc/xen/scripts/block-iscsi:79:20: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   77|           sleep 1
#   78|           count=`expr $count + 1`
#   79|->         if [ count = 100 ]; then
#   80|               # 10s timeout while waiting for iSCSI disk to settle
#   81|               fatal "timeout waiting for iSCSI disk to settle"

Error: SHELLCHECK_WARNING (CWE-457): [#def25]
/etc/xen/scripts/block-nbd:13:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   11|   . "$dir/block-common.sh"
#   12|   
#   13|-> case "$command" in
#   14|     add)
#   15|       for dev in /dev/nbd*; do

Error: SHELLCHECK_WARNING (CWE-149): [#def26]
/etc/xen/scripts/block-tap:36:26: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   34|   remove_label()
#   35|   {
#   36|->     echo $1 | sed "s/^\("$2"\)//"
#   37|   }
#   38|   

Error: SHELLCHECK_WARNING (CWE-140): [#def27]
/etc/xen/scripts/block-tap:50:13: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#   48|   parse_target()
#   49|   {
#   50|->     params=($(echo "$1" | tr ":" "\n"))
#   51|   
#   52|       type=${params[0]}

Error: SHELLCHECK_WARNING (CWE-156): [#def28]
/etc/xen/scripts/block-tap:119:7: warning[SC2046]: Quote this to prevent word splitting.
#  117|   # be freed when there is a single one left.
#  118|   tap_shared() {
#  119|->     [ $( count_using "$file" ) -gt 1 ]
#  120|   }
#  121|   

Error: SHELLCHECK_WARNING (CWE-571): [#def29]
/etc/xen/scripts/block-tap:132:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  130|       for dom in $(xenstore-list "$base_path") ; do
#  131|           for dev in $(xenstore-list "$base_path/$dom") ; do
#  132|->             local f=$(xenstore_read_default "$base_path/$dom/$dev/params" "")
#  133|               f=$(echo "$f" | cut -d ":" -f 2)
#  134|   

Error: SHELLCHECK_WARNING (CWE-571): [#def30]
/etc/xen/scripts/block-tap:142:27: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  140|                       fi
#  141|                   else
#  142|->                     local m=$(xenstore_read_default "$base_path/$dom/$dev/mode"
#  143|                                                       "")
#  144|                       m=$(canonicalise_mode "$m")

Error: SHELLCHECK_WARNING: [#def31]
/etc/xen/scripts/block-tap:143:53: error[SC2286]: This empty string is interpreted as a command name. Double check syntax (or use 'true' as a no-op).
#  141|                   else
#  142|                       local m=$(xenstore_read_default "$base_path/$dom/$dev/mode"
#  143|->                                                     "")
#  144|                       m=$(canonicalise_mode "$m")
#  145|   

Error: SHELLCHECK_WARNING (CWE-457): [#def32]
/etc/xen/scripts/block-tap:173:30: warning[SC2154]: _lockfd is referenced but not assigned.
#  171|       # Ensure it is closed before running tap-ctl spawn, which needs to be
#  172|       # done in a subshell to continue holding the lock in the parent.
#  173|->     if ! pid=$( ( eval "exec $_lockfd>&-" ; tap-ctl spawn ) ) ; then
#  174|           tap-ctl free -m "$minor"
#  175|           fatal "Could not spawn tapdisk for $minor"

Error: SHELLCHECK_WARNING (CWE-563): [#def33]
/etc/xen/scripts/block-tap:267:1: warning[SC2034]: FRONTEND_UUID appears unused. Verify use (or export if used externally).
#  265|   # needed for same_vm
#  266|   FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
#  267|-> FRONTEND_UUID=$(xenstore_read_default \
#  268|                       "/local/domain/$FRONTEND_ID/vm" 'unknown')
#  269|   

Error: SHELLCHECK_WARNING (CWE-457): [#def34]
/etc/xen/scripts/colo-proxy-setup:9:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#    7|   findCommand "$@"
#    8|   
#    9|-> if [ "$command" != "setup" -a  "$command" != "teardown" ]
#   10|   then
#   11|       echo "Invalid command: $command"

Error: SHELLCHECK_WARNING (CWE-477): [#def35]
/etc/xen/scripts/colo-proxy-setup:9:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#    7|   findCommand "$@"
#    8|   
#    9|-> if [ "$command" != "setup" -a  "$command" != "teardown" ]
#   10|   then
#   11|       echo "Invalid command: $command"

Error: SHELLCHECK_WARNING (CWE-477): [#def36]
/etc/xen/scripts/colo-proxy-setup:26:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   24|   forwardbr="colobr0"
#   25|   
#   26|-> if [ "$mode" != "primary" -a "$mode" != "secondary" ]
#   27|   then
#   28|       echo "Invalid mode: $mode"

Error: SHELLCHECK_WARNING (CWE-477): [#def37]
/etc/xen/scripts/external-device-migrate:71:23: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   69|   	done
#   70|   
#   71|-> 	if [ "$step"    = "" -o \
#   72|   	     "$host"    = "" -o \
#   73|   	     "$typ"     = "" -o \

Error: SHELLCHECK_WARNING (CWE-477): [#def38]
/etc/xen/scripts/external-device-migrate:72:23: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   70|   
#   71|   	if [ "$step"    = "" -o \
#   72|-> 	     "$host"    = "" -o \
#   73|   	     "$typ"     = "" -o \
#   74|   	     "$domname" = "" ]; then

Error: SHELLCHECK_WARNING (CWE-477): [#def39]
/etc/xen/scripts/external-device-migrate:73:23: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   71|   	if [ "$step"    = "" -o \
#   72|   	     "$host"    = "" -o \
#   73|-> 	     "$typ"     = "" -o \
#   74|   	     "$domname" = "" ]; then
#   75|   	 	echo "Error: Parameter(s) missing (-step/-host/-type/-domname)" 1>&2

Error: SHELLCHECK_WARNING (CWE-569): [#def40]
/etc/xen/scripts/external-device-migrate:90:35: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems.
#   88|   	if [ "$recover" = "1" ]; then
#   89|   		func="$typ"_recover
#   90|-> 		eval $func $host $domname $step $*
#   91|   	else
#   92|   		func="$typ"_migration_step

Error: SHELLCHECK_WARNING (CWE-569): [#def41]
/etc/xen/scripts/external-device-migrate:93:35: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems.
#   91|   	else
#   92|   		func="$typ"_migration_step
#   93|-> 		eval $func $host $domname $step $*
#   94|   	fi
#   95|   }

Error: SHELLCHECK_WARNING (CWE-758): [#def42]
/etc/xen/scripts/hotplugpath.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> sbindir="/usr/sbin"
#    2|   bindir="/usr/bin"
#    3|   LIBEXEC="/usr/libexec/xen"

Error: SHELLCHECK_WARNING (CWE-563): [#def43]
/etc/xen/scripts/hotplugpath.sh:1:1: warning[SC2034]: sbindir appears unused. Verify use (or export if used externally).
#    1|-> sbindir="/usr/sbin"
#    2|   bindir="/usr/bin"
#    3|   LIBEXEC="/usr/libexec/xen"

Error: SHELLCHECK_WARNING (CWE-563): [#def44]
/etc/xen/scripts/hotplugpath.sh:2:1: warning[SC2034]: bindir appears unused. Verify use (or export if used externally).
#    1|   sbindir="/usr/sbin"
#    2|-> bindir="/usr/bin"
#    3|   LIBEXEC="/usr/libexec/xen"
#    4|   LIBEXEC_BIN="/usr/libexec/xen/bin"

Error: SHELLCHECK_WARNING (CWE-563): [#def45]
/etc/xen/scripts/hotplugpath.sh:3:1: warning[SC2034]: LIBEXEC appears unused. Verify use (or export if used externally).
#    1|   sbindir="/usr/sbin"
#    2|   bindir="/usr/bin"
#    3|-> LIBEXEC="/usr/libexec/xen"
#    4|   LIBEXEC_BIN="/usr/libexec/xen/bin"
#    5|   libdir="/usr/lib64"

Error: SHELLCHECK_WARNING (CWE-563): [#def46]
/etc/xen/scripts/hotplugpath.sh:4:1: warning[SC2034]: LIBEXEC_BIN appears unused. Verify use (or export if used externally).
#    2|   bindir="/usr/bin"
#    3|   LIBEXEC="/usr/libexec/xen"
#    4|-> LIBEXEC_BIN="/usr/libexec/xen/bin"
#    5|   libdir="/usr/lib64"
#    6|   SHAREDIR="/usr/share"

Error: SHELLCHECK_WARNING (CWE-563): [#def47]
/etc/xen/scripts/hotplugpath.sh:5:1: warning[SC2034]: libdir appears unused. Verify use (or export if used externally).
#    3|   LIBEXEC="/usr/libexec/xen"
#    4|   LIBEXEC_BIN="/usr/libexec/xen/bin"
#    5|-> libdir="/usr/lib64"
#    6|   SHAREDIR="/usr/share"
#    7|   XENFIRMWAREDIR="/usr/libexec/xen/boot"

Error: SHELLCHECK_WARNING (CWE-563): [#def48]
/etc/xen/scripts/hotplugpath.sh:6:1: warning[SC2034]: SHAREDIR appears unused. Verify use (or export if used externally).
#    4|   LIBEXEC_BIN="/usr/libexec/xen/bin"
#    5|   libdir="/usr/lib64"
#    6|-> SHAREDIR="/usr/share"
#    7|   XENFIRMWAREDIR="/usr/libexec/xen/boot"
#    8|   XEN_CONFIG_DIR="/etc/xen"

Error: SHELLCHECK_WARNING (CWE-563): [#def49]
/etc/xen/scripts/hotplugpath.sh:7:1: warning[SC2034]: XENFIRMWAREDIR appears unused. Verify use (or export if used externally).
#    5|   libdir="/usr/lib64"
#    6|   SHAREDIR="/usr/share"
#    7|-> XENFIRMWAREDIR="/usr/libexec/xen/boot"
#    8|   XEN_CONFIG_DIR="/etc/xen"
#    9|   XEN_SCRIPT_DIR="/etc/xen/scripts"

Error: SHELLCHECK_WARNING (CWE-563): [#def50]
/etc/xen/scripts/hotplugpath.sh:8:1: warning[SC2034]: XEN_CONFIG_DIR appears unused. Verify use (or export if used externally).
#    6|   SHAREDIR="/usr/share"
#    7|   XENFIRMWAREDIR="/usr/libexec/xen/boot"
#    8|-> XEN_CONFIG_DIR="/etc/xen"
#    9|   XEN_SCRIPT_DIR="/etc/xen/scripts"
#   10|   XEN_LOCK_DIR="/var/lock"

Error: SHELLCHECK_WARNING (CWE-563): [#def51]
/etc/xen/scripts/hotplugpath.sh:9:1: warning[SC2034]: XEN_SCRIPT_DIR appears unused. Verify use (or export if used externally).
#    7|   XENFIRMWAREDIR="/usr/libexec/xen/boot"
#    8|   XEN_CONFIG_DIR="/etc/xen"
#    9|-> XEN_SCRIPT_DIR="/etc/xen/scripts"
#   10|   XEN_LOCK_DIR="/var/lock"
#   11|   XEN_RUN_DIR="/var/run/xen"

Error: SHELLCHECK_WARNING (CWE-563): [#def52]
/etc/xen/scripts/hotplugpath.sh:10:1: warning[SC2034]: XEN_LOCK_DIR appears unused. Verify use (or export if used externally).
#    8|   XEN_CONFIG_DIR="/etc/xen"
#    9|   XEN_SCRIPT_DIR="/etc/xen/scripts"
#   10|-> XEN_LOCK_DIR="/var/lock"
#   11|   XEN_RUN_DIR="/var/run/xen"
#   12|   XEN_PAGING_DIR="/var/lib/xen/xenpaging"

Error: SHELLCHECK_WARNING (CWE-563): [#def53]
/etc/xen/scripts/hotplugpath.sh:11:1: warning[SC2034]: XEN_RUN_DIR appears unused. Verify use (or export if used externally).
#    9|   XEN_SCRIPT_DIR="/etc/xen/scripts"
#   10|   XEN_LOCK_DIR="/var/lock"
#   11|-> XEN_RUN_DIR="/var/run/xen"
#   12|   XEN_PAGING_DIR="/var/lib/xen/xenpaging"
#   13|   XEN_DUMP_DIR="/var/lib/xen/dump"

Error: SHELLCHECK_WARNING (CWE-563): [#def54]
/etc/xen/scripts/hotplugpath.sh:12:1: warning[SC2034]: XEN_PAGING_DIR appears unused. Verify use (or export if used externally).
#   10|   XEN_LOCK_DIR="/var/lock"
#   11|   XEN_RUN_DIR="/var/run/xen"
#   12|-> XEN_PAGING_DIR="/var/lib/xen/xenpaging"
#   13|   XEN_DUMP_DIR="/var/lib/xen/dump"
#   14|   XEN_LOG_DIR="/var/log/xen"

Error: SHELLCHECK_WARNING (CWE-563): [#def55]
/etc/xen/scripts/hotplugpath.sh:13:1: warning[SC2034]: XEN_DUMP_DIR appears unused. Verify use (or export if used externally).
#   11|   XEN_RUN_DIR="/var/run/xen"
#   12|   XEN_PAGING_DIR="/var/lib/xen/xenpaging"
#   13|-> XEN_DUMP_DIR="/var/lib/xen/dump"
#   14|   XEN_LOG_DIR="/var/log/xen"
#   15|   XEN_LIB_DIR="/var/lib/xen"

Error: SHELLCHECK_WARNING (CWE-563): [#def56]
/etc/xen/scripts/hotplugpath.sh:14:1: warning[SC2034]: XEN_LOG_DIR appears unused. Verify use (or export if used externally).
#   12|   XEN_PAGING_DIR="/var/lib/xen/xenpaging"
#   13|   XEN_DUMP_DIR="/var/lib/xen/dump"
#   14|-> XEN_LOG_DIR="/var/log/xen"
#   15|   XEN_LIB_DIR="/var/lib/xen"
#   16|   XEN_RUN_STORED="/var/run/xenstored"

Error: SHELLCHECK_WARNING (CWE-563): [#def57]
/etc/xen/scripts/hotplugpath.sh:15:1: warning[SC2034]: XEN_LIB_DIR appears unused. Verify use (or export if used externally).
#   13|   XEN_DUMP_DIR="/var/lib/xen/dump"
#   14|   XEN_LOG_DIR="/var/log/xen"
#   15|-> XEN_LIB_DIR="/var/lib/xen"
#   16|   XEN_RUN_STORED="/var/run/xenstored"

Error: SHELLCHECK_WARNING (CWE-563): [#def58]
/etc/xen/scripts/hotplugpath.sh:16:1: warning[SC2034]: XEN_RUN_STORED appears unused. Verify use (or export if used externally).
#   14|   XEN_LOG_DIR="/var/log/xen"
#   15|   XEN_LIB_DIR="/var/lib/xen"
#   16|-> XEN_RUN_STORED="/var/run/xenstored"

Error: SHELLCHECK_WARNING (CWE-138): [#def59]
/etc/xen/scripts/launch-xenstore:42:25: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   40|   	# Exit if we timed out
#   41|   	if ! [ $time -lt $timeout ] ; then
#   42|-> 		echo "Could not start $@"
#   43|   		return 1
#   44|   	fi

Error: SHELLCHECK_WARNING (CWE-758): [#def60]
/etc/xen/scripts/locking.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Copyright (c) 2005 XenSource Ltd.
#    3|   # Copyright (c) 2007 Red Hat

Error: SHELLCHECK_WARNING (CWE-477): [#def61]
/etc/xen/scripts/locking.sh:28:32: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   26|       local i
#   27|       for ((i = 0; i < ${#_lockdict}; i++))
#   28|->     do [ -z "${_lockdict[$i]}" -o "${_lockdict[$i]}" = "$1" ] && break
#   29|       done
#   30|       _lockdict[$i]="$1"

Error: SHELLCHECK_WARNING (CWE-758): [#def62]
/etc/xen/scripts/logging.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Copyright (c) 2005 XenSource Ltd.
#    3|   #

Error: SHELLCHECK_WARNING (CWE-138): [#def63]
/etc/xen/scripts/logging.sh:20:55: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   18|     local level="$1"
#   19|     shift
#   20|->   logger -p "daemon.$level" -- "$0:" "$@" || echo "$0 $@" >&2
#   21|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def64]
/etc/xen/scripts/remus-netbuf-setup:82:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   80|   findCommand "$@"
#   81|   
#   82|-> if [ "$command" != "setup" -a  "$command" != "teardown" ]
#   83|   then
#   84|     echo "Invalid command: $command"

Error: SHELLCHECK_WARNING (CWE-477): [#def65]
/etc/xen/scripts/remus-netbuf-setup:82:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   80|   findCommand "$@"
#   81|   
#   82|-> if [ "$command" != "setup" -a  "$command" != "teardown" ]
#   83|   then
#   84|     echo "Invalid command: $command"

Error: SHELLCHECK_WARNING (CWE-571): [#def66]
/etc/xen/scripts/remus-netbuf-setup:121:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  119|   #return 0 if the ifb is free
#  120|   check_ifb() {
#  121|->     local installed=`nl-qdisc-list -d $1`
#  122|       [ -n "$installed" ] && return 1
#  123|   

Error: SHELLCHECK_WARNING (CWE-571): [#def67]
/etc/xen/scripts/remus-netbuf-setup:132:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  130|               local path="/libxl/$domid/remus/netbuf/$devid/ifb"
#  131|               xenstore-exists $path || continue
#  132|->             local ifb=`xenstore-read "$path" 2>/dev/null || true`
#  133|               [ "$ifb" = "$1" ] && return 1
#  134|           done

Error: SHELLCHECK_WARNING (CWE-571): [#def68]
/etc/xen/scripts/remus-netbuf-setup:200:15: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  198|       #up freeing another domain's allocated IFB inside the if loop.
#  199|       xenstore-exists "$XENBUS_PATH/ifb" && \
#  200|->         local ifb2=`xenstore-read "$XENBUS_PATH/ifb" 2>/dev/null || true`
#  201|   
#  202|       if [[ "$ifb2" && "$ifb2" == "$ifb" ]]; then

Error: SHELLCHECK_WARNING (CWE-457): [#def69]
/etc/xen/scripts/vif-bridge:79:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   77|   fi
#   78|   
#   79|-> case "$command" in
#   80|       add|online)
#   81|           setup_virtual_bridge_port "$dev"

Error: SHELLCHECK_WARNING (CWE-457): [#def70]
/etc/xen/scripts/vif-bridge:81:36: warning[SC2154]: dev is referenced but not assigned.
#   79|   case "$command" in
#   80|       add|online)
#   81|->         setup_virtual_bridge_port "$dev"
#   82|           set_mtu "$bridge" "$dev" "$type_if"
#   83|           add_to_bridge "$bridge" "$dev"

Error: SHELLCHECK_WARNING (CWE-457): [#def71]
/etc/xen/scripts/vif-bridge:82:35: warning[SC2154]: type_if is referenced but not assigned.
#   80|       add|online)
#   81|           setup_virtual_bridge_port "$dev"
#   82|->         set_mtu "$bridge" "$dev" "$type_if"
#   83|           add_to_bridge "$bridge" "$dev"
#   84|           ;;

Error: SHELLCHECK_WARNING (CWE-477): [#def72]
/etc/xen/scripts/vif-bridge:95:23: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   93|   
#   94|   log debug "Successful vif-bridge $command for $dev, bridge $bridge."
#   95|-> if [ "$type_if" = vif -a "$command" = "online" ]
#   96|   then
#   97|     success

Error: SHELLCHECK_WARNING (CWE-758): [#def73]
/etc/xen/scripts/vif-common.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Copyright (c) 2005 XenSource Ltd.
#    3|   #

Error: SHELLCHECK_WARNING (CWE-457): [#def74]
/etc/xen/scripts/vif-common.sh:24:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   22|   findCommand "$@"
#   23|   
#   24|-> if [ "$command" != "online" ]  &&
#   25|      [ "$command" != "offline" ] &&
#   26|      [ "$command" != "add" ]     &&

Error: SHELLCHECK_WARNING (CWE-457): [#def75]
/etc/xen/scripts/vif-common.sh:47:13: warning[SC2154]: vif is referenced but not assigned.
#   45|   case "$type_if" in
#   46|       vif)
#   47|->         dev=$vif
#   48|           ;;
#   49|       tap)

Error: SHELLCHECK_WARNING: [#def76]
/etc/xen/scripts/vif-common.sh:141:10: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
#  139|   	    # If we succeed, then -w is supported; don't check again
#  140|   	    IPTABLES_WAIT_RUNE_CHECKED=true
#  141|-> 	elif [[ $? == 2 ]] ; then
#  142|   	    iptables -L -n >& /dev/null
#  143|   	    if [[ $? != 2 ]] ; then

Error: SHELLCHECK_WARNING (CWE-477): [#def77]
/etc/xen/scripts/vif-common.sh:157:31: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  155|   frob_iptable()
#  156|   {
#  157|->   if [ "$command" == "online" -o "$command" == "add" ]
#  158|     then
#  159|       local c="-I"

Error: SHELLCHECK_WARNING (CWE-477): [#def78]
/etc/xen/scripts/vif-common.sh:169:34: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  167|       -j ACCEPT 2>/dev/null
#  168|   
#  169|->   if [ \( "$command" == "online" -o "$command" == "add" \) -a $? -ne 0 ]
#  170|     then
#  171|       log err "iptables setup failed. This may affect guest networking."

Error: SHELLCHECK_WARNING (CWE-477): [#def79]
/etc/xen/scripts/vif-common.sh:169:60: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  167|       -j ACCEPT 2>/dev/null
#  168|   
#  169|->   if [ \( "$command" == "online" -o "$command" == "add" \) -a $? -ne 0 ]
#  170|     then
#  171|       log err "iptables setup failed. This may affect guest networking."

Error: SHELLCHECK_WARNING (CWE-571): [#def80]
/etc/xen/scripts/vif-common.sh:238:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  236|   {
#  237|     local nd=${netdev:-eth0}
#  238|->   local result=$(ip_of "$nd")
#  239|     if [ -z "$result" ]
#  240|     then

Error: SHELLCHECK_WARNING (CWE-156): [#def81]
/etc/xen/scripts/vif-nat:64:8: warning[SC2046]: Quote this to prevent word splitting.
#   62|   routing_ip()
#   63|   {
#   64|->   echo $(echo $1 | awk -F. '{print $1"."$2"."$3"."$4 + 127}')
#   65|   }
#   66|   

Error: SHELLCHECK_WARNING (CWE-571): [#def82]
/etc/xen/scripts/vif-nat:96:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   94|   dhcparg_remove_entry()
#   95|   {
#   96|->   local tmpfile=$(mktemp)
#   97|     sed -e "s/${dev} //" "$dhcpd_arg_file" >"$tmpfile"
#   98|     if ! diff "$tmpfile" "$dhcpd_arg_file" >/dev/null

Error: SHELLCHECK_WARNING (CWE-457): [#def83]
/etc/xen/scripts/vif-nat:97:13: warning[SC2154]: dev is referenced but not assigned.
#   95|   {
#   96|     local tmpfile=$(mktemp)
#   97|->   sed -e "s/${dev} //" "$dhcpd_arg_file" >"$tmpfile"
#   98|     if ! diff "$tmpfile" "$dhcpd_arg_file" >/dev/null
#   99|     then

Error: SHELLCHECK_WARNING (CWE-571): [#def84]
/etc/xen/scripts/vif-nat:108:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  106|   {
#  107|     dhcparg_remove_entry
#  108|->   local tmpfile=$(mktemp)
#  109|     # handle Red Hat, SUSE, and Debian styles, with or without quotes
#  110|     sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"${dev} "'"/' \

Error: SHELLCHECK_WARNING (CWE-571): [#def85]
/etc/xen/scripts/vif-nat:121:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  119|   dhcp_remove_entry()
#  120|   {
#  121|->   local tmpfile=$(mktemp)
#  122|     grep -v "host $hostname" "$dhcpd_conf_file" >"$tmpfile"
#  123|     if ! diff "$tmpfile" "$dhcpd_conf_file" >/dev/null

Error: SHELLCHECK_WARNING (CWE-457): [#def86]
/etc/xen/scripts/vif-nat:159:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#  157|   
#  158|   
#  159|-> case "$command" in
#  160|       online)
#  161|           if ip route | grep -q "dev ${dev}"

Error: SHELLCHECK_WARNING (CWE-571): [#def87]
/etc/xen/scripts/vif-openvswitch:49:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   47|   openvswitch_external_id_all() {
#   48|       local dev=$1
#   49|->     local frontend_id=$(xenstore_read "$XENBUS_PATH/frontend-id")
#   50|       local vm_path=$(xenstore_read "/local/domain/${frontend_id}/vm")
#   51|       local name=$(xenstore_read "${vm_path}/name")

Error: SHELLCHECK_WARNING (CWE-571): [#def88]
/etc/xen/scripts/vif-openvswitch:50:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   48|       local dev=$1
#   49|       local frontend_id=$(xenstore_read "$XENBUS_PATH/frontend-id")
#   50|->     local vm_path=$(xenstore_read "/local/domain/${frontend_id}/vm")
#   51|       local name=$(xenstore_read "${vm_path}/name")
#   52|       openvswitch_external_id $dev "xen-vm-name" "$name"

Error: SHELLCHECK_WARNING (CWE-571): [#def89]
/etc/xen/scripts/vif-openvswitch:51:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   49|       local frontend_id=$(xenstore_read "$XENBUS_PATH/frontend-id")
#   50|       local vm_path=$(xenstore_read "/local/domain/${frontend_id}/vm")
#   51|->     local name=$(xenstore_read "${vm_path}/name")
#   52|       openvswitch_external_id $dev "xen-vm-name" "$name"
#   53|       local uuid=$(xenstore_read "${vm_path}/uuid")

Error: SHELLCHECK_WARNING (CWE-571): [#def90]
/etc/xen/scripts/vif-openvswitch:53:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   51|       local name=$(xenstore_read "${vm_path}/name")
#   52|       openvswitch_external_id $dev "xen-vm-name" "$name"
#   53|->     local uuid=$(xenstore_read "${vm_path}/uuid")
#   54|       openvswitch_external_id $dev "xen-vm-uuid" "$uuid"
#   55|       local mac=$(xenstore_read "$XENBUS_PATH/mac")

Error: SHELLCHECK_WARNING (CWE-571): [#def91]
/etc/xen/scripts/vif-openvswitch:55:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   53|       local uuid=$(xenstore_read "${vm_path}/uuid")
#   54|       openvswitch_external_id $dev "xen-vm-uuid" "$uuid"
#   55|->     local mac=$(xenstore_read "$XENBUS_PATH/mac")
#   56|       openvswitch_external_id $dev "attached-mac" "$mac"
#   57|   }

Error: SHELLCHECK_WARNING (CWE-571): [#def92]
/etc/xen/scripts/vif-openvswitch:61:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   59|   add_to_openvswitch () {
#   60|       local dev=$1
#   61|->     local bridge="$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge")"
#   62|       local tag trunk
#   63|   

Error: SHELLCHECK_WARNING (CWE-571): [#def93]
/etc/xen/scripts/vif-openvswitch:80:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   78|       fi
#   79|   
#   80|->     local vif_details="$(openvswitch_external_id_all $dev)"
#   81|   
#   82|       do_or_die ovs-vsctl --timeout=30 \

Error: SHELLCHECK_WARNING (CWE-457): [#def94]
/etc/xen/scripts/vif-openvswitch:88:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   86|   }
#   87|   
#   88|-> case "$command" in
#   89|       add|online)
#   90|           check_tools

Error: SHELLCHECK_WARNING (CWE-457): [#def95]
/etc/xen/scripts/vif-openvswitch:102:7: warning[SC2154]: type_if is referenced but not assigned.
#  100|   esac
#  101|   
#  102|-> if [ "$type_if" = vif ]; then
#  103|       handle_iptable
#  104|   fi

Error: SHELLCHECK_WARNING (CWE-477): [#def96]
/etc/xen/scripts/vif-openvswitch:107:23: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  105|   
#  106|   log debug "Successful vif-openvswitch $command for $dev."
#  107|-> if [ "$type_if" = vif -a "$command" = "online" ]; then
#  108|       success
#  109|   fi

Error: SHELLCHECK_WARNING (CWE-457): [#def97]
/etc/xen/scripts/vif-route:24:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   22|   main_ip=$(dom0_ip)
#   23|   
#   24|-> case "${command}" in
#   25|       add|online)
#   26|           ifconfig ${dev} ${main_ip} netmask 255.255.255.255 up

Error: SHELLCHECK_WARNING (CWE-457): [#def98]
/etc/xen/scripts/vif-route:26:18: warning[SC2154]: dev is referenced but not assigned.
#   24|   case "${command}" in
#   25|       add|online)
#   26|->         ifconfig ${dev} ${main_ip} netmask 255.255.255.255 up
#   27|           echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
#   28|           ipcmd='add'

Error: SHELLCHECK_WARNING (CWE-457): [#def99]
/etc/xen/scripts/vif-route:38:7: warning[SC2154]: type_if is referenced but not assigned.
#   36|   esac
#   37|   
#   38|-> case "${type_if}" in
#   39|       tap)
#   40|   	metric=1

Error: SHELLCHECK_WARNING (CWE-457): [#def100]
/etc/xen/scripts/vif-route:52:13: warning[SC2154]: ip is referenced but not assigned.
#   50|   # If we've been given a list of IP addresses, then add routes from dom0 to
#   51|   # the guest using those addresses.
#   52|-> for addr in ${ip} ; do
#   53|       ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip} metric ${metric}
#   54|   done

Error: SHELLCHECK_WARNING (CWE-457): [#def101]
/etc/xen/scripts/vif-setup:3:10: warning[SC2154]: script is referenced but not assigned.
#    1|   #!/usr/bin/bash
#    2|   
#    3|-> if test "$script"
#    4|   then
#    5|       exec $script $*

Error: SHELLCHECK_WARNING (CWE-569): [#def102]
/etc/xen/scripts/vif-setup:5:18: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems.
#    3|   if test "$script"
#    4|   then
#    5|->     exec $script $*
#    6|   else
#    7|       exec /etc/xen/scripts/vif-bridge $*

Error: SHELLCHECK_WARNING (CWE-569): [#def103]
/etc/xen/scripts/vif-setup:7:38: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems.
#    5|       exec $script $*
#    6|   else
#    7|->     exec /etc/xen/scripts/vif-bridge $*
#    8|   fi
#    9|   

Error: SHELLCHECK_WARNING (CWE-457): [#def104]
/etc/xen/scripts/vscsi:12:7: warning[SC2154]: command is referenced but not assigned (for output from commands, use "$(command ...)" ).
#   10|   findCommand "$@"
#   11|   
#   12|-> case "$command" in
#   13|   	add)
#   14|   		success

Error: SHELLCHECK_WARNING (CWE-758): [#def105]
/etc/xen/scripts/xen-hotplug-common.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Copyright (c) 2005 XenSource Ltd.
#    3|   #

Error: SHELLCHECK_WARNING (CWE-457): [#def106]
/etc/xen/scripts/xen-hotplug-common.sh:25:14: warning[SC2154]: bindir is referenced but not assigned.
#   23|   exec 2>>/var/log/xen/xen-hotplug.log
#   24|   
#   25|-> export PATH="${bindir}:${sbindir}:${LIBEXEC_BIN}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
#   26|   export LD_LIBRARY_PATH="${libdir}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH"
#   27|   export LANG="POSIX"

Error: SHELLCHECK_WARNING (CWE-457): [#def107]
/etc/xen/scripts/xen-hotplug-common.sh:25:24: warning[SC2154]: sbindir is referenced but not assigned.
#   23|   exec 2>>/var/log/xen/xen-hotplug.log
#   24|   
#   25|-> export PATH="${bindir}:${sbindir}:${LIBEXEC_BIN}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
#   26|   export LD_LIBRARY_PATH="${libdir}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH"
#   27|   export LANG="POSIX"

Error: SHELLCHECK_WARNING (CWE-457): [#def108]
/etc/xen/scripts/xen-hotplug-common.sh:26:25: warning[SC2154]: libdir is referenced but not assigned.
#   24|   
#   25|   export PATH="${bindir}:${sbindir}:${LIBEXEC_BIN}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
#   26|-> export LD_LIBRARY_PATH="${libdir}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH"
#   27|   export LANG="POSIX"
#   28|   unset $(set | grep ^LC_ | cut -d= -f1)

Error: SHELLCHECK_WARNING (CWE-156): [#def109]
/etc/xen/scripts/xen-hotplug-common.sh:28:7: warning[SC2046]: Quote this to prevent word splitting.
#   26|   export LD_LIBRARY_PATH="${libdir}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH"
#   27|   export LANG="POSIX"
#   28|-> unset $(set | grep ^LC_ | cut -d= -f1)
#   29|   
#   30|   fatal() {

Error: SHELLCHECK_WARNING (CWE-138): [#def110]
/etc/xen/scripts/xen-hotplug-common.sh:43:18: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   41|   
#   42|   do_or_die() {
#   43|->   "$@" || fatal "$@ failed"
#   44|   }
#   45|   

Error: SHELLCHECK_WARNING (CWE-138): [#def111]
/etc/xen/scripts/xen-hotplug-common.sh:47:34: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   45|   
#   46|   do_without_error() {
#   47|->   "$@" 2>/dev/null || log debug "$@ failed"
#   48|   }
#   49|   

Error: SHELLCHECK_WARNING (CWE-571): [#def112]
/etc/xen/scripts/xen-hotplug-common.sh:64:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   62|   #
#   63|   xenstore_read() {
#   64|->   local v=$(xenstore-read "$@" || true)
#   65|     [ "$v" != "" ] || fatal "xenstore-read $@ failed."
#   66|     echo "$v"

Error: SHELLCHECK_WARNING (CWE-138): [#def113]
/etc/xen/scripts/xen-hotplug-common.sh:65:42: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   63|   xenstore_read() {
#   64|     local v=$(xenstore-read "$@" || true)
#   65|->   [ "$v" != "" ] || fatal "xenstore-read $@ failed."
#   66|     echo "$v"
#   67|   }

Error: SHELLCHECK_WARNING (CWE-138): [#def114]
/etc/xen/scripts/xen-hotplug-common.sh:87:22: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   85|   #
#   86|   _xenstore_write() {
#   87|->   log debug "Writing $@ to xenstore."
#   88|     xenstore-write "$@"
#   89|   }

Error: SHELLCHECK_WARNING (CWE-138): [#def115]
/etc/xen/scripts/xen-hotplug-common.sh:98:42: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   96|   #
#   97|   xenstore_write() {
#   98|->   _xenstore_write "$@" || fatal "Writing $@ to xenstore failed."
#   99|   }
#  100|   

Error: SHELLCHECK_WARNING (CWE-398): [#def116]
/etc/xen/scripts/xen-network-common.sh:57:8: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
#   55|     for file in $@
#   56|     do
#   57|->     if [ "$t" "$file" ]
#   58|       then
#   59|         echo "$file"

Error: SHELLCHECK_WARNING (CWE-398): [#def117]
/etc/xen/scripts/xen-network-common.sh:57:16: error[SC1072]: Expected comparison operator (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.
#   55|     for file in $@
#   56|     do
#   57|->     if [ "$t" "$file" ]
#   58|       then
#   59|         echo "$file"

Error: SHELLCHECK_WARNING (CWE-758): [#def118]
/etc/xen/scripts/xen-script-common.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> #
#    2|   # Copyright (c) 2005 XenSource Ltd.
#    3|   #

Error: SHELLCHECK_WARNING (CWE-563): [#def119]
/etc/xen/scripts/xen-script-common.sh:39:7: warning[SC2034]: command appears unused. Verify use (or export if used externally).
#   37|       if ! expr 'index' "$arg" '=' >/dev/null
#   38|       then
#   39|->       command="$arg"
#   40|         return
#   41|       fi

Error: SHELLCHECK_WARNING (CWE-457): [#def120]
/usr/libexec/xen/bin/xendomains:32:5: warning[SC2154]: sbindir is referenced but not assigned.
#   30|   . /etc/xen/scripts/hotplugpath.sh
#   31|   
#   32|-> CMD=${sbindir}/xl
#   33|   HEADCOMP="Xen saved domain"
#   34|   $CMD list &> /dev/null

Error: SHELLCHECK_WARNING: [#def121]
/usr/libexec/xen/bin/xendomains:37:7: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
#   35|   if test $? -ne 0
#   36|   then
#   37|-> 	exit $?
#   38|   fi
#   39|   

Error: SHELLCHECK_WARNING (CWE-398): [#def122]
/usr/libexec/xen/bin/xendomains:80:9: warning[SC1010]: Use semicolon or linefeed before 'done' (or quote to make it literal).
#   78|   	_RC_UNUSED=3
#   79|       else
#   80|-> 	_SMSG=(done failed failed missed failed skipped unused failed failed)
#   81|   	_RC_UNUSED=6
#   82|       fi

Error: SHELLCHECK_WARNING: [#def123]
/usr/libexec/xen/bin/xendomains:132:9: error[SC2151]: Only one integer 0-255 can be returned. Use stdout for other data.
#  130|       rc_check()
#  131|       {
#  132|-> 	return rc_failed $?
#  133|       }
#  134|       rc_status()

Error: SHELLCHECK_WARNING (CWE-156): [#def124]
/usr/libexec/xen/bin/xendomains:173:23: warning[SC2046]: Quote this to prevent word splitting.
#  171|   contains_something()
#  172|   {
#  173|->   if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ]
#  174|     then
#  175|       return 0

Error: SHELLCHECK_WARNING (CWE-457): [#def125]
/usr/libexec/xen/bin/xendomains:208:15: warning[SC2154]: bindir is referenced but not assigned.
#  206|   get_xsdomid()
#  207|   {
#  208|->     XS_DOMID=`${bindir}/xenstore-read /tool/xenstored/domid 2>/dev/null`
#  209|       if test $? -ne 0; then
#  210|           XS_DOMID=0

Error: SHELLCHECK_WARNING: [#def126]
/usr/libexec/xen/bin/xendomains:217:19: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally.
#  215|   parseln()
#  216|   {
#  217|->     if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; then
#  218|           name=;id=
#  219|       elif [[ "$1" =~ '(name' ]]; then

Error: SHELLCHECK_WARNING: [#def127]
/usr/libexec/xen/bin/xendomains:219:21: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally.
#  217|       if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; then
#  218|           name=;id=
#  219|->     elif [[ "$1" =~ '(name' ]]; then
#  220|           name=$(echo $1 | sed -e 's/^.*(name \(.*\))$/\1/')
#  221|       elif [[ "$1" =~ '(domid' ]]; then

Error: SHELLCHECK_WARNING: [#def128]
/usr/libexec/xen/bin/xendomains:221:21: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally.
#  219|       elif [[ "$1" =~ '(name' ]]; then
#  220|           name=$(echo $1 | sed -e 's/^.*(name \(.*\))$/\1/')
#  221|->     elif [[ "$1" =~ '(domid' ]]; then
#  222|           id=$(echo $1 | sed -e 's/^.*(domid \(.*\))$/\1/')
#  223|       elif [[ "$1" =~ '"name":' ]]; then

Error: SHELLCHECK_WARNING (CWE-477): [#def129]
/usr/libexec/xen/bin/xendomains:229:18: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  227|       fi
#  228|   
#  229|->     [ -n "$name" -a -n "$id" ] && return 0 || return 1
#  230|   }
#  231|   

Error: SHELLCHECK_WARNING (CWE-691): [#def130]
/usr/libexec/xen/bin/xendomains:243:7: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob.
#  241|   	if test $id = $XS_DOMID; then continue; fi
#  242|   	case $name in
#  243|-> 	    ($NM)
#  244|   		RC=0
#  245|   		;;

Error: SHELLCHECK_WARNING (CWE-156): [#def131]
/usr/libexec/xen/bin/xendomains:258:14: warning[SC2046]: Quote this to prevent word splitting.
#  256|       fi
#  257|   
#  258|->     mkdir -p $(dirname "$LOCKFILE")
#  259|       touch $LOCKFILE
#  260|   

Error: SHELLCHECK_WARNING: [#def132]
/usr/libexec/xen/bin/xendomains:276:35: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  274|                       if [ $? -ne 0 ]; then
#  275|                           echo -e "\nAn error occurred while restoring domain ${dom##*/}:\n$XMR"
#  276|->                         rc_failed $?
#  277|                           echo -e '!'
#  278|                       else

Error: SHELLCHECK_WARNING: [#def133]
/usr/libexec/xen/bin/xendomains:310:17: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  308|   		if [ $? -ne 0 ]; then
#  309|   		    echo -e "\nAn error occurred while creating domain ${dom##*/}: $XMC\n"
#  310|-> 		    rc_failed $?
#  311|   		    echo -e '!'
#  312|   		else

Error: SHELLCHECK_WARNING (CWE-457): [#def134]
/usr/libexec/xen/bin/xendomains:328:11: warning[SC2154]: state is referenced but not assigned.
#  326|   	if test $id = 0; then continue; fi
#  327|   	if test $id = $XS_DOMID; then continue; fi
#  328|-> 	if test "$state" != "-b---d" -a "$state" != "-----d"; then
#  329|   	    return 1;
#  330|   	fi

Error: SHELLCHECK_WARNING (CWE-563): [#def135]
/usr/libexec/xen/bin/xendomains:348:5: warning[SC2034]: no appears unused. Verify use (or export if used externally).
#  346|   
#  347|       usleep 20000
#  348|->     for no in `seq 0 $XENDOMAINS_STOP_MAXWAIT`; do
#  349|   	# exit if $CMD save/migrate/shutdown is finished
#  350|   	PSAX=`ps axlw | grep "$CMD $1" | grep -v grep`

Error: SHELLCHECK_WARNING (CWE-563): [#def136]
/usr/libexec/xen/bin/xendomains:358:10: warning[SC2034]: PSF appears unused. Verify use (or export if used externally).
#  356|       done
#  357|       sleep 1
#  358|->     read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
#  359|       # kill $CMD $1
#  360|       kill $PSPID >/dev/null 2>&1

Error: SHELLCHECK_WARNING (CWE-563): [#def137]
/usr/libexec/xen/bin/xendomains:358:14: warning[SC2034]: PSUID appears unused. Verify use (or export if used externally).
#  356|       done
#  357|       sleep 1
#  358|->     read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
#  359|       # kill $CMD $1
#  360|       kill $PSPID >/dev/null 2>&1

Error: SHELLCHECK_WARNING (CWE-563): [#def138]
/usr/libexec/xen/bin/xendomains:358:26: warning[SC2034]: PSPPID appears unused. Verify use (or export if used externally).
#  356|       done
#  357|       sleep 1
#  358|->     read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
#  359|       # kill $CMD $1
#  360|       kill $PSPID >/dev/null 2>&1

Error: SHELLCHECK_WARNING: [#def139]
/usr/libexec/xen/bin/xendomains:403:17: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  401|   		if test $? -ne 0; then
#  402|   		    echo -e "\nAn error occurred while doing sysrq on domain:\n$XMR\n"
#  403|-> 		    rc_failed $?
#  404|   		    echo -n '!'
#  405|   		fi

Error: SHELLCHECK_WARNING: [#def140]
/usr/libexec/xen/bin/xendomains:421:13: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  419|   	    if test $? -ne 0; then
#  420|   		echo -e "\nAn error occurred while migrating domain:\n$XMR\n"
#  421|-> 		rc_failed $?
#  422|   		echo -e '!'
#  423|   

Error: SHELLCHECK_WARNING: [#def141]
/usr/libexec/xen/bin/xendomains:441:13: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  439|   	    if test $? -ne 0; then
#  440|   		echo -e "\nAn error occurred while saving domain:\n$XMR\n"
#  441|-> 		rc_failed $?
#  442|   		echo -e '!'
#  443|   		kill $WDOG_PID >/dev/null 2>&1

Error: SHELLCHECK_WARNING: [#def142]
/usr/libexec/xen/bin/xendomains:459:13: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  457|   	    if test $? -ne 0; then
#  458|   		echo -e "\nAn error occurred while shutting down domain:\n$XMR\n"
#  459|-> 		rc_failed $?
#  460|   		echo -e '!'
#  461|   	    fi

Error: SHELLCHECK_WARNING: [#def143]
/usr/libexec/xen/bin/xendomains:478:16: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  476|   	if test $? -ne 0; then
#  477|   	    echo -e "\nAn error occurred while shutting down all domains: $XMR\n"
#  478|-> 	    rc_failed $?
#  479|   	    echo -e '!'
#  480|   	fi

Error: SHELLCHECK_WARNING (CWE-691): [#def144]
/usr/libexec/xen/bin/xendomains:497:7: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob.
#  495|   	if test $id = 0; then continue; fi
#  496|   	case $name in
#  497|-> 	    ($1)
#  498|   		return 0
#  499|   		;;

Error: SHELLCHECK_WARNING (CWE-563): [#def145]
/usr/libexec/xen/bin/xendomains:514:2: warning[SC2034]: found appears unused. Verify use (or export if used externally).
#  512|       for nm in $XENDOMAINS_AUTO/*; do
#  513|   	rdname $nm
#  514|-> 	found=0
#  515|   	if check_domain_up "$NM"; then
#  516|   	    echo -n " $name"

Error: CPPCHECK_WARNING (CWE-476): [#def146]
xen-4.20.2/extras/mini-os/9pfront.c:371: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: target
#  369|       if ( len <= *len1 )
#  370|       {
#  371|->         memcpy(target, *buf1, len);
#  372|           *buf1 += len;
#  373|           *len1 -= len;

Error: CPPCHECK_WARNING (CWE-476): [#def147]
xen-4.20.2/extras/mini-os/9pfront.c:377: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: target
#  375|       else
#  376|       {
#  377|->         memcpy(target, *buf1, *len1);
#  378|           target = (char *)target + *len1;
#  379|           len -= *len1;

Error: CPPCHECK_WARNING (CWE-682): [#def148]
xen-4.20.2/extras/mini-os/9pfront.c:378: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  376|       {
#  377|           memcpy(target, *buf1, *len1);
#  378|->         target = (char *)target + *len1;
#  379|           len -= *len1;
#  380|           *buf1 = *buf2;

Error: CPPCHECK_WARNING (CWE-476): [#def149]
xen-4.20.2/extras/mini-os/9pfront.c:436: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: str
#  434|           str = malloc(len + 1);
#  435|           copy_bufs(&buf1, &buf2, &len1, &len2, str, len);
#  436|->         str[len] = 0;
#  437|           printk("9pfs: request %u resulted in \"%s\"\n", req->cmd, str);
#  438|           free(str);

Error: CPPCHECK_WARNING (CWE-476): [#def150]
xen-4.20.2/extras/mini-os/9pfront.c:984: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: f9pfs
#  982|   
#  983|       f9pfs = calloc(1, sizeof(*f9pfs));
#  984|->     f9pfs->dev = mnt->dev;
#  985|       f9pfs->fid = P9_ROOT_FID;
#  986|   

Error: CPPCHECK_WARNING (CWE-476): [#def151]
xen-4.20.2/extras/mini-os/9pfront.c:985: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: f9pfs
#  983|       f9pfs = calloc(1, sizeof(*f9pfs));
#  984|       f9pfs->dev = mnt->dev;
#  985|->     f9pfs->fid = P9_ROOT_FID;
#  986|   
#  987|       fd = alloc_fd(ftype_9pfs);

Error: CPPCHECK_WARNING (CWE-476): [#def152]
xen-4.20.2/extras/mini-os/9pfront.c:1086: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1084|       printk("9pfsfront add %u, for mount at %s\n", id, mnt);
# 1085|       dev = malloc(sizeof(*dev));
# 1086|->     memset(dev, 0, sizeof(*dev));
# 1087|       snprintf(dev->nodename, sizeof(dev->nodename), "device/9pfs/%u", id);
# 1088|       dev->id = id;

Error: CPPCHECK_WARNING (CWE-476): [#def153]
xen-4.20.2/extras/mini-os/9pfront.c:1087: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1085|       dev = malloc(sizeof(*dev));
# 1086|       memset(dev, 0, sizeof(*dev));
# 1087|->     snprintf(dev->nodename, sizeof(dev->nodename), "device/9pfs/%u", id);
# 1088|       dev->id = id;
# 1089|       init_waitqueue_head(&dev->waitq);

Error: CPPCHECK_WARNING (CWE-476): [#def154]
xen-4.20.2/extras/mini-os/9pfront.c:1088: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1086|       memset(dev, 0, sizeof(*dev));
# 1087|       snprintf(dev->nodename, sizeof(dev->nodename), "device/9pfs/%u", id);
# 1088|->     dev->id = id;
# 1089|       init_waitqueue_head(&dev->waitq);
# 1090|       init_SEMAPHORE(&dev->ring_out_sem, 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def155]
xen-4.20.2/extras/mini-os/9pfront.c:1088:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dev’
xen-4.20.2/extras/mini-os/9pfront.c:1085:11: acquire_memory: this call could return NULL
xen-4.20.2/extras/mini-os/9pfront.c:1088:5: danger: ‘dev’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1086|       memset(dev, 0, sizeof(*dev));
# 1087|       snprintf(dev->nodename, sizeof(dev->nodename), "device/9pfs/%u", id);
# 1088|->     dev->id = id;
# 1089|       init_waitqueue_head(&dev->waitq);
# 1090|       init_SEMAPHORE(&dev->ring_out_sem, 1);

Error: CPPCHECK_WARNING (CWE-476): [#def156]
xen-4.20.2/extras/mini-os/9pfront.c:1092: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1090|       init_SEMAPHORE(&dev->ring_out_sem, 1);
# 1091|       init_SEMAPHORE(&dev->ring_in_sem, 1);
# 1092|->     dev->fid_mask = ~0ULL;
# 1093|   
# 1094|       for ( i = 0; i < N_REQS; i++ )

Error: CPPCHECK_WARNING (CWE-476): [#def157]
xen-4.20.2/extras/mini-os/9pfront.c:1096: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1094|       for ( i = 0; i < N_REQS; i++ )
# 1095|       {
# 1096|->         dev->req[i].id = i;
# 1097|           dev->req[i].next_free = i + 1;
# 1098|       }

Error: CPPCHECK_WARNING (CWE-476): [#def158]
xen-4.20.2/extras/mini-os/9pfront.c:1097: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1095|       {
# 1096|           dev->req[i].id = i;
# 1097|->         dev->req[i].next_free = i + 1;
# 1098|       }
# 1099|       dev->free_reqs = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def159]
xen-4.20.2/extras/mini-os/9pfront.c:1099: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1097|           dev->req[i].next_free = i + 1;
# 1098|       }
# 1099|->     dev->free_reqs = 0;
# 1100|   
# 1101|       msg = xenbus_read_unsigned(XBT_NIL, dev->nodename, "backend-id", &dev->dom);

Error: CPPCHECK_WARNING (CWE-476): [#def160]
xen-4.20.2/extras/mini-os/9pfront.c:1101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
# 1099|       dev->free_reqs = 0;
# 1100|   
# 1101|->     msg = xenbus_read_unsigned(XBT_NIL, dev->nodename, "backend-id", &dev->dom);
# 1102|       if ( msg )
# 1103|           goto err;

Error: CPPCHECK_WARNING (CWE-457): [#def161]
xen-4.20.2/extras/mini-os/arch/x86/gnttab.c:70: warning[uninitvar]: Uninitialized variable: frames
#   68|       }
#   69|   
#   70|->     return map_frames(frames, nr_grant_frames);
#   71|   }
#   72|   #endif

Error: CPPCHECK_WARNING (CWE-119): [#def162]
xen-4.20.2/extras/mini-os/arch/x86/mm.c:804: error[bufferAccessOutOfBounds]: Buffer is accessed out of bounds: &_text
#  802|   
#  803|       /* Use first page as the CoW zero page */
#  804|->     memset(&_text, 0, PAGE_SIZE);
#  805|       mfn_zero = virt_to_mfn((unsigned long) &_text);
#  806|   #ifdef CONFIG_PARAVIRT

Error: GCC_ANALYZER_WARNING (CWE-787): [#def163]
xen-4.20.2/extras/mini-os/arch/x86/mm.c:804:5: warning[-Wanalyzer-out-of-bounds]: buffer overflow
#  802|   
#  803|       /* Use first page as the CoW zero page */
#  804|->     memset(&_text, 0, PAGE_SIZE);
#  805|       mfn_zero = virt_to_mfn((unsigned long) &_text);
#  806|   #ifdef CONFIG_PARAVIRT

Error: GCC_ANALYZER_WARNING (CWE-476): [#def164]
xen-4.20.2/extras/mini-os/arch/x86/mm.c:811:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pgt’
xen-4.20.2/extras/mini-os/arch/x86/mm.c:794:13: enter_function: entry to ‘clear_bootstrap’
xen-4.20.2/extras/mini-os/arch/x86/mm.c:810:11: call_function: calling ‘get_pgt’ from ‘clear_bootstrap’
xen-4.20.2/extras/mini-os/arch/x86/mm.c:810:11: return_function: return of NULL to ‘clear_bootstrap’ from ‘get_pgt’
xen-4.20.2/extras/mini-os/arch/x86/mm.c:811:5: danger: dereference of NULL ‘pgt’
#  809|   #else
#  810|       pgt = get_pgt((unsigned long)&_text);
#  811|->     *pgt = 0;
#  812|       invlpg((unsigned long)&_text);
#  813|   #endif

Error: CPPCHECK_WARNING (CWE-476): [#def165]
xen-4.20.2/extras/mini-os/console.c:368: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  366|   
#  367|       dev = malloc(sizeof(struct consfront_dev));
#  368|->     memset(dev, 0, sizeof(struct consfront_dev));
#  369|       dev->nodename = "device/console";
#  370|       dev->dom = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def166]
xen-4.20.2/extras/mini-os/console.c:369: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  367|       dev = malloc(sizeof(struct consfront_dev));
#  368|       memset(dev, 0, sizeof(struct consfront_dev));
#  369|->     dev->nodename = "device/console";
#  370|       dev->dom = 0;
#  371|       dev->backend = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def167]
xen-4.20.2/extras/mini-os/console.c:370: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  368|       memset(dev, 0, sizeof(struct consfront_dev));
#  369|       dev->nodename = "device/console";
#  370|->     dev->dom = 0;
#  371|       dev->backend = 0;
#  372|       dev->ring_ref = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def168]
xen-4.20.2/extras/mini-os/console.c:371: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  369|       dev->nodename = "device/console";
#  370|       dev->dom = 0;
#  371|->     dev->backend = 0;
#  372|       dev->ring_ref = 0;
#  373|   

Error: CPPCHECK_WARNING (CWE-476): [#def169]
xen-4.20.2/extras/mini-os/console.c:372: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  370|       dev->dom = 0;
#  371|       dev->backend = 0;
#  372|->     dev->ring_ref = 0;
#  373|   
#  374|   #ifdef HAVE_LIBC

Error: CPPCHECK_WARNING (CWE-476): [#def170]
xen-4.20.2/extras/mini-os/console.c:375: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  373|   
#  374|   #ifdef HAVE_LIBC
#  375|->     dev->fd = -1;
#  376|   #endif
#  377|   

Error: CPPCHECK_WARNING (CWE-476): [#def171]
xen-4.20.2/extras/mini-os/console.c:385: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  383|       int err;
#  384|   
#  385|->     dev->evtchn = console_evtchn;
#  386|       dev->ring = xencons_interface();
#  387|   

Error: CPPCHECK_WARNING (CWE-476): [#def172]
xen-4.20.2/extras/mini-os/console.c:386: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  384|   
#  385|       dev->evtchn = console_evtchn;
#  386|->     dev->ring = xencons_interface();
#  387|   
#  388|       err = bind_evtchn(dev->evtchn, console_handle_input, dev);

Error: CPPCHECK_WARNING (CWE-476): [#def173]
xen-4.20.2/extras/mini-os/console.c:388: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  386|       dev->ring = xencons_interface();
#  387|   
#  388|->     err = bind_evtchn(dev->evtchn, console_handle_input, dev);
#  389|       if ( err <= 0 )
#  390|       {

Error: CPPCHECK_WARNING (CWE-476): [#def174]
xen-4.20.2/extras/mini-os/console.c:395: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dev
#  393|           return NULL;
#  394|       }
#  395|->     unmask_evtchn(dev->evtchn);
#  396|   
#  397|       /* In case we have in-flight data after save/restore... */

Error: GCC_ANALYZER_WARNING (CWE-835): [#def175]
xen-4.20.2/extras/mini-os/gnttab.c:138:12: warning[-Wanalyzer-infinite-loop]: infinite loop
xen-4.20.2/extras/mini-os/gnttab.c:138:12: danger: infinite loop here
xen-4.20.2/extras/mini-os/gnttab.c:138:12: branch_true: if it ever follows ‘true’ branch, it will always do so...
xen-4.20.2/extras/mini-os/gnttab.c:138:12: branch_true: ...to here
#  136|   
#  137|       /* If a transfer is in progress then wait until it is completed. */
#  138|->     while (!(flags & GTF_transfer_completed)) {
#  139|           flags = gnttab_table[ref].flags;
#  140|       }

Error: CPPCHECK_WARNING (CWE-476): [#def176]
xen-4.20.2/extras/mini-os/include/posix/pthread.h:14: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: *key
#   12|   {
#   13|       *key = malloc(sizeof(**key));
#   14|->     (*key)->ptr = NULL;
#   15|       return 0;
#   16|   }

Error: CPPCHECK_WARNING (CWE-758): [#def177]
xen-4.20.2/extras/mini-os/kernel.c:71: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   69|           
#   70|           for (j=0; j<32; j++)
#   71|->             xen_features[i*32+j] = !!(fi.submap & 1<<j);
#   72|       }
#   73|   }

Error: CPPCHECK_WARNING (CWE-369): [#def178]
xen-4.20.2/extras/mini-os/lib/math.c:163: error[zerodiv]: Division by zero.
#  161|   		static volatile const unsigned int zero = 0;
#  162|   
#  163|-> 		tmp.ul[H] = tmp.ul[L] = 1 / zero;
#  164|   		if (arq)
#  165|   			*arq = uq;

Error: CPPCHECK_WARNING (CWE-476): [#def179]
xen-4.20.2/extras/mini-os/lib/sys.c:678: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  676|       DIR *ret;
#  677|       ret = malloc(sizeof(*ret));
#  678|->     ret->name = strdup(name);
#  679|       ret->offset = 0;
#  680|       ret->entries = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def180]
xen-4.20.2/extras/mini-os/lib/sys.c:678:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
xen-4.20.2/extras/mini-os/lib/sys.c:677:11: acquire_memory: this call could return NULL
xen-4.20.2/extras/mini-os/lib/sys.c:678:5: danger: ‘ret’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  676|       DIR *ret;
#  677|       ret = malloc(sizeof(*ret));
#  678|->     ret->name = strdup(name);
#  679|       ret->offset = 0;
#  680|       ret->entries = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def181]
xen-4.20.2/extras/mini-os/lib/sys.c:679: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  677|       ret = malloc(sizeof(*ret));
#  678|       ret->name = strdup(name);
#  679|->     ret->offset = 0;
#  680|       ret->entries = NULL;
#  681|       ret->curentry = -1;

Error: CPPCHECK_WARNING (CWE-476): [#def182]
xen-4.20.2/extras/mini-os/lib/sys.c:680: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  678|       ret->name = strdup(name);
#  679|       ret->offset = 0;
#  680|->     ret->entries = NULL;
#  681|       ret->curentry = -1;
#  682|       ret->nbentries = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def183]
xen-4.20.2/extras/mini-os/lib/sys.c:681: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  679|       ret->offset = 0;
#  680|       ret->entries = NULL;
#  681|->     ret->curentry = -1;
#  682|       ret->nbentries = 0;
#  683|       ret->has_more = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def184]
xen-4.20.2/extras/mini-os/lib/sys.c:682: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  680|       ret->entries = NULL;
#  681|       ret->curentry = -1;
#  682|->     ret->nbentries = 0;
#  683|       ret->has_more = 1;
#  684|       return ret;

Error: CPPCHECK_WARNING (CWE-476): [#def185]
xen-4.20.2/extras/mini-os/lib/sys.c:683: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  681|       ret->curentry = -1;
#  682|       ret->nbentries = 0;
#  683|->     ret->has_more = 1;
#  684|       return ret;
#  685|   }

Error: CPPCHECK_WARNING (CWE-476): [#def186]
xen-4.20.2/extras/mini-os/lib/sys.c:1531: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mfns
# 1529|               }
# 1530|   #endif
# 1531|->         mfns[i] = virtual_to_mfn(data + i * PAGE_SIZE);
# 1532|       }
# 1533|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def187]
xen-4.20.2/extras/mini-os/lib/sys.c:1531:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mfns’
xen-4.20.2/extras/mini-os/lib/sys.c:1514:8: branch_false: following ‘false’ branch...
xen-4.20.2/extras/mini-os/lib/sys.c:1516:10: branch_false: ...to here
xen-4.20.2/extras/mini-os/lib/sys.c:1521:12: acquire_memory: this call could return NULL
xen-4.20.2/extras/mini-os/lib/sys.c:1522:17: branch_true: following ‘true’ branch (when ‘i < n’)...
xen-4.20.2/extras/mini-os/lib/sys.c:1531:19: branch_true: ...to here
xen-4.20.2/extras/mini-os/lib/sys.c:1531:9: danger: ‘mfns + (long unsigned int)i * 8’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1529|               }
# 1530|   #endif
# 1531|->         mfns[i] = virtual_to_mfn(data + i * PAGE_SIZE);
# 1532|       }
# 1533|   

Error: CPPCHECK_WARNING (CWE-476): [#def188]
xen-4.20.2/extras/mini-os/lib/xs.c:143: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ret
#  141|       msg = xenbus_msg_reply(type, t, iovec, num_vecs);
#  142|       ret = malloc(msg->len);
#  143|->     memcpy(ret, (char*) msg + sizeof(*msg), msg->len);
#  144|       if (len)
#  145|   	*len = msg->len - 1;

Error: CPPCHECK_WARNING (CWE-476): [#def189]
xen-4.20.2/extras/mini-os/lib/xs.c:200: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: entries
#  198|   	memcpy(entry, res[i], l);
#  199|   	free(res[i]);
#  200|-> 	entries[i] = entry;
#  201|   	entry += l;
#  202|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def190]
xen-4.20.2/extras/mini-os/lib/xs.c:200:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘entries’
xen-4.20.2/extras/mini-os/lib/xs.c:183:8: branch_false: following ‘false’ branch (when ‘msg’ is NULL)...
xen-4.20.2/extras/mini-os/lib/xs.c:183:8: branch_false: ...to here
xen-4.20.2/extras/mini-os/lib/xs.c:193:15: acquire_memory: this call could return NULL
xen-4.20.2/extras/mini-os/lib/xs.c:196:17: branch_true: following ‘true’ branch (when ‘i < n’)...
xen-4.20.2/extras/mini-os/lib/xs.c:197:27: branch_true: ...to here
xen-4.20.2/extras/mini-os/lib/xs.c:200:9: danger: ‘entries + (long unsigned int)i * 8’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  198|   	memcpy(entry, res[i], l);
#  199|   	free(res[i]);
#  200|-> 	entries[i] = entry;
#  201|   	entry += l;
#  202|       }

Error: CPPCHECK_WARNING (CWE-758): [#def191]
xen-4.20.2/extras/mini-os/main.c:70: error[subtractPointers]: Subtracting pointers that point to different objects
#   68|   
#   69|   #ifdef CONFIG_SPARSE_BSS
#   70|->     sparse((unsigned long) &__app_bss_start, &__app_bss_end - &__app_bss_start);
#   71|   #endif
#   72|   #if defined(HAVE_LWIP) && defined(CONFIG_START_NETWORK) && defined(CONFIG_NETFRONT)

Error: GCC_ANALYZER_WARNING (CWE-469): [#def192]
xen-4.20.2/extras/mini-os/main.c:70:46: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#   68|   
#   69|   #ifdef CONFIG_SPARSE_BSS
#   70|->     sparse((unsigned long) &__app_bss_start, &__app_bss_end - &__app_bss_start);
#   71|   #endif
#   72|   #if defined(HAVE_LWIP) && defined(CONFIG_START_NETWORK) && defined(CONFIG_NETFRONT)

Error: CPPCHECK_WARNING (CWE-476): [#def193]
xen-4.20.2/extras/mini-os/xenbus.c:148: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: event
#  146|       struct xenbus_event *event = malloc(sizeof(*event));
#  147|   
#  148|->     event->next = *queue;
#  149|       *queue = event;
#  150|       wake_up(&xenbus_watch_queue);

Error: CPPCHECK_WARNING (CWE-682): [#def194]
xen-4.20.2/extras/mini-os/xenbus.c:313: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  311|               int zeroes = 0;
#  312|   
#  313|->             data = (char *)event + sizeof(*event);
#  314|               xenbus_read_data(data, msg.len);
#  315|   

Error: CPPCHECK_WARNING (CWE-476): [#def195]
xen-4.20.2/extras/mini-os/xenbus.c:353: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  351|   
#  352|           data = malloc(sizeof(msg) + msg.len);
#  353|->         memcpy(data, &msg, sizeof(msg));
#  354|           xenbus_read_data(data + sizeof(msg), msg.len);
#  355|   

Error: CPPCHECK_WARNING (CWE-682): [#def196]
xen-4.20.2/extras/mini-os/xenbus.c:354: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  352|           data = malloc(sizeof(msg) + msg.len);
#  353|           memcpy(data, &msg, sizeof(msg));
#  354|->         xenbus_read_data(data + sizeof(msg), msg.len);
#  355|   
#  356|           if ( msg.req_id >= NR_REQS || !req_info[msg.req_id].in_use )

Error: CPPCHECK_WARNING (CWE-476): [#def197]
xen-4.20.2/extras/mini-os/xenbus.c:629: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  627|   
#  628|       res = malloc(rep->len + 1);
#  629|->     memcpy(res, rep + 1, rep->len);
#  630|       res[rep->len] = 0;
#  631|       free(rep);

Error: CPPCHECK_WARNING (CWE-476): [#def198]
xen-4.20.2/extras/mini-os/xenbus.c:630: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  628|       res = malloc(rep->len + 1);
#  629|       memcpy(res, rep + 1, rep->len);
#  630|->     res[rep->len] = 0;
#  631|       free(rep);
#  632|   

Error: CPPCHECK_WARNING (CWE-476): [#def199]
xen-4.20.2/extras/mini-os/xenbus.c:665: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  663|           int l = strlen((char *)reply + x);
#  664|   
#  665|->         res[i] = malloc(l + 1);
#  666|           memcpy(res[i], (char *)reply + x, l + 1);
#  667|           x += l + 1;

Error: CPPCHECK_WARNING (CWE-476): [#def200]
xen-4.20.2/extras/mini-os/xenbus.c:666: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  664|   
#  665|           res[i] = malloc(l + 1);
#  666|->         memcpy(res[i], (char *)reply + x, l + 1);
#  667|           x += l + 1;
#  668|       }

Error: CPPCHECK_WARNING (CWE-476): [#def201]
xen-4.20.2/extras/mini-os/xenbus.c:670: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  668|       }
#  669|   
#  670|->     res[i] = NULL;
#  671|       free(repmsg);
#  672|       *contents = res;

Error: CPPCHECK_WARNING (CWE-476): [#def202]
xen-4.20.2/extras/mini-os/xenbus.c:693: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  691|   
#  692|       res = malloc(rep->len + 1);
#  693|->     memcpy(res, rep + 1, rep->len);
#  694|       res[rep->len] = 0;
#  695|       free(rep);

Error: CPPCHECK_WARNING (CWE-476): [#def203]
xen-4.20.2/extras/mini-os/xenbus.c:694: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  692|       res = malloc(rep->len + 1);
#  693|       memcpy(res, rep + 1, rep->len);
#  694|->     res[rep->len] = 0;
#  695|       free(rep);
#  696|       *value = res;

Error: CPPCHECK_WARNING (CWE-476): [#def204]
xen-4.20.2/extras/mini-os/xenbus.c:821: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  819|   
#  820|       res = malloc(rep->len + 1);
#  821|->     memcpy(res, rep + 1, rep->len);
#  822|       res[rep->len] = 0;
#  823|       free(rep);

Error: CPPCHECK_WARNING (CWE-476): [#def205]
xen-4.20.2/extras/mini-os/xenbus.c:822: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
#  820|       res = malloc(rep->len + 1);
#  821|       memcpy(res, rep + 1, rep->len);
#  822|->     res[rep->len] = 0;
#  823|       free(rep);
#  824|       *value = res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
xen-4.20.2/extras/mini-os/xenbus.c:992:1: warning[-Wanalyzer-malloc-leak]: leak of ‘dom_id’
xen-4.20.2/extras/mini-os/include/xenbus.h:126:9: enter_function: entry to ‘xenbus_get_self_id’
xen-4.20.2/extras/mini-os/xenbus.c:988:5: call_function: calling ‘xenbus_read’ from ‘xenbus_get_self_id’
xen-4.20.2/extras/mini-os/xenbus.c:988:5: return_function: returning to ‘xenbus_get_self_id’ from ‘xenbus_read’
xen-4.20.2/extras/mini-os/xenbus.c:988:5: branch_false: following ‘false’ branch...
xen-4.20.2/extras/mini-os/xenbus.c:989:5: branch_false: ...to here
xen-4.20.2/extras/mini-os/xenbus.c:992:1: danger: ‘dom_id’ leaks here; was allocated at [(47)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/46)
#  990|   
#  991|       return ret;
#  992|-> }
#  993|   EXPORT_SYMBOL(xenbus_get_self_id);
#  994|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def207]
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:93:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘r’
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:77:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:81:14: branch_false: ...to here
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:82:8: branch_false: following ‘false’ branch (when ‘nullfd >= 0’)...
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:84:9: branch_false: ...to here
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:84:9: acquire_resource: opened here
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:85:8: branch_false: following ‘false’ branch (when ‘r >= 0’)...
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:87:5: branch_false: ...to here
xen-4.20.2/stubdom/libs-x86_64/toolcore/handlereg.c:93:1: danger: ‘r’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   91|       if (nullfd >= 0) close(nullfd);
#   92|       return -1;
#   93|-> }
#   94|   
#   95|   /*

Error: COMPILER_WARNING: [#def208]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:67:13: warning[-Wold-style-definition]: old-style function definition
#   65|   
#   66|   
#   67|-> static void DEFUN(init_string_with_size,(buffer, size),
#   68|   	   string_type *buffer AND
#   69|   	   unsigned int size )

Error: COMPILER_WARNING: [#def209]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:38: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘init_string_with_size’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:67:19: warning[-Wold-style-definition]: old-style function definition
#   67 | static void DEFUN(init_string_with_size,(buffer, size),
#      |                   ^~~~~~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#   65|   
#   66|   
#   67|-> static void DEFUN(init_string_with_size,(buffer, size),
#   68|   	   string_type *buffer AND
#   69|   	   unsigned int size )

Error: COMPILER_WARNING: [#def210]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:76:13: warning[-Wold-style-definition]: old-style function definition
#   74|   }
#   75|   
#   76|-> static void DEFUN(init_string,(buffer),
#   77|   	   string_type *buffer)
#   78|   {

Error: COMPILER_WARNING: [#def211]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘init_string’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:76:19: warning[-Wold-style-definition]: old-style function definition
#   76 | static void DEFUN(init_string,(buffer),
#      |                   ^~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#   74|   }
#   75|   
#   76|-> static void DEFUN(init_string,(buffer),
#   77|   	   string_type *buffer)
#   78|   {

Error: COMPILER_WARNING: [#def212]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:83:12: warning[-Wold-style-definition]: old-style function definition
#   81|   }
#   82|   
#   83|-> static int DEFUN(find, (str, what),
#   84|   	  string_type *str AND
#   85|   	  char *what)

Error: COMPILER_WARNING: [#def213]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘find’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:83:18: warning[-Wold-style-definition]: old-style function definition
#   83 | static int DEFUN(find, (str, what),
#      |                  ^~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#   81|   }
#   82|   
#   83|-> static int DEFUN(find, (str, what),
#   84|   	  string_type *str AND
#   85|   	  char *what)

Error: COMPILER_WARNING: [#def214]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:101:13: warning[-Wold-style-definition]: old-style function definition
#   99|   }
#  100|   
#  101|-> static void DEFUN(write_buffer,(buffer),
#  102|   	   string_type *buffer)
#  103|   {

Error: COMPILER_WARNING: [#def215]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘write_buffer’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:101:19: warning[-Wold-style-definition]: old-style function definition
#  101 | static void DEFUN(write_buffer,(buffer),
#      |                   ^~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#   99|   }
#  100|   
#  101|-> static void DEFUN(write_buffer,(buffer),
#  102|   	   string_type *buffer)
#  103|   {

Error: COMPILER_WARNING: [#def216]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:108:13: warning[-Wold-style-definition]: old-style function definition
#  106|   
#  107|   
#  108|-> static void DEFUN(delete_string,(buffer),
#  109|   	   string_type *buffer)
#  110|   {

Error: COMPILER_WARNING: [#def217]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘delete_string’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:108:19: warning[-Wold-style-definition]: old-style function definition
#  108 | static void DEFUN(delete_string,(buffer),
#      |                   ^~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  106|   
#  107|   
#  108|-> static void DEFUN(delete_string,(buffer),
#  109|   	   string_type *buffer)
#  110|   {

Error: COMPILER_WARNING: [#def218]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:115:14: warning[-Wold-style-definition]: old-style function definition
#  113|   
#  114|   
#  115|-> static char *DEFUN(addr, (buffer, idx),
#  116|   	    string_type *buffer AND
#  117|   	    unsigned int idx)

Error: COMPILER_WARNING: [#def219]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘addr’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:115:20: warning[-Wold-style-definition]: old-style function definition
#  115 | static char *DEFUN(addr, (buffer, idx),
#      |                    ^~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  113|   
#  114|   
#  115|-> static char *DEFUN(addr, (buffer, idx),
#  116|   	    string_type *buffer AND
#  117|   	    unsigned int idx)

Error: COMPILER_WARNING: [#def220]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:122:13: warning[-Wold-style-definition]: old-style function definition
#  120|   }
#  121|   
#  122|-> static char DEFUN(at,(buffer, pos),
#  123|   	   string_type *buffer AND
#  124|   	   unsigned int pos) 

Error: COMPILER_WARNING: [#def221]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘at’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:122:19: warning[-Wold-style-definition]: old-style function definition
#  122 | static char DEFUN(at,(buffer, pos),
#      |                   ^~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  120|   }
#  121|   
#  122|-> static char DEFUN(at,(buffer, pos),
#  123|   	   string_type *buffer AND
#  124|   	   unsigned int pos) 

Error: COMPILER_WARNING: [#def222]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:133:13: warning[-Wold-style-definition]: old-style function definition
#  131|   }
#  132|   
#  133|-> static void DEFUN(catchar,(buffer, ch), 
#  134|   	   string_type *buffer AND
#  135|   	   char ch)

Error: COMPILER_WARNING: [#def223]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘catchar’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:133:19: warning[-Wold-style-definition]: old-style function definition
#  133 | static void DEFUN(catchar,(buffer, ch),
#      |                   ^~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  131|   }
#  132|   
#  133|-> static void DEFUN(catchar,(buffer, ch), 
#  134|   	   string_type *buffer AND
#  135|   	   char ch)

Error: COMPILER_WARNING: [#def224]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:147:13: warning[-Wold-style-definition]: old-style function definition
#  145|   
#  146|   
#  147|-> static void DEFUN(overwrite_string,(dst,   src),
#  148|   	   string_type *dst AND
#  149|   	   string_type *src)

Error: COMPILER_WARNING: [#def225]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘overwrite_string’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:147:19: warning[-Wold-style-definition]: old-style function definition
#  147 | static void DEFUN(overwrite_string,(dst,   src),
#      |                   ^~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  145|   
#  146|   
#  147|-> static void DEFUN(overwrite_string,(dst,   src),
#  148|   	   string_type *dst AND
#  149|   	   string_type *src)

Error: COMPILER_WARNING: [#def226]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:157:13: warning[-Wold-style-definition]: old-style function definition
#  155|   }
#  156|   
#  157|-> static void DEFUN(catstr,(dst, src),
#  158|   	   string_type *dst AND
#  159|   	   string_type *src)

Error: COMPILER_WARNING: [#def227]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘catstr’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:157:19: warning[-Wold-style-definition]: old-style function definition
#  157 | static void DEFUN(catstr,(dst, src),
#      |                   ^~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  155|   }
#  156|   
#  157|-> static void DEFUN(catstr,(dst, src),
#  158|   	   string_type *dst AND
#  159|   	   string_type *src)

Error: COMPILER_WARNING: [#def228]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:169:13: warning[-Wold-style-definition]: old-style function definition
#  167|   
#  168|   
#  169|-> static void DEFUN(cattext,(buffer, string),
#  170|   	   string_type *buffer AND
#  171|   	   char *string)

Error: COMPILER_WARNING: [#def229]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘cattext’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:169:19: warning[-Wold-style-definition]: old-style function definition
#  169 | static void DEFUN(cattext,(buffer, string),
#      |                   ^~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  167|   
#  168|   
#  169|-> static void DEFUN(cattext,(buffer, string),
#  170|   	   string_type *buffer AND
#  171|   	   char *string)

Error: COMPILER_WARNING: [#def230]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:181:13: warning[-Wold-style-definition]: old-style function definition
#  179|   }
#  180|   
#  181|-> static void DEFUN(catbuf,(buffer, buf, len),
#  182|   	   string_type *buffer AND
#  183|   	   char *buf AND

Error: COMPILER_WARNING: [#def231]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘catbuf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:181:19: warning[-Wold-style-definition]: old-style function definition
#  181 | static void DEFUN(catbuf,(buffer, buf, len),
#      |                   ^~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  179|   }
#  180|   
#  181|-> static void DEFUN(catbuf,(buffer, buf, len),
#  182|   	   string_type *buffer AND
#  183|   	   char *buf AND

Error: COMPILER_WARNING: [#def232]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:197:1: warning[-Wold-style-definition]: old-style function definition
#  195|   
#  196|   static unsigned int 
#  197|-> DEFUN(skip_white_and_stars,(src, idx),
#  198|         string_type *src AND
#  199|         unsigned int idx)

Error: COMPILER_WARNING: [#def233]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘skip_white_and_stars’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:197:7: warning[-Wold-style-definition]: old-style function definition
#  197 | DEFUN(skip_white_and_stars,(src, idx),
#      |       ^~~~~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  195|   
#  196|   static unsigned int 
#  197|-> DEFUN(skip_white_and_stars,(src, idx),
#  198|         string_type *src AND
#  199|         unsigned int idx)

Error: COMPILER_WARNING: [#def234]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:240:13: warning[-Wold-style-definition]: old-style function definition
#  238|   #define WORD(x) static void x()
#  239|   
#  240|-> static void DEFUN(exec,(word),
#  241|   		  dict_type *word)
#  242|   {

Error: COMPILER_WARNING: [#def235]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘exec’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:240:19: warning[-Wold-style-definition]: old-style function definition
#  240 | static void DEFUN(exec,(word),
#      |                   ^~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  238|   #define WORD(x) static void x()
#  239|   
#  240|-> static void DEFUN(exec,(word),
#  241|   		  dict_type *word)
#  242|   {

Error: COMPILER_WARNING (CWE-704): [#def236]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘push_number’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:271:12: warning[-Wpointer-to-int-cast]: cast from pointer to integer of different size
#  271 |     *isp = (int)(*pc);
#      |            ^
#  269|       isp++;
#  270|       pc++;
#  271|->     *isp = (int)(*pc);
#  272|       pc++;
#  273|       

Error: COMPILER_WARNING (CWE-704): [#def237]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:271:12: warning[-Wpointer-to-int-cast]: cast from pointer to integer of different size
#  269|       isp++;
#  270|       pc++;
#  271|->     *isp = (int)(*pc);
#  272|       pc++;
#  273|       

Error: COMPILER_WARNING: [#def238]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:299:1: warning[-Wold-style-definition]: old-style function definition
#  297|   
#  298|   static void 
#  299|-> DEFUN(remove_noncomments,(src,dst),
#  300|   	   string_type *src AND
#  301|   	   string_type *dst)

Error: COMPILER_WARNING: [#def239]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘remove_noncomments’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:299:7: warning[-Wold-style-definition]: old-style function definition
#  299 | DEFUN(remove_noncomments,(src,dst),
#      |       ^~~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  297|   
#  298|   static void 
#  299|-> DEFUN(remove_noncomments,(src,dst),
#  300|   	   string_type *src AND
#  301|   	   string_type *dst)

Error: COMPILER_WARNING: [#def240]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:777:1: warning[-Wold-style-definition]: old-style function definition
#  775|   /* A command is all upper case,and alone on a line */
#  776|   static int 
#  777|-> DEFUN( iscommand,(ptr, idx),
#  778|         string_type *ptr AND
#  779|         unsigned int idx)

Error: COMPILER_WARNING: [#def241]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘iscommand’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:777:8: warning[-Wold-style-definition]: old-style function definition
#  777 | DEFUN( iscommand,(ptr, idx),
#      |        ^~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  775|   /* A command is all upper case,and alone on a line */
#  776|   static int 
#  777|-> DEFUN( iscommand,(ptr, idx),
#  778|         string_type *ptr AND
#  779|         unsigned int idx)

Error: COMPILER_WARNING: [#def242]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:802:1: warning[-Wold-style-definition]: old-style function definition
#  800|   
#  801|   static unsigned int
#  802|-> DEFUN(copy_past_newline,(ptr, idx, dst),
#  803|         string_type *ptr AND
#  804|         unsigned int idx AND

Error: COMPILER_WARNING: [#def243]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘copy_past_newline’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:802:7: warning[-Wold-style-definition]: old-style function definition
#  802 | DEFUN(copy_past_newline,(ptr, idx, dst),
#      |       ^~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
#  800|   
#  801|   static unsigned int
#  802|-> DEFUN(copy_past_newline,(ptr, idx, dst),
#  803|         string_type *ptr AND
#  804|         unsigned int idx AND

Error: COMPILER_WARNING: [#def244]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1066:1: warning[-Wold-style-definition]: old-style function definition
# 1064|   
# 1065|   char *
# 1066|-> DEFUN(nextword,(string, word),
# 1067|         char *string AND
# 1068|         char **word)

Error: COMPILER_WARNING: [#def245]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘nextword’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1066:7: warning[-Wold-style-definition]: old-style function definition
# 1066 | DEFUN(nextword,(string, word),
#      |       ^~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1064|   
# 1065|   char *
# 1066|-> DEFUN(nextword,(string, word),
# 1067|         char *string AND
# 1068|         char **word)

Error: COMPILER_WARNING: [#def246]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1144:1: warning[-Wold-style-definition]: old-style function definition
# 1142|   dict_type *root;
# 1143|   dict_type *
# 1144|-> DEFUN(lookup_word,(word),
# 1145|         char *word)
# 1146|   {

Error: COMPILER_WARNING: [#def247]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘lookup_word’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1144:7: warning[-Wold-style-definition]: old-style function definition
# 1144 | DEFUN(lookup_word,(word),
#      |       ^~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1142|   dict_type *root;
# 1143|   dict_type *
# 1144|-> DEFUN(lookup_word,(word),
# 1145|         char *word)
# 1146|   {

Error: COMPILER_WARNING: [#def248]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1198:1: warning[-Wold-style-definition]: old-style function definition
# 1196|   
# 1197|   dict_type *
# 1198|-> DEFUN(newentry,(word),
# 1199|         char *word)
# 1200|   {

Error: COMPILER_WARNING: [#def249]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘newentry’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1198:7: warning[-Wold-style-definition]: old-style function definition
# 1198 | DEFUN(newentry,(word),
#      |       ^~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1196|   
# 1197|   dict_type *
# 1198|-> DEFUN(newentry,(word),
# 1199|         char *word)
# 1200|   {

Error: CPPCHECK_WARNING (CWE-476): [#def250]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1202: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new
# 1200|   {
# 1201|       dict_type *new = (dict_type *)malloc(sizeof(dict_type));
# 1202|->     new->word = word;
# 1203|       new->next = root;
# 1204|       root = new;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def251]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1202:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1389:5: enter_function: entry to ‘main’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1406:5: call_function: calling ‘add_intrinsic’ from ‘main’
# 1200|   {
# 1201|       dict_type *new = (dict_type *)malloc(sizeof(dict_type));
# 1202|->     new->word = word;
# 1203|       new->next = root;
# 1204|       root = new;

Error: CPPCHECK_WARNING (CWE-476): [#def252]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1203: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new
# 1201|       dict_type *new = (dict_type *)malloc(sizeof(dict_type));
# 1202|       new->word = word;
# 1203|->     new->next = root;
# 1204|       root = new;
# 1205|       new->code = (stinst_type *)malloc(sizeof(stinst_type ));

Error: CPPCHECK_WARNING (CWE-476): [#def253]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1205: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new
# 1203|       new->next = root;
# 1204|       root = new;
# 1205|->     new->code = (stinst_type *)malloc(sizeof(stinst_type ));
# 1206|       new->code_length = 1;
# 1207|       new->code_end = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def254]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1206: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new
# 1204|       root = new;
# 1205|       new->code = (stinst_type *)malloc(sizeof(stinst_type ));
# 1206|->     new->code_length = 1;
# 1207|       new->code_end = 0;
# 1208|       return new;

Error: CPPCHECK_WARNING (CWE-476): [#def255]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1207: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new
# 1205|       new->code = (stinst_type *)malloc(sizeof(stinst_type ));
# 1206|       new->code_length = 1;
# 1207|->     new->code_end = 0;
# 1208|       return new;
# 1209|       

Error: COMPILER_WARNING: [#def256]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1214:1: warning[-Wold-style-definition]: old-style function definition
# 1212|   
# 1213|   unsigned int
# 1214|-> DEFUN(add_to_definition,(entry, word), 
# 1215|         dict_type *entry AND
# 1216|         stinst_type word)

Error: COMPILER_WARNING: [#def257]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘add_to_definition’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1214:7: warning[-Wold-style-definition]: old-style function definition
# 1214 | DEFUN(add_to_definition,(entry, word),
#      |       ^~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1212|   
# 1213|   unsigned int
# 1214|-> DEFUN(add_to_definition,(entry, word), 
# 1215|         dict_type *entry AND
# 1216|         stinst_type word)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def258]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1221:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1389:5: enter_function: entry to ‘main’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1406:5: call_function: calling ‘add_intrinsic’ from ‘main’
# 1219|       {
# 1220|   	entry->code_length += 2;
# 1221|-> 	entry->code =
# 1222|   	 (stinst_type *) realloc((char *)(entry->code),
# 1223|   			       entry->code_length *sizeof(word_type));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def259]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1225:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*entry.code + (long unsigned int)*entry.code_end * 8’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1389:5: enter_function: entry to ‘main’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1406:5: call_function: calling ‘add_intrinsic’ from ‘main’
# 1223|   			       entry->code_length *sizeof(word_type));
# 1224|       }
# 1225|->     entry->code[entry->code_end] = word;
# 1226|       
# 1227|   return     entry->code_end++;  

Error: COMPILER_WARNING: [#def260]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1237:1: warning[-Wold-style-definition]: old-style function definition
# 1235|   
# 1236|   void
# 1237|-> DEFUN(add_intrinsic,(name, func),
# 1238|         char *name AND
# 1239|         void (*func)())

Error: COMPILER_WARNING: [#def261]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘add_intrinsic’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1237:7: warning[-Wold-style-definition]: old-style function definition
# 1237 | DEFUN(add_intrinsic,(name, func),
#      |       ^~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1235|   
# 1236|   void
# 1237|-> DEFUN(add_intrinsic,(name, func),
# 1238|         char *name AND
# 1239|         void (*func)())

Error: COMPILER_WARNING: [#def262]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1253:1: warning[-Wold-style-definition]: old-style function definition
# 1251|   
# 1252|   void
# 1253|-> DEFUN(add_var,(name),
# 1254|         char *name)
# 1255|   {

Error: COMPILER_WARNING: [#def263]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘add_var’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1253:7: warning[-Wold-style-definition]: old-style function definition
# 1253 | DEFUN(add_var,(name),
#      |       ^~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1251|   
# 1252|   void
# 1253|-> DEFUN(add_var,(name),
# 1254|         char *name)
# 1255|   {

Error: COMPILER_WARNING: [#def264]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1267:1: warning[-Wold-style-definition]: old-style function definition
# 1265|   
# 1266|   void 
# 1267|-> DEFUN(compile, (string), 
# 1268|         char *string)
# 1269|   

Error: COMPILER_WARNING: [#def265]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘compile’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1267:7: warning[-Wold-style-definition]: old-style function definition
# 1267 | DEFUN(compile, (string),
#      |       ^~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1265|   
# 1266|   void 
# 1267|-> DEFUN(compile, (string), 
# 1268|         char *string)
# 1269|   

Error: COMPILER_WARNING (CWE-704): [#def266]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘bang’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1343:2: warning[-Wint-to-pointer-cast]: cast to pointer from integer of different size
# 1343 | *(int *)((isp[0])) = isp[-1];
#      |  ^
# 1341|   static void DEFUN_VOID(bang)
# 1342|   {
# 1343|-> *(int *)((isp[0])) = isp[-1];
# 1344|   isp-=2;
# 1345|   pc++;

Error: COMPILER_WARNING (CWE-704): [#def267]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1343:2: warning[-Wint-to-pointer-cast]: cast to pointer from integer of different size
# 1341|   static void DEFUN_VOID(bang)
# 1342|   {
# 1343|-> *(int *)((isp[0])) = isp[-1];
# 1344|   isp-=2;
# 1345|   pc++;

Error: COMPILER_WARNING (CWE-704): [#def268]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘atsign’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1351:15: warning[-Wint-to-pointer-cast]: cast to pointer from integer of different size
# 1351 |     isp[0] = *(int *)(isp[0]);
#      |               ^
# 1349|   WORD(atsign)
# 1350|   {
# 1351|->     isp[0] = *(int *)(isp[0]);
# 1352|       pc++;
# 1353|   }

Error: COMPILER_WARNING (CWE-704): [#def269]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1351:15: warning[-Wint-to-pointer-cast]: cast to pointer from integer of different size
# 1349|   WORD(atsign)
# 1350|   {
# 1351|->     isp[0] = *(int *)(isp[0]);
# 1352|       pc++;
# 1353|   }

Error: COMPILER_WARNING: [#def270]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1364:13: warning[-Wold-style-definition]: old-style function definition
# 1362|   
# 1363|   
# 1364|-> static void DEFUN(read_in, (str, file), 
# 1365|   	   string_type *str AND
# 1366|   		  FILE *file)

Error: COMPILER_WARNING: [#def271]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘read_in’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1364:19: warning[-Wold-style-definition]: old-style function definition
# 1364 | static void DEFUN(read_in, (str, file),
#      |                   ^~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1362|   
# 1363|   
# 1364|-> static void DEFUN(read_in, (str, file), 
# 1365|   	   string_type *str AND
# 1366|   		  FILE *file)

Error: COMPILER_WARNING: [#def272]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1389:5: warning[-Wold-style-definition]: old-style function definition
# 1387|   }
# 1388|   
# 1389|-> int DEFUN(main,(ac,av),
# 1390|   int ac AND
# 1391|   char *av[])

Error: COMPILER_WARNING: [#def273]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c: scope_hint: In function ‘main’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/makedoc.c:1389:11: warning[-Wold-style-definition]: old-style function definition
# 1389 | int DEFUN(main,(ac,av),
#      |           ^~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/doc/ansidecl.h:110:41: note: in definition of macro ‘DEFUN’
#  110 | #define DEFUN(name, arglist, args)      name arglist args;
#      |                                         ^~~~
# 1387|   }
# 1388|   
# 1389|-> int DEFUN(main,(ac,av),
# 1390|   int ac AND
# 1391|   char *av[])

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_create_sep.c:68:1: warning[-Wanalyzer-malloc-leak]: leak of ‘running’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_create_sep.c:30:6: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_create_sep.c:39:13: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_create_sep.c:49:5: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_create_sep.c:68:1: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_create_sep.c:68:1: danger: ‘running’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   66|     free(old_running);
#   67|     return 0;
#   68|-> }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def275]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:88:1: warning[-Wanalyzer-malloc-leak]: leak of ‘new_argz_iter’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:46:6: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:48:26: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:48:26: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:73:9: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:88:1: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:88:1: danger: ‘new_argz_iter’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   86|   
#   87|     return 0;
#   88|-> }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:88:1: warning[-Wanalyzer-malloc-leak]: leak of ‘new_argz’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:46:6: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:48:26: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:48:26: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:55:13: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:57:15: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:73:9: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:88:1: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/argz_replace.c:88:1: danger: ‘new_argz’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   86|   
#   87|     return 0;
#   88|-> }

Error: CPPCHECK_WARNING (CWE-476): [#def277]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:33: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: name_str
#   31|           {
#   32|             name_str = strdup (entry);
#   33|->           name_iter = strchr(name_str, '=');
#   34|             if(name_iter)
#   35|               *name_iter = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:45:22: warning[-Wanalyzer-malloc-leak]: leak of ‘name_str’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:28:9: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:45:22: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:47:13: branch_false: following ‘false’ branch (when ‘name_iter’ is NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:57:20: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:28:9: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:30:10: branch_false: following ‘false’ branch (when ‘override != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:45:22: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:45:22: danger: ‘name_str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   43|         else
#   44|           {
#   45|->           name_str = strdup (entry);
#   46|             name_iter = strchr(name_str, '=');
#   47|             if(name_iter)

Error: CPPCHECK_WARNING (CWE-476): [#def279]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:46: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: name_str
#   44|           {
#   45|             name_str = strdup (entry);
#   46|->           name_iter = strchr(name_str, '=');
#   47|             if(name_iter)
#   48|               {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:60:10: warning[-Wanalyzer-malloc-leak]: leak of ‘name_str’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:28:9: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:45:22: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:47:13: branch_false: following ‘false’ branch (when ‘name_iter’ is NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:57:20: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/argz/envz_merge.c:60:10: danger: ‘name_str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   58|           }
#   59|       }
#   60|->   return retval;
#   61|   }

Error: COMPILER_WARNING: [#def281]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/errno/errno.c:11:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   11 | __errno ()
#      | ^~~~~~~
#    9|   
#   10|   int *
#   11|-> __errno ()
#   12|   {
#   13|     return &_REENT->_errno;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def282]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:160:15: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:69:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:72:14: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:72:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:90:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:93:9: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:98:14: acquire_resource: opened here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:104:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:104:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:107:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:107:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:109:30: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:124:12: branch_false: following ‘false’ branch (when ‘lbuf’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:126:16: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:129:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:131:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:131:13: release_resource: first ‘close’ here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:160:15: danger: second ‘close’ here; first ‘close’ was at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  158|   	free(lbuf);
#  159|   bad_locale:
#  160|-> 	(void)close(fd);
#  161|   no_locale:
#  162|   	*using_locale = save_using_locale;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def283]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:173:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:171:21: branch_true: following ‘true’ branch (when ‘p < plim’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:172:21: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:173:17: danger: dereference of NULL ‘p’
#  171|   	for (i = 0; p < plim; i++) {
#  172|   		p = strchr(p, '\n');
#  173|-> 		*p++ = '\0';
#  174|   	}
#  175|   	return i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:186:1: warning[-Wanalyzer-malloc-leak]: leak of ‘lbuf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:44:1: enter_function: entry to ‘__part_load_locale’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:69:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:72:14: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:72:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:79:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:88:20: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:90:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:93:9: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:104:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:104:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:107:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:107:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:109:30: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:112:13: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:114:20: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:114:20: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:124:12: branch_false: following ‘false’ branch (when ‘lbuf’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:126:16: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:129:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:131:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:131:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:136:13: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:136:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:138:21: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:138:21: call_function: calling ‘split_lines’ from ‘__part_load_locale’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:138:21: return_function: returning to ‘__part_load_locale’ from ‘split_lines’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:141:17: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:142:17: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:145:9: call_function: calling ‘set_from_buf’ from ‘__part_load_locale’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:145:9: return_function: returning to ‘__part_load_locale’ from ‘set_from_buf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/locale/ldpart.c:186:1: danger: ‘lbuf’ leaks here; was allocated at [(18)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/17)
#  184|   	for (ap = dst_localebuf, i = 0; i < num_lines; ++ap, ++i)
#  185|   		*ap = p += strlen(p) + 1;
#  186|-> }
#  187|   

Error: COMPILER_WARNING: [#def285]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:22:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   22 | static long get_number ();
#      | ^~~~~~
#   20|   #endif
#   21|   
#   22|-> static long get_number ();
#   23|   static void print_number ();
#   24|   static void write_char ();

Error: COMPILER_WARNING: [#def286]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:23:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   23 | static void print_number ();
#      | ^~~~~~
#   21|   
#   22|   static long get_number ();
#   23|-> static void print_number ();
#   24|   static void write_char ();
#   25|   static void write_string ();

Error: COMPILER_WARNING: [#def287]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:24:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   24 | static void write_char ();
#      | ^~~~~~
#   22|   static long get_number ();
#   23|   static void print_number ();
#   24|-> static void write_char ();
#   25|   static void write_string ();
#   26|   

Error: COMPILER_WARNING: [#def288]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:25:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   25 | static void write_string ();
#      | ^~~~~~
#   23|   static void print_number ();
#   24|   static void write_char ();
#   25|-> static void write_string ();
#   26|   
#   27|   /* Non-zero for big-endian systems.  */

Error: COMPILER_WARNING: [#def289]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:179:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  179 | get_number (s, size, unsigned_p)
#      | ^~~~~~~~~~
#  177|   
#  178|   static long
#  179|-> get_number (s, size, unsigned_p)
#  180|        char *s;
#  181|        long size;

Error: COMPILER_WARNING: [#def290]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:222:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  222 | print_number (base, unsigned_p, n)
#      | ^~~~~~~~~~~~
#  220|   
#  221|   static void
#  222|-> print_number (base, unsigned_p, n)
#  223|        int base;
#  224|        int unsigned_p;

Error: COMPILER_WARNING: [#def291]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:256:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  256 | write_char (c)
#      | ^~~~~~~~~~
#  254|   
#  255|   static void
#  256|-> write_char (c)
#  257|        char c;
#  258|   {

Error: COMPILER_WARNING: [#def292]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/__dprintf.c:267:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  267 | write_string (s)
#      | ^~~~~~~~~~~~
#  265|   
#  266|   static void
#  267|-> write_string (s)
#  268|        char *s;
#  269|   {

Error: CPPCHECK_WARNING (CWE-758): [#def293]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/init.c:36: error[subtractPointers]: Subtracting pointers that point to different objects
#   34|     size_t i;
#   35|   
#   36|->   count = __preinit_array_end - __preinit_array_start;
#   37|     for (i = 0; i < count; i++)
#   38|       __preinit_array_start[i] ();

Error: GCC_ANALYZER_WARNING (CWE-469): [#def294]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/init.c:36:31: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#   34|     size_t i;
#   35|   
#   36|->   count = __preinit_array_end - __preinit_array_start;
#   37|     for (i = 0; i < count; i++)
#   38|       __preinit_array_start[i] ();

Error: CPPCHECK_WARNING (CWE-758): [#def295]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/init.c:42: error[subtractPointers]: Subtracting pointers that point to different objects
#   40|     _init ();
#   41|   
#   42|->   count = __init_array_end - __init_array_start;
#   43|     for (i = 0; i < count; i++)
#   44|       __init_array_start[i] ();

Error: GCC_ANALYZER_WARNING (CWE-469): [#def296]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/init.c:42:28: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#   40|     _init ();
#   41|   
#   42|->   count = __init_array_end - __init_array_start;
#   43|     for (i = 0; i < count; i++)
#   44|       __init_array_start[i] ();

Error: CPPCHECK_WARNING (CWE-758): [#def297]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/init.c:54: error[subtractPointers]: Subtracting pointers that point to different objects
#   52|     size_t i;
#   53|     
#   54|->   count = __fini_array_end - __fini_array_start;
#   55|     for (i = 0; i < count; i++)
#   56|       __fini_array_start[i] ();

Error: GCC_ANALYZER_WARNING (CWE-469): [#def298]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/misc/init.c:54:28: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#   52|     size_t i;
#   53|     
#   54|->   count = __fini_array_end - __fini_array_start;
#   55|     for (i = 0; i < count; i++)
#   56|       __fini_array_start[i] ();

Error: COMPILER_WARNING: [#def299]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:106:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  106 | __hash_open(file, flags, mode, info, dflags)
#      | ^~~~~~~~~~~
#  104|   
#  105|   extern DB *
#  106|-> __hash_open(file, flags, mode, info, dflags)
#  107|   	const char *file;
#  108|   	int flags, mode, dflags;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def300]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:814:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bp’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:781:25: branch_true: following ‘true’ branch (when ‘bp’ is NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:782:22: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:782:20: branch_true: following ‘true’ branch (when ‘bufp’ is NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:783:39: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:784:29: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:794:25: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:795:28: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:795:28: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:806:24: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:814:22: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:814:22: danger: dereference of NULL ‘bp’
#  812|   			hashp->cndx = 1;
#  813|   		}
#  814|-> 		if (!bp[0]) {
#  815|   			hashp->cpage = NULL;
#  816|   			++hashp->cbucket;

Error: GCC_ANALYZER_WARNING (CWE-131): [#def301]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:912:17: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:908:12: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:909:17: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:912:17: danger: assigned to ‘BUFHEAD ***’ {{aka ‘struct _bufhead ***’}} here; ‘sizeof (SEGMENT {{aka struct _bufhead **}})’ is ‘8’
#  910|   		memset((char *)p + oldsize, 0, newsize - oldsize);
#  911|   		free(*p_ptr);
#  912|-> 		*p_ptr = p;
#  913|   	}
#  914|   	return (p);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:965:1: warning[-Wanalyzer-malloc-leak]: leak of ‘store’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:947:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:956:38: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:956:22: acquire_memory: allocated here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:955:12: branch_false: following ‘false’ branch (when ‘store’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:955:12: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:962:21: branch_false: following ‘false’ branch (when ‘i >= nsegs’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:962:21: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.c:965:1: danger: ‘store’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  963|   		hashp->dir[i] = &store[i << hashp->SSHIFT];
#  964|   	return (0);
#  965|-> }
#  966|   
#  967|   #if (BYTE_ORDER == LITTLE_ENDIAN)

Error: COMPILER_WARNING (CWE-457): [#def303]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash.h:171:29: warning[-Wmaybe-uninitialized]: ‘freep’ may be used uninitialized
#  171 | #define SETBIT(A, N)    ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
#      |                          ~~~^~~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:769:17: note: in expansion of macro ‘SETBIT’
#  769 |                 SETBIT(freep, free_bit);
#      |                 ^~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c: scope_hint: In function ‘__add_ovflpage’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:670:21: note: ‘freep’ was declared here
#  670 |         __uint32_t *freep;
#      |                     ^~~~~
#  169|   /* Given the address of the beginning of a big map, clear/set the nth bit */
#  170|   #define CLRBIT(A, N)	((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
#  171|-> #define SETBIT(A, N)	((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
#  172|   #define ISSET(A, N)	((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
#  173|   

Error: COMPILER_WARNING (CWE-691): [#def304]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_bigkey.c: scope_hint: In function ‘__big_insert’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_bigkey.c:126:20: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  126 |                 if (!key_size)
#      |                    ^
#  124|   			return (-1);
#  125|   		n = p[0];
#  126|-> 		if (!key_size)
#  127|   			if (FREESPACE(p)) {
#  128|   				move_bytes = MIN(FREESPACE(p), val_size);

Error: COMPILER_WARNING (CWE-457): [#def305]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_buf.c: scope_hint: In function ‘__get_buf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_buf.c:153:29: warning[-Wmaybe-uninitialized]: ‘segment_ndx’ may be used uninitialized
#  153 |                         segp[segment_ndx] =
#      |                             ^
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_buf.c:122:22: note: ‘segment_ndx’ was declared here
#  122 |         int is_disk, segment_ndx;
#      |                      ^~~~~~~~~~~
#  151|   			return (NULL);
#  152|   		if (!prev_bp)
#  153|-> 			segp[segment_ndx] =
#  154|   			    (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
#  155|   	} else {

Error: COMPILER_WARNING (CWE-457): [#def306]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_buf.c:153:29: warning[-Wmaybe-uninitialized]: ‘segp’ may be used uninitialized
#  153 |                         segp[segment_ndx] =
#      |                             ^
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_buf.c:123:17: note: ‘segp’ was declared here
#  123 |         SEGMENT segp;
#      |                 ^~~~
#  151|   			return (NULL);
#  152|   		if (!prev_bp)
#  153|-> 			segp[segment_ndx] =
#  154|   			    (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
#  155|   	} else {

Error: COMPILER_WARNING (CWE-1164): [#def307]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_func.c:69:1: warning[-Wunused-function]: ‘hash1’ defined but not used
#   69 | hash1(keyarg, len)
#      | ^~~~~
#   67|   
#   68|   static __uint32_t
#   69|-> hash1(keyarg, len)
#   70|   	const void *keyarg;
#   71|   	size_t len;

Error: COMPILER_WARNING (CWE-1164): [#def308]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_func.c:89:1: warning[-Wunused-function]: ‘hash2’ defined but not used
#   89 | hash2(keyarg, len)
#      | ^~~~~
#   87|   
#   88|   static __uint32_t
#   89|-> hash2(keyarg, len)
#   90|   	const void *keyarg;
#   91|   	size_t len;

Error: COMPILER_WARNING (CWE-1164): [#def309]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_func.c:118:1: warning[-Wunused-function]: ‘hash3’ defined but not used
#  118 | hash3(keyarg, len)
#      | ^~~~~
#  116|    */
#  117|   static __uint32_t
#  118|-> hash3(keyarg, len)
#  119|   	const void *keyarg;
#  120|   	size_t len;

Error: COMPILER_WARNING: [#def310]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_log2.c:47:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   47 | __log2(num)
#      | ^~~~~~
#   45|   
#   46|   __uint32_t
#   47|-> __log2(num)
#   48|   	__uint32_t num;
#   49|   {

Error: GCC_ANALYZER_WARNING (CWE-131): [#def311]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:636:33: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#  634|   	int clearbytes, clearints;
#  635|   
#  636|-> 	if ((ip = (__uint32_t *)malloc(hashp->BSIZE)) == NULL)
#  637|   		return (1);
#  638|   	hashp->nmaps++;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def312]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:769:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘freep’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:685:31: branch_false: following ‘false’ branch (when ‘i > free_page’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:709:29: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:727:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:768:17: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:769:17: danger: use of uninitialized value ‘freep’ here
#  767|   		 */
#  768|   		free_bit++;
#  769|-> 		SETBIT(freep, free_bit);
#  770|   	}
#  771|   

Error: GCC_ANALYZER_WARNING (CWE-131): [#def313]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:918:13: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:916:12: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:918:54: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hash_page.c:918:13: danger: assigned to ‘__uint32_t *’ {{aka ‘unsigned int *’}} here; ‘sizeof (__uint32_t {{aka unsigned int}})’ is ‘4’
#  916|   	if (ndx >= hashp->nmaps)
#  917|   		return (NULL);
#  918|-> 	if ((hashp->mapp[ndx] = (__uint32_t *)malloc(hashp->BSIZE)) == NULL)
#  919|   		return (NULL);
#  920|   	if (__get_page(hashp,

Error: COMPILER_WARNING (CWE-563): [#def314]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hcreate_r.c:126:32: warning[-Wunused-variable]: unused variable ‘ie’
#  126 |         struct internal_entry *ie;
#      |                                ^~
#  124|   hdestroy_r(struct hsearch_data *htab)
#  125|   {
#  126|-> 	struct internal_entry *ie;
#  127|   	size_t idx;
#  128|   

Error: COMPILER_WARNING (CWE-563): [#def315]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hcreate_r.c: scope_hint: In function ‘hdestroy_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/hcreate_r.c:127:16: warning[-Wunused-variable]: unused variable ‘idx’
#  127 |         size_t idx;
#      |                ^~~
#  125|   {
#  126|   	struct internal_entry *ie;
#  127|-> 	size_t idx;
#  128|   
#  129|   	if (htab->htable == NULL)

Error: COMPILER_WARNING: [#def316]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/qsort.c:84:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   84 | static inline char      *med3 _PARAMS((char *, char *, char *, int (*)()));
#      | ^~~~~~
#   82|   #endif
#   83|   
#   84|-> static inline char	*med3 _PARAMS((char *, char *, char *, int (*)()));
#   85|   static inline void	 swapfunc _PARAMS((char *, char *, int, int));
#   86|   

Error: COMPILER_WARNING: [#def317]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/qsort.c:130:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  130 | _DEFUN(med3, (a, b, c, cmp),
#      | ^~~~~~
#  128|   
#  129|   static inline char *
#  130|-> _DEFUN(med3, (a, b, c, cmp),
#  131|   	char *a _AND
#  132|   	char *b _AND

Error: COMPILER_WARNING: [#def318]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/qsort.c:142:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  142 | _DEFUN(qsort, (a, n, es, cmp),
#      | ^~~~~~
#  140|   
#  141|   void
#  142|-> _DEFUN(qsort, (a, n, es, cmp),
#  143|   	void *a _AND
#  144|   	size_t n _AND

Error: COMPILER_WARNING: [#def319]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/search/tdestroy.c:29:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   29 | trecurse(root, free_action)
#      | ^~~~~~~~
#   27|   /* Walk the nodes of a tree */
#   28|   static void
#   29|-> trecurse(root, free_action)
#   30|   	node_t *root;	/* Root of the tree to be walked */
#   31|   	void (*free_action)(void *);

Error: COMPILER_WARNING (CWE-681): [#def320]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asiprintf.c: scope_hint: In function ‘_asiprintf_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asiprintf.c:48:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   48 |       *strp = f._bf._base;
#      |             ^
#   46|       {
#   47|         *f._p = 0;
#   48|->       *strp = f._bf._base;
#   49|       }
#   50|     return (ret);

Error: COMPILER_WARNING (CWE-681): [#def321]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asiprintf.c: scope_hint: In function ‘asiprintf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asiprintf.c:75:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   75 |       *strp = f._bf._base;
#      |             ^
#   73|       {
#   74|         *f._p = 0;
#   75|->       *strp = f._bf._base;
#   76|       }
#   77|     return (ret);

Error: COMPILER_WARNING (CWE-681): [#def322]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asprintf.c: scope_hint: In function ‘_asprintf_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asprintf.c:48:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   48 |       *strp = f._bf._base;
#      |             ^
#   46|       {
#   47|         *f._p = 0;
#   48|->       *strp = f._bf._base;
#   49|       }
#   50|     return (ret);

Error: COMPILER_WARNING (CWE-681): [#def323]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asprintf.c: scope_hint: In function ‘asprintf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/asprintf.c:75:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   75 |       *strp = f._bf._base;
#      |             ^
#   73|       {
#   74|         *f._p = 0;
#   75|->       *strp = f._bf._base;
#   76|       }
#   77|     return (ret);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def324]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:313:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:282:6: branch_false: following ‘false’ branch (when ‘flags != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:284:6: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:284:6: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:289:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:291:27: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:291:6: branch_false: following ‘false’ branch (when ‘c’ is non-NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:303:3: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:309:6: branch_true: following ‘true’ branch (when ‘buf’ is NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:312:25: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fmemopen.c:313:7: danger: dereference of NULL ‘0’
#  311|         /* r+/w+/a+, and no buf: file starts empty.  */
#  312|         c->buf = (char *) (c + 1);
#  313|->       *(char *) buf = '\0';
#  314|         c->pos = c->eof = 0;
#  315|         c->append = (flags & __SAPP) != 0;

Error: COMPILER_WARNING (CWE-681): [#def325]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fread.c: scope_hint: In function ‘_fread_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fread.c:182:25: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness
#  182 |           fp->_bf._base = p;
#      |                         ^
#  180|   	  int old_size = fp->_bf._size;
#  181|   	  /* allow __refill to use user's buffer */
#  182|-> 	  fp->_bf._base = p;
#  183|   	  fp->_bf._size = resid;
#  184|   	  fp->_p = p;

Error: COMPILER_WARNING (CWE-681): [#def326]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/fread.c:184:18: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness
#  184 |           fp->_p = p;
#      |                  ^
#  182|   	  fp->_bf._base = p;
#  183|   	  fp->_bf._size = resid;
#  184|-> 	  fp->_p = p;
#  185|   	  rc = __srefill_r (ptr, fp);
#  186|   	  /* restore fp buffering back to original state */

Error: COMPILER_WARNING (CWE-563): [#def327]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/open_memstream.c: scope_hint: In function ‘_open_memstream_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/open_memstream.c:257:7: warning[-Wunused-variable]: unused variable ‘flags’
#  257 |   int flags;
#      |       ^~~~~
#  255|     FILE *fp;
#  256|     memstream *c;
#  257|->   int flags;
#  258|   
#  259|     if (!buf || !size)

Error: COMPILER_WARNING (CWE-681): [#def328]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vasiprintf.c: scope_hint: In function ‘_vasiprintf_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vasiprintf.c:60:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   60 |       *strp = f._bf._base;
#      |             ^
#   58|       {
#   59|         *f._p = 0;
#   60|->       *strp = f._bf._base;
#   61|       }
#   62|     return ret;

Error: COMPILER_WARNING (CWE-681): [#def329]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vasprintf.c: scope_hint: In function ‘_vasprintf_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vasprintf.c:60:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   60 |       *strp = f._bf._base;
#      |             ^
#   58|       {
#   59|         *f._p = 0;
#   60|->       *strp = f._bf._base;
#   61|       }
#   62|     return ret;

Error: COMPILER_WARNING: [#def330]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c:229:12: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  229 | /*static*/ u_char *__sccl ();
#      |            ^~~~~~
#  227|   #endif
#  228|   
#  229|-> /*static*/ u_char *__sccl ();
#  230|   
#  231|   /*

Error: COMPILER_WARNING: [#def331]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c: scope_hint: In function ‘__svfscanf_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c:302:3: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  302 |   u_long (*ccfn) () = 0;        /* conversion function (strtol/strtoul) */
#      |   ^~~~~~
#  300|     mbstate_t state;              /* value to keep track of multibyte state */
#  301|   
#  302|->   u_long (*ccfn) () = 0;	/* conversion function (strtol/strtoul) */
#  303|     char ccltab[256];		/* character class table for %[...] */
#  304|     char buf[BUF];		/* buffer for numeric conversions */

Error: COMPILER_WARNING: [#def332]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c:506:11: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  506 |           ccfn = (u_long (*)())_strtol_r;
#      |           ^~~~
#  504|   	case 'd':
#  505|   	  c = CT_INT;
#  506|-> 	  ccfn = (u_long (*)())_strtol_r;
#  507|   	  base = 10;
#  508|   	  break;

Error: COMPILER_WARNING: [#def333]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c:512:11: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  512 |           ccfn = (u_long (*)())_strtol_r;
#      |           ^~~~
#  510|   	case 'i':
#  511|   	  c = CT_INT;
#  512|-> 	  ccfn = (u_long (*)())_strtol_r;
#  513|   	  base = 0;
#  514|   	  break;

Error: COMPILER_WARNING: [#def334]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c:634:11: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  634 |           ccfn = (u_long (*)())_strtol_r;
#      |           ^~~~
#  632|   	    flags |= LONG;
#  633|   	  c = CT_INT;
#  634|-> 	  ccfn = (u_long (*)())_strtol_r;
#  635|   	  base = 10;
#  636|   	  break;

Error: CPPCHECK_WARNING (CWE-476): [#def335]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdio/vfscanf.c:1403: error[nullPointer]: Null pointer dereference
# 1401|   		  flp = GET_ARG (N, ap, float *);
# 1402|   		  if (isnan (res))
# 1403|-> 		    *flp = nanf (NULL);
# 1404|   		  else
# 1405|   		    *flp = res;

Error: COMPILER_WARNING (CWE-681): [#def336]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/btowc.c: scope_hint: In function ‘btowc’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/btowc.c:22:37: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘_mbtowc_r’ differ in signedness
#   22 |   retval = _mbtowc_r (_REENT, &pwc, &b, 1, &mbs);
#      |                                     ^~
#      |                                     |
#      |                                     unsigned char *
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/include/wchar.h:4: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/btowc.c:1: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/include/stdlib.h:91:9: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
#   91 | int     _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *));
#      |         ^~~~~~
#   20|     _REENT_CHECK_MISC(_REENT);
#   21|   
#   22|->   retval = _mbtowc_r (_REENT, &pwc, &b, 1, &mbs);
#   23|   
#   24|     if (c == EOF || retval != 1)

Error: COMPILER_WARNING: [#def337]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/getenv.c: scope_hint: In function ‘getenv’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/getenv.c:89:3: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   89 |   char *_findenv_r ();
#      |   ^~~~
#   87|   {
#   88|     int offset;
#   89|->   char *_findenv_r ();
#   90|   
#   91|     return _findenv_r (_REENT, name, &offset);

Error: COMPILER_WARNING: [#def338]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/getenv_r.c: scope_hint: In function ‘_getenv_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/getenv_r.c:133:3: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  133 |   char *_findenv_r ();
#      |   ^~~~
#  131|   {
#  132|     int offset;
#  133|->   char *_findenv_r ();
#  134|   
#  135|     return _findenv_r (reent_ptr, name, &offset);

Error: COMPILER_WARNING: [#def339]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:722:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  722 | eiisinf (x)
#      | ^~~~~~~
#  720|   /* Return nonzero if internal format number is infinite. */
#  721|   static int 
#  722|-> eiisinf (x)
#  723|        unsigned short x[];
#  724|   {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def340]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3280:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sp’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3263:4: branch_false: following ‘false’ branch (when ‘c > 200’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3267:21: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3267:21: acquire_memory: this call could return NULL
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3278:11: branch_true: following ‘true’ branch (when ‘k < c’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3280:23: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/ldtoa.c:3280:13: danger: ‘sp’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 3278|   for( k=0; k<c; k++ )
# 3279|   	{
# 3280|-> 	if( (*sp++ = *s++) == '\0' )
# 3281|   		break;
# 3282|   	}

Error: COMPILER_WARNING: [#def341]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mallocr.c:1014:41: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
# 1014 | #define malloc_update_mallinfo          __malloc_update_mallinfo
#      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mallocr.c:3412:13: note: in expansion of macro ‘malloc_update_mallinfo’
# 3412 | STATIC void malloc_update_mallinfo()
#      |             ^~~~~~~~~~~~~~~~~~~~~~
# 1012|   #define malloc_usable_size		_malloc_usable_size_r
# 1013|   
# 1014|-> #define malloc_update_mallinfo		__malloc_update_mallinfo
# 1015|   
# 1016|   #define malloc_av_			__malloc_av_

Error: COMPILER_WARNING: [#def342]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mlock.c:47:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   47 | __malloc_lock (ptr)
#      | ^~~~~~~~~~~~~
#   45|   
#   46|   void
#   47|-> __malloc_lock (ptr)
#   48|        struct _reent *ptr;
#   49|   {

Error: COMPILER_WARNING: [#def343]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mlock.c:56:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   56 | __malloc_unlock (ptr)
#      | ^~~~~~~~~~~~~~~
#   54|   
#   55|   void
#   56|-> __malloc_unlock (ptr)
#   57|        struct _reent *ptr;
#   58|   {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def344]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:184:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:418:1: enter_function: entry to ‘__pow5mult’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:425:6: branch_true: following ‘true’ branch (when ‘i != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:426:30: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:426:9: call_function: calling ‘__multadd’ from ‘__pow5mult’
#  182|   	}
#  183|         b->_x[wds++] = a;
#  184|->       b->_wds = wds;
#  185|       }
#  186|     return b;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def345]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:321:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:418:1: enter_function: entry to ‘__pow5mult’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:428:6: branch_false: following ‘false’ branch (when ‘k != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:431:8: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:431:6: branch_true: following ‘true’ branch (when ‘p5’ is NULL)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:434:33: call_function: inlined call to ‘__i2b’ from ‘__pow5mult’
#  319|     b = Balloc (ptr, 1);
#  320|     b->_x[0] = i;
#  321|->   b->_wds = 1;
#  322|     return b;
#  323|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def346]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:413:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:418:1: enter_function: entry to ‘__pow5mult’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:428:6: branch_false: following ‘false’ branch (when ‘k != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:431:8: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:439:10: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:441:16: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:441:16: call_function: calling ‘__multiply’ from ‘__pow5mult’
#  411|   #endif
#  412|     for (xc0 = c->_x, xc = xc0 + wc; wc > 0 && !*--xc; --wc);
#  413|->   c->_wds = wc;
#  414|     return c;
#  415|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def347]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:512:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b1’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:480:6: branch_false: following ‘false’ branch (when ‘k == 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:480:6: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:511:12: branch_false: following ‘false’ branch (when ‘xe <= x’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:512:14: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:512:3: danger: dereference of NULL ‘b1’
#  510|         *x1++ = *x++;
#  511|       while (x < xe);
#  512|->   b1->_wds = n1 - 1;
#  513|     Bfree (ptr, b);
#  514|     return b1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def348]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:563:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:548:1: enter_function: entry to ‘__mdiff’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:560:6: branch_true: following ‘true’ branch (when ‘i == 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:562:11: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:562:11: call_function: calling ‘_Balloc’ from ‘__mdiff’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:562:11: return_function: return of NULL to ‘__mdiff’ from ‘_Balloc’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:563:7: danger: dereference of NULL ‘c’
#  561|       {
#  562|         c = Balloc (ptr, 0);
#  563|->       c->_wds = 1;
#  564|         c->_x[0] = 0;
#  565|         return c;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def349]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:577:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:548:1: enter_function: entry to ‘__mdiff’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:560:6: branch_false: following ‘false’ branch (when ‘i != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:567:6: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:576:7: call_function: calling ‘_Balloc’ from ‘__mdiff’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:576:7: return_function: return of NULL to ‘__mdiff’ from ‘_Balloc’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:577:3: danger: dereference of NULL ‘c’
#  575|       i = 0;
#  576|     c = Balloc (ptr, a->_k);
#  577|->   c->_sign = i;
#  578|     wa = a->_wds;
#  579|     xa = a->_x;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def350]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:806:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:755:1: enter_function: entry to ‘__d2b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:781:7: call_function: calling ‘_Balloc’ from ‘__d2b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:781:7: return_function: return of NULL to ‘__d2b’ from ‘_Balloc’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:800:6: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:802:7: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:804:10: branch_true: following ‘true’ branch (when ‘k != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:806:21: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:806:10: danger: dereference of NULL ‘b’
#  804|         if (k)
#  805|   	{
#  806|->          x[0] = y | z << (32 - k);
#  807|   	  z >>= k;
#  808|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def351]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:810:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:755:1: enter_function: entry to ‘__d2b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:781:7: call_function: calling ‘_Balloc’ from ‘__d2b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:781:7: return_function: return of NULL to ‘__d2b’ from ‘_Balloc’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:800:6: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:802:7: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:804:10: branch_false: following ‘false’ branch (when ‘k == 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:810:9: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:810:9: danger: dereference of NULL ‘b’
#  808|   	}
#  809|         else
#  810|-> 	x[0] = y;
#  811|         i = b->_wds = (x[1] = z) ? 2 : 1;
#  812|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def352]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:821:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:755:1: enter_function: entry to ‘__d2b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:781:7: call_function: calling ‘_Balloc’ from ‘__d2b’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:781:7: return_function: return of NULL to ‘__d2b’ from ‘_Balloc’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:800:6: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:820:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/mprec.c:821:7: danger: dereference of NULL ‘b’
#  819|   #endif
#  820|         k = lo0bits (&z);
#  821|->       x[0] = z;
#  822|         i = b->_wds = 1;
#  823|   #ifndef _DOUBLE_IS_32BITS

Error: CPPCHECK_WARNING (CWE-476): [#def353]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/strtod.c:1176: error[nullPointer]: Null pointer dereference
# 1174|     double retval = _strtod_r (_REENT, s00, se);
# 1175|     if (isnan (retval))
# 1176|->     return nanf (NULL);
# 1177|     return (float)retval;
# 1178|   }

Error: COMPILER_WARNING: [#def354]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/system.c:64:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   64 | static int do_system ();
#      | ^~~~~~
#   62|   
#   63|   #if defined (unix) || defined (__CYGWIN__)
#   64|-> static int do_system ();
#   65|   #endif
#   66|   

Error: COMPILER_WARNING: [#def355]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/system.c:121:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  121 | do_system (ptr, s)
#      | ^~~~~~~~~
#  119|   
#  120|   static int
#  121|-> do_system (ptr, s)
#  122|        struct _reent *ptr;
#  123|        _CONST char *s;

Error: COMPILER_WARNING (CWE-681): [#def356]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/wctob.c: scope_hint: In function ‘wctob’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/wctob.c:19:31: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘_wctomb_r’ differ in signedness
#   19 |   retval = _wctomb_r (_REENT, &pwc, c, &mbs);
#      |                               ^~~~
#      |                               |
#      |                               unsigned char *
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/include/sys/reent.h:13: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/include/reent.h:48: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/stdlib/wctob.c:1: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/include/stdlib.h:93:9: note: expected ‘char *’ but argument is of type ‘unsigned char *’
#   93 | int     _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *));
#      |         ^~~~~~
#   17|     _REENT_CHECK_MISC(_REENT);
#   18|   
#   19|->   retval = _wctomb_r (_REENT, &pwc, c, &mbs);
#   20|   
#   21|     if (c == EOF || retval != 1)

Error: COMPILER_WARNING: [#def357]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libc/time/mktime.c:68:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   68 | validate_structure (tim_p)
#      | ^~~~~~~~~~~~~~~~~~
#   66|   
#   67|   static void 
#   68|-> validate_structure (tim_p)
#   69|        struct tm *tim_p;
#   70|   {

Error: COMPILER_WARNING (CWE-457): [#def358]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:21: included_from: Included from here.
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c: scope_hint: In function ‘__ieee754_rem_pio2’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/fdlibm.h:335:14: warning[-Wmaybe-uninitialized]: ‘z’ may be used uninitialized
#  335 |   sl_u.value = (d);                                             \
#      |   ~~~~~~~~~~~^~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:170:9: note: in expansion of macro ‘SET_LOW_WORD’
#  170 |         SET_LOW_WORD(z,low);
#      |         ^~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:92:16: note: ‘z’ was declared here
#   92 |         double z,w,t,r,fn;
#      |                ^
#  333|   do {								\
#  334|     ieee_double_shape_type sl_u;					\
#  335|->   sl_u.value = (d);						\
#  336|     sl_u.parts.lsw = (v);						\
#  337|     (d) = sl_u.value;						\

Error: CPPCHECK_WARNING (CWE-758): [#def359]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/s_lrint.c:59: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   57|   
#   58|     /* Extract sign bit. */
#   59|->   sx = (i0>>31)&1;
#   60|   
#   61|     /* Extract exponent field. */

Error: CPPCHECK_WARNING (CWE-758): [#def360]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/s_lrint.c:75: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   73|             /* Detect the all-zeros representation of plus and
#   74|                minus zero, which fails the calculation below. */
#   75|->           if ((i0 & ~(1 << 31)) == 0)
#   76|                 return 0;
#   77|             j0 = ((i0 & 0x7ff00000) >> 20) - 1023;

Error: CPPCHECK_WARNING (CWE-758): [#def361]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/s_rint.c:50: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   48|   	volatile double w;
#   49|   	EXTRACT_WORDS(i0,i1,x);
#   50|-> 	sx = (i0>>31)&1;
#   51|   	j0 = ((i0>>20)&0x7ff)-0x3ff;
#   52|   	if(j0<20) {

Error: CPPCHECK_WARNING (CWE-758): [#def362]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/s_rint.c:62: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   60|   	        t =  w-TWO52[sx];
#   61|   		GET_HIGH_WORD(i0,t);
#   62|-> 		SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
#   63|   	        return t;
#   64|   	    } else {

Error: CPPCHECK_WARNING (CWE-758): [#def363]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/sf_lrint.c:74: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   72|             /* Detect the all-zeros representation of plus and
#   73|                minus zero, which fails the calculation below. */
#   74|->           if ((i0 & ~(1 << 31)) == 0)
#   75|                 return 0;
#   76|             j0 = ((i0 >> 23) & 0xff) - 0x7f;

Error: CPPCHECK_WARNING (CWE-758): [#def364]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/sf_rint.c:40: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   38|   	volatile float w;
#   39|   	GET_FLOAT_WORD(i0,x);
#   40|-> 	sx = (i0>>31)&1;
#   41|   	ix = (i0&0x7fffffff);
#   42|   	j0 = (ix>>23)-0x7f;

Error: CPPCHECK_WARNING (CWE-758): [#def365]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/common/sf_rint.c:54: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   52|   	        t =  w-TWO23[sx];
#   53|   		GET_FLOAT_WORD(i0,t);
#   54|-> 		SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
#   55|   	        return t;
#   56|   	    } else {

Error: COMPILER_WARNING (CWE-569): [#def366]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_atan2.c: scope_hint: In function ‘__ieee754_atan2’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_atan2.c:76:15: warning[-Wparentheses]: suggest parentheses around arithmetic in operand of ‘|’
#   76 |         if((hx-0x3ff00000|lx)==0) return atan(y);   /* x=1.0 */
#      |             ~~^~~~~~~~~~~
#   74|   	   ((iy|((ly|-ly)>>31))>0x7ff00000))	/* x or y is NaN */
#   75|   	   return x+y;
#   76|-> 	if((hx-0x3ff00000|lx)==0) return atan(y);   /* x=1.0 */
#   77|   	m = ((hy>>31)&1)|((hx>>30)&2);	/* 2*sign(x)+sign(y) */
#   78|   

Error: CPPCHECK_WARNING (CWE-758): [#def367]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_atan2.c:77: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   75|   	   return x+y;
#   76|   	if((hx-0x3ff00000|lx)==0) return atan(y);   /* x=1.0 */
#   77|-> 	m = ((hy>>31)&1)|((hx>>30)&2);	/* 2*sign(x)+sign(y) */
#   78|   
#   79|       /* when y = 0 */

Error: CPPCHECK_WARNING (CWE-457): [#def368]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:152: error[legacyUninitvar]: Uninitialized variable: k
#  150|   	t  = x*x;
#  151|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#  152|-> 	if(k==0) 	return one-((x*c)/(c-2.0)-x); 
#  153|   	else 		y = one-((lo-(x*c)/(2.0-c))-hi);
#  154|   	if(k >= -1021) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def369]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:152:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘k’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:133:11: branch_false: following ‘false’ branch (when ‘hx <= 1071001154’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:144:16: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:144:16: branch_true: following ‘true’ branch (when ‘hx <= 1043333119’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:145:16: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:145:15: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:150:9: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:152:11: danger: use of uninitialized value ‘k’ here
#  150|   	t  = x*x;
#  151|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#  152|-> 	if(k==0) 	return one-((x*c)/(c-2.0)-x); 
#  153|   	else 		y = one-((lo-(x*c)/(2.0-c))-hi);
#  154|   	if(k >= -1021) {

Error: COMPILER_WARNING (CWE-457): [#def370]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:152:11: warning[-Wmaybe-uninitialized]: ‘k’ may be used uninitialized
#  152 |         if(k==0)        return one-((x*c)/(c-2.0)-x);
#      |           ^
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:112:19: note: ‘k’ was declared here
#  112 |         __int32_t k,xsb;
#      |                   ^
#  150|   	t  = x*x;
#  151|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#  152|-> 	if(k==0) 	return one-((x*c)/(c-2.0)-x); 
#  153|   	else 		y = one-((lo-(x*c)/(2.0-c))-hi);
#  154|   	if(k >= -1021) {

Error: COMPILER_WARNING (CWE-457): [#def371]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:153:37: warning[-Wmaybe-uninitialized]: ‘lo’ may be used uninitialized
#  153 |         else            y = one-((lo-(x*c)/(2.0-c))-hi);
#      |                                  ~~~^~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:111:21: note: ‘lo’ was declared here
#  111 |         double y,hi,lo,c,t;
#      |                     ^~
#  151|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#  152|   	if(k==0) 	return one-((x*c)/(c-2.0)-x); 
#  153|-> 	else 		y = one-((lo-(x*c)/(2.0-c))-hi);
#  154|   	if(k >= -1021) {
#  155|   	    __uint32_t hy;

Error: COMPILER_WARNING (CWE-457): [#def372]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c: scope_hint: In function ‘__ieee754_exp’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:153:52: warning[-Wmaybe-uninitialized]: ‘hi’ may be used uninitialized
#  153 |         else            y = one-((lo-(x*c)/(2.0-c))-hi);
#      |                                 ~~~~~~~~~~~~~~~~~~~^~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_exp.c:111:18: note: ‘hi’ was declared here
#  111 |         double y,hi,lo,c,t;
#      |                  ^~
#  151|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#  152|   	if(k==0) 	return one-((x*c)/(c-2.0)-x); 
#  153|-> 	else 		y = one-((lo-(x*c)/(2.0-c))-hi);
#  154|   	if(k >= -1021) {
#  155|   	    __uint32_t hy;

Error: CPPCHECK_WARNING (CWE-758): [#def373]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_jn.c:84: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   82|   	if(n==0) return(__ieee754_j0(x));
#   83|   	if(n==1) return(__ieee754_j1(x));
#   84|-> 	sgn = (n&1)&(hx>>31);	/* even n -- 0, odd n -- sign(x) */
#   85|   	x = fabs(x);
#   86|   	if((ix|lx)==0||ix>=0x7ff00000) 	/* if x is 0 or inf */

Error: COMPILER_WARNING (CWE-691): [#def374]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_pow.c: scope_hint: In function ‘__ieee754_pow’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_pow.c:122:11: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  122 |         if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
#      |           ^
#  120|   
#  121|       /* x|y==NaN return NaN unless x==1 then return 1 */
#  122|-> 	if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) ||
#  123|   	   iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) 
#  124|   	    if(((ix-0x3ff00000)|lx)==0) return one;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def375]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:170:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘z’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:100:11: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:102:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:102:11: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:127:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:127:11: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:165:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:165:11: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:165:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_rem_pio2.c:170:9: danger: use of uninitialized value ‘z’ here
#  168|       /* set z = scalbn(|x|,ilogb(x)-23) */
#  169|   	GET_LOW_WORD(low,x);
#  170|-> 	SET_LOW_WORD(z,low);
#  171|   	e0 	= (int)((ix>>20)-1046);	/* e0 = ilogb(z)-23; */
#  172|   	SET_HIGH_WORD(z, ix - ((__int32_t)e0<<20));

Error: GCC_ANALYZER_WARNING (CWE-1335): [#def376]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:128:20: warning[-Wanalyzer-shift-count-overflow]: shift by count (‘32’) >= precision of type (‘32’)
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:109:11: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:114:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:121:11: branch_true: following ‘true’ branch (when ‘m == 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:121:11: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:122:19: branch_false: following ‘false’ branch (when ‘ix0 != 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:122:19: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:126:21: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:127:18: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/e_sqrt.c:128:20: danger: shift by count ‘32’ here
#  126|   	    for(i=0;(ix0&0x00100000)==0;i++) ix0<<=1;
#  127|   	    m -= i-1;
#  128|-> 	    ix0 |= (ix1>>(32-i));
#  129|   	    ix1 <<= i;
#  130|   	}

Error: CPPCHECK_WARNING (CWE-758): [#def377]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_atan2.c:49: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   47|   	   return x+y;
#   48|   	if(hx==0x3f800000) return atanf(y);   /* x=1.0 */
#   49|-> 	m = ((hy>>31)&1)|((hx>>30)&2);	/* 2*sign(x)+sign(y) */
#   50|   
#   51|       /* when y = 0 */

Error: CPPCHECK_WARNING (CWE-758): [#def378]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:54: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   52|   
#   53|   	GET_FLOAT_WORD(sx,x);
#   54|-> 	xsb = (sx>>31)&1;		/* sign bit of x */
#   55|   	hx = sx & 0x7fffffff;		/* high word of |x| */
#   56|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def379]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:87:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘k’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:58:11: branch_false: following ‘false’ branch (when ‘hx <= 2139095040’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:60:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:60:11: branch_false: following ‘false’ branch (when ‘hx != 2139095040’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:62:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:62:11: branch_false: following ‘false’ branch (when ‘sx <= 1118925335’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:64:12: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:64:11: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:68:11: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:68:11: branch_false: following ‘false’ branch (when ‘hx <= 1051816472’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:79:16: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:79:16: branch_true: following ‘true’ branch (when ‘hx <= 830472191’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:80:16: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:80:15: branch_false: following ‘false’ branch...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:85:9: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:87:11: danger: use of uninitialized value ‘k’ here
#   85|   	t  = x*x;
#   86|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#   87|-> 	if(k==0) 	return one-((x*c)/(c-(float)2.0)-x); 
#   88|   	else 		y = one-((lo-(x*c)/((float)2.0-c))-hi);
#   89|   	if(k >= -125) {

Error: COMPILER_WARNING (CWE-457): [#def380]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:87:11: warning[-Wmaybe-uninitialized]: ‘k’ may be used uninitialized
#   87 |         if(k==0)        return one-((x*c)/(c-(float)2.0)-x);
#      |           ^
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:50:19: note: ‘k’ was declared here
#   50 |         __int32_t k,xsb,sx;
#      |                   ^
#   85|   	t  = x*x;
#   86|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#   87|-> 	if(k==0) 	return one-((x*c)/(c-(float)2.0)-x); 
#   88|   	else 		y = one-((lo-(x*c)/((float)2.0-c))-hi);
#   89|   	if(k >= -125) {

Error: COMPILER_WARNING (CWE-457): [#def381]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:88:37: warning[-Wmaybe-uninitialized]: ‘lo’ may be used uninitialized
#   88 |         else            y = one-((lo-(x*c)/((float)2.0-c))-hi);
#      |                                  ~~~^~~~~~~~~~~~~~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:49:20: note: ‘lo’ was declared here
#   49 |         float y,hi,lo,c,t;
#      |                    ^~
#   86|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#   87|   	if(k==0) 	return one-((x*c)/(c-(float)2.0)-x); 
#   88|-> 	else 		y = one-((lo-(x*c)/((float)2.0-c))-hi);
#   89|   	if(k >= -125) {
#   90|   	    __uint32_t hy;

Error: COMPILER_WARNING (CWE-457): [#def382]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c: scope_hint: In function ‘__ieee754_expf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:88:59: warning[-Wmaybe-uninitialized]: ‘hi’ may be used uninitialized
#   88 |         else            y = one-((lo-(x*c)/((float)2.0-c))-hi);
#      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_exp.c:49:17: note: ‘hi’ was declared here
#   49 |         float y,hi,lo,c,t;
#      |                 ^~
#   86|   	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
#   87|   	if(k==0) 	return one-((x*c)/(c-(float)2.0)-x); 
#   88|-> 	else 		y = one-((lo-(x*c)/((float)2.0-c))-hi);
#   89|   	if(k >= -125) {
#   90|   	    __uint32_t hy;

Error: COMPILER_WARNING: [#def383]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_jn.c:23:1: warning[-Wunused-const-variable=]: ‘invsqrtpi’ defined but not used
#   23 | invsqrtpi=  5.6418961287e-01, /* 0x3f106ebb */
#      | ^~~~~~~~~
#   21|   static float
#   22|   #endif
#   23|-> invsqrtpi=  5.6418961287e-01, /* 0x3f106ebb */
#   24|   two   =  2.0000000000e+00, /* 0x40000000 */
#   25|   one   =  1.0000000000e+00; /* 0x3F800000 */

Error: CPPCHECK_WARNING (CWE-758): [#def384]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_jn.c:58: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   56|   	if(n==0) return(__ieee754_j0f(x));
#   57|   	if(n==1) return(__ieee754_j1f(x));
#   58|-> 	sgn = (n&1)&(hx>>31);	/* even n -- 0, odd n -- sign(x) */
#   59|   	x = fabsf(x);
#   60|   	if(FLT_UWORD_IS_ZERO(ix)||FLT_UWORD_IS_INFINITE(ix))

Error: COMPILER_WARNING (CWE-691): [#def385]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_pow.c: scope_hint: In function ‘__ieee754_powf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_pow.c:79:11: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#   79 |         if(FLT_UWORD_IS_NAN(ix) ||
#      |           ^
#   77|   
#   78|       /* x|y==NaN return NaN unless x==1 then return 1 */
#   79|-> 	if(FLT_UWORD_IS_NAN(ix) ||
#   80|   	   FLT_UWORD_IS_NAN(iy))
#   81|   	    if(ix==0x3f800000) return one;

Error: COMPILER_WARNING (CWE-563): [#def386]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_sqrt.c: scope_hint: In function ‘__ieee754_sqrtf’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/ef_sqrt.c:32:25: warning[-Wunused-variable]: unused variable ‘sign’
#   32 |         __int32_t       sign = (__int32_t)0x80000000;
#      |                         ^~~~
#   30|   {
#   31|   	float z;
#   32|-> 	__int32_t 	sign = (__int32_t)0x80000000; 
#   33|   	__uint32_t r,hx;
#   34|   	__int32_t ix,s,q,m,t,i;

Error: COMPILER_WARNING (CWE-457): [#def387]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/er_lgamma.c: scope_hint: In function ‘__ieee754_lgamma_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/er_lgamma.c:307:20: warning[-Wmaybe-uninitialized]: ‘nadj’ may be used uninitialized
#  307 |         if(hx<0) r = nadj - r;
#      |                  ~~^~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/er_lgamma.c:219:22: note: ‘nadj’ was declared here
#  219 |         double t,y,z,nadj,p,p1,p2,p3,q,r,w;
#      |                      ^~~~
#  305|       /* 2**58 <= x <= inf */
#  306|   	    r =  x*(__ieee754_log(x)-one);
#  307|-> 	if(hx<0) r = nadj - r;
#  308|   	return r;
#  309|   }

Error: COMPILER_WARNING (CWE-457): [#def388]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/erf_lgamma.c: scope_hint: In function ‘__ieee754_lgammaf_r’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/erf_lgamma.c:242:20: warning[-Wmaybe-uninitialized]: ‘nadj’ may be used uninitialized
#  242 |         if(hx<0) r = nadj - r;
#      |                  ~~^~~~~~~~~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/erf_lgamma.c:154:21: note: ‘nadj’ was declared here
#  154 |         float t,y,z,nadj,p,p1,p2,p3,q,r,w;
#      |                     ^~~~
#  240|       /* 2**58 <= x <= inf */
#  241|   	    r =  x*(__ieee754_logf(x)-one);
#  242|-> 	if(hx<0) r = nadj - r;
#  243|   	return r;
#  244|   }

Error: COMPILER_WARNING (CWE-483): [#def389]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c: scope_hint: In function ‘__kernel_rem_pio2’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:190:13: warning[-Wmisleading-indentation]: this ‘for’ clause does not guard...
#  190 |             for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
#      |             ^~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:190:61: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
#  190 |             for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
#      |                                                             ^
#  188|       /* compute q[0],q[1],...q[jk] */
#  189|   	for (i=0;i<=jk;i++) {
#  190|-> 	    for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
#  191|   	}
#  192|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def390]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:209:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘iq[<unknown>]’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:196:30: branch_false: following ‘false’ branch (when ‘j <= 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:203:14: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:208:11: branch_true: following ‘true’ branch (when ‘q0 > 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:209:22: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/k_rem_pio2.c:209:19: danger: use of uninitialized value ‘iq[<unknown>]’ here
#  207|   	ih = 0;
#  208|   	if(q0>0) {	/* need iq[jz-1] to determine n */
#  209|-> 	    i  = (iq[jz-1]>>(24-q0)); n += i;
#  210|   	    iq[jz-1] -= i<<(24-q0);
#  211|   	    ih = iq[jz-1]>>(23-q0);

Error: COMPILER_WARNING (CWE-483): [#def391]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c: scope_hint: In function ‘__kernel_rem_pio2f’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:80:13: warning[-Wmisleading-indentation]: this ‘for’ clause does not guard...
#   80 |             for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
#      |             ^~~
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:80:61: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
#   80 |             for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
#      |                                                             ^
#   78|       /* compute q[0],q[1],...q[jk] */
#   79|   	for (i=0;i<=jk;i++) {
#   80|-> 	    for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
#   81|   	}
#   82|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def392]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:99:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘iq[<unknown>]’
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:86:30: branch_false: following ‘false’ branch (when ‘j <= 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:93:14: branch_false: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:98:11: branch_true: following ‘true’ branch (when ‘q0 > 0’)...
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:99:22: branch_true: ...to here
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/kf_rem_pio2.c:99:19: danger: use of uninitialized value ‘iq[<unknown>]’ here
#   97|   	ih = 0;
#   98|   	if(q0>0) {	/* need iq[jz-1] to determine n */
#   99|-> 	    i  = (iq[jz-1]>>(8-q0)); n += i;
#  100|   	    iq[jz-1] -= i<<(8-q0);
#  101|   	    ih = iq[jz-1]>>(7-q0);

Error: COMPILER_WARNING: [#def393]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/sf_cos.c:19:20: warning[-Wunused-const-variable=]: ‘one’ defined but not used
#   19 | static const float one=1.0;
#      |                    ^~~
#   17|   
#   18|   #ifdef __STDC__
#   19|-> static const float one=1.0;
#   20|   #else
#   21|   static float one=1.0;

Error: COMPILER_WARNING: [#def394]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/w_cabs.c:16:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   16 | cabs(z)
#      | ^~~~
#   14|   
#   15|   double
#   16|-> cabs(z)
#   17|   	struct complex z;
#   18|   {

Error: COMPILER_WARNING: [#def395]
xen-4.20.2/stubdom/newlib-1.16.0/newlib/libm/math/wf_cabs.c:16:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#   16 | cabsf(z)
#      | ^~~~~
#   14|   
#   15|   float
#   16|-> cabsf(z)
#   17|   	struct complex z;
#   18|   {

Error: CPPCHECK_WARNING (CWE-476): [#def396]
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:73: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: a
#   71|     int i;
#   72|   
#   73|->   memset(a, 0, sizeof(*a));
#   74|     pci_set_name_list_path(a, PCI_PATH_IDS_DIR "/" PCI_IDS, 0);
#   75|     for(i=0; i<PCI_ACCESS_MAX; i++)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def397]
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:73:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘a’ where non-null expected
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:70:26: acquire_memory: this call could return NULL
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:73:3: danger: argument 1 (‘a’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   71|     int i;
#   72|   
#   73|->   memset(a, 0, sizeof(*a));
#   74|     pci_set_name_list_path(a, PCI_PATH_IDS_DIR "/" PCI_IDS, 0);
#   75|     for(i=0; i<PCI_ACCESS_MAX; i++)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def398]
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:119:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:115:3: acquire_resource: ‘va_start’ called here
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:119:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  117|     vfprintf(stderr, msg, args);
#  118|     fputc('\n', stderr);
#  119|-> }
#  120|   
#  121|   static void

Error: GCC_ANALYZER_WARNING (CWE-688): [#def399]
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:205:3: warning[-Wanalyzer-null-argument]: use of NULL ‘d’ where non-null expected
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:201:1: enter_function: entry to ‘pci_alloc_dev’
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:203:23: call_function: calling ‘pci_malloc’ from ‘pci_alloc_dev’
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:203:23: return_function: returning to ‘pci_alloc_dev’ from ‘pci_malloc’
xen-4.20.2/stubdom/pciutils-x86_64/lib/access.c:205:3: danger: argument 1 (‘d’) NULL where non-null expected
#  203|     struct pci_dev *d = pci_malloc(a, sizeof(struct pci_dev));
#  204|   
#  205|->   memset(d, 0, sizeof(*d));
#  206|     d->access = a;
#  207|     d->methods = a->methods;

Error: COMPILER_WARNING (CWE-563): [#def400]
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c: scope_hint: In function ‘dump_validate’
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:44:7: warning[-Wunused-value]: value computed is not used
#   44 |       *fmt++, *s++;
#      |       ^~~~~~
#   42|         if (*fmt == '#' ? !isxdigit(*s) : *fmt != *s)
#   43|   	return 0;
#   44|->       *fmt++, *s++;
#   45|       }
#   46|     return 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def401]
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:67:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘z’
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:60:6: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:60:6: branch_false: ...to here
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:62:10: branch_true: following ‘true’ branch...
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:64:17: branch_true: ...to here
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:65:10: branch_true: following ‘true’ branch (when ‘z’ is NULL)...
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:66:9: branch_true: ...to here
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:67:7: danger: dereference of NULL ‘z’
#   65|         if (!z)
#   66|   	a->error("dump: line too long or unterminated");
#   67|->       *z-- = 0;
#   68|         if (z >= buf && *z == '\r')
#   69|   	*z-- = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def402]
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:110:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:60:13: acquire_resource: opened here
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:60:6: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:60:6: branch_false: ...to here
xen-4.20.2/stubdom/pciutils-x86_64/lib/dump.c:110:1: danger: ‘f’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  108|   	}
#  109|       }
#  110|-> }
#  111|   
#  112|   static void

Error: COMPILER_WARNING (CWE-563): [#def403]
xen-4.20.2/stubdom/pciutils-x86_64/lib/generic.c: scope_hint: In function ‘pci_generic_fill_info’
xen-4.20.2/stubdom/pciutils-x86_64/lib/generic.c:134:27: warning[-Wunused-variable]: unused variable ‘size’
#  134 |                       u32 size;
#      |                           ^~~~
#  132|                     if (flags & PCI_FILL_SIZES)
#  133|                       {
#  134|->                       u32 size;
#  135|                         pci_write_long(d, PCI_BASE_ADDRESS_0 + i*4, ~0);
#  136|                         d->size[i] = pci_size(x, pci_read_long(d, PCI_BASE_ADDRESS_0 + i*4), PCI_BASE_ADDRESS_IO_MASK);

Error: COMPILER_WARNING (CWE-563): [#def404]
xen-4.20.2/stubdom/pciutils-x86_64/lib/generic.c:147:31: warning[-Wunused-variable]: unused variable ‘size’
#  147 |                           u32 size;
#      |                               ^~~~
#  145|                         if (flags & PCI_FILL_SIZES)
#  146|                           {
#  147|->                           u32 size;
#  148|                             pci_write_long(d, PCI_BASE_ADDRESS_0 + i*4, ~0);
#  149|                             d->size[i] = pci_read_long(d, PCI_BASE_ADDRESS_0 + i*4);

Error: COMPILER_WARNING (CWE-563): [#def405]
xen-4.20.2/stubdom/pciutils-x86_64/lib/generic.c:179:35: warning[-Wunused-variable]: unused variable ‘size’
#  179 |                               u32 size;
#      |                                   ^~~~
#  177|                             if (flags & PCI_FILL_SIZES)
#  178|                               {
#  179|->                               u32 size;
#  180|                                 pci_write_long(d, PCI_BASE_ADDRESS_0 + (i-1)*4, ~0);
#  181|                                 d->size[i-1] = pci_size(x, pci_read_long(d, PCI_BASE_ADDRESS_0 + (i-1)*4), PCI_BASE_ADDRESS_MEM_MASK);

Error: COMPILER_WARNING (CWE-563): [#def406]
xen-4.20.2/stubdom/pciutils-x86_64/lib/generic.c:212:23: warning[-Wunused-variable]: unused variable ‘size’
#  212 |                   u32 size;
#      |                       ^~~~
#  210|                 if (flags & PCI_FILL_SIZES)
#  211|                   {
#  212|->                   u32 size;
#  213|                     pci_write_long(d, reg, ~0);
#  214|                     d->rom_size = pci_read_long(d, reg);

Error: COMPILER_WARNING (CWE-563): [#def407]
xen-4.20.2/stubdom/pciutils-x86_64/lib/minios.c: scope_hint: In function ‘minios_detect’
xen-4.20.2/stubdom/pciutils-x86_64/lib/minios.c:15:34: warning[-Wunused-parameter]: unused parameter ‘a’
#   15 | minios_detect(struct pci_access *a)
#      |               ~~~~~~~~~~~~~~~~~~~^
#   13|   
#   14|   static int
#   15|-> minios_detect(struct pci_access *a)
#   16|   {
#   17|     return 1;

Error: COMPILER_WARNING (CWE-563): [#def408]
xen-4.20.2/stubdom/pciutils-x86_64/lib/minios.c: scope_hint: In function ‘minios_init’
xen-4.20.2/stubdom/pciutils-x86_64/lib/minios.c:21:32: warning[-Wunused-parameter]: unused parameter ‘a’
#   21 | minios_init(struct pci_access *a)
#      |             ~~~~~~~~~~~~~~~~~~~^
#   19|   
#   20|   static void
#   21|-> minios_init(struct pci_access *a)
#   22|   {
#   23|   }

Error: COMPILER_WARNING (CWE-563): [#def409]
xen-4.20.2/stubdom/pciutils-x86_64/lib/minios.c: scope_hint: In function ‘minios_cleanup’
xen-4.20.2/stubdom/pciutils-x86_64/lib/minios.c:26:35: warning[-Wunused-parameter]: unused parameter ‘a’
#   26 | minios_cleanup(struct pci_access *a)
#      |                ~~~~~~~~~~~~~~~~~~~^
#   24|   
#   25|   static void
#   26|-> minios_cleanup(struct pci_access *a)
#   27|   {
#   28|     shutdown_pcifront(NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def410]
xen-4.20.2/stubdom/pciutils-x86_64/lib/names.c:36: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_name
#   34|       return result;
#   35|     new_name = malloc(len - 2);
#   36|->   memcpy(new_name, a->id_file_name, len - 3);
#   37|     new_name[len - 3] = 0;
#   38|     pci_set_name_list_path(a, new_name, 1);

Error: CPPCHECK_WARNING (CWE-476): [#def411]
xen-4.20.2/stubdom/pciutils-x86_64/lib/names.c:37: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_name
#   35|     new_name = malloc(len - 2);
#   36|     memcpy(new_name, a->id_file_name, len - 3);
#   37|->   new_name[len - 3] = 0;
#   38|     pci_set_name_list_path(a, new_name, 1);
#   39|     return gzopen(a->id_file_name, "rb");

Error: CPPCHECK_WARNING (CWE-401): [#def412]
xen-4.20.2/stubdom/zlib-x86_64/gzio.c:149: error[memleak]: Memory leak: s.path
#  147|           }
#  148|       } while (*p++ && m != fmode + sizeof(fmode));
#  149|->     if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
#  150|   
#  151|       if (s->mode == 'w') {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def413]
xen-4.20.2/tools/9pfsd/io.c:281:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/9pfsd/io.c:1409:7: enter_function: entry to ‘io_thread’
xen-4.20.2/tools/9pfsd/io.c:1418:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1418:8: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1424:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1426:9: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1435:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1435:35: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1440:16: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1440:16: branch_true: following ‘true’ branch (when ‘in_hdr != 0’)...
xen-4.20.2/tools/9pfsd/io.c:1442:26: branch_true: ...to here
xen-4.20.2/tools/9pfsd/io.c:1443:20: branch_false: following ‘false’ branch (when ‘count == 7’)...
xen-4.20.2/tools/9pfsd/io.c:1445:44: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1446:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1457:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1460:13: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1465:17: call_function: calling ‘p9_version’ from ‘io_thread’
#  279|               if ( len > 0xffff )
#  280|               {
#  281|->                 syslog(LOG_CRIT, "string length %u in fill_buffer()", len);
#  282|                   exit(1);
#  283|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def414]
xen-4.20.2/tools/9pfsd/io.c:381:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘array’
xen-4.20.2/tools/9pfsd/io.c:1409:7: enter_function: entry to ‘io_thread’
xen-4.20.2/tools/9pfsd/io.c:1418:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1418:8: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1424:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1426:9: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1435:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1435:35: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1440:16: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1440:16: branch_true: following ‘true’ branch (when ‘in_hdr != 0’)...
xen-4.20.2/tools/9pfsd/io.c:1442:26: branch_true: ...to here
xen-4.20.2/tools/9pfsd/io.c:1443:20: branch_false: following ‘false’ branch (when ‘count == 7’)...
xen-4.20.2/tools/9pfsd/io.c:1445:44: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1446:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1457:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/9pfsd/io.c:1460:13: branch_false: ...to here
xen-4.20.2/tools/9pfsd/io.c:1465:17: call_function: calling ‘p9_version’ from ‘io_thread’
#  379|                              unsigned int elem_sz, void *data)
#  380|   {
#  381|->     if ( *array_sz && !*array )
#  382|       {
#  383|           *array = calloc(*array_sz, elem_sz);

Error: CPPCHECK_WARNING (CWE-909): [#def415]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:256: error[uninitStructMember]: Uninitialized struct member: device.devid
#  254|       XEN_TAILQ_FOREACH( device, &devs, list )
#  255|       {
#  256|->         if ( domid == device->domid && devid == device->devid )
#  257|               return device;
#  258|       }

Error: CPPCHECK_WARNING (CWE-909): [#def416]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:256: error[uninitStructMember]: Uninitialized struct member: device.domid
#  254|       XEN_TAILQ_FOREACH( device, &devs, list )
#  255|       {
#  256|->         if ( domid == device->domid && devid == device->devid )
#  257|               return device;
#  258|       }

Error: CPPCHECK_WARNING (CWE-457): [#def417]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:256: error[uninitvar]: Uninitialized variable: device
#  254|       XEN_TAILQ_FOREACH( device, &devs, list )
#  255|       {
#  256|->         if ( domid == device->domid && devid == device->devid )
#  257|               return device;
#  258|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def418]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:299:11: warning[-Wanalyzer-malloc-leak]: leak of ‘device’
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:622:13: enter_function: entry to ‘handle_watch’
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:627:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:629:9: branch_true: ...to here
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:629:9: call_function: calling ‘scan_backend’ from ‘handle_watch’
#  297|       construct_frontend_path(device, "state", &p);
#  298|       snprintf(token, sizeof(token), "%u/%u", domid, devid);
#  299|->     if ( !xs_watch(xs, p.path, token) )
#  300|       {
#  301|           syslog(LOG_ERR, "Setting up watch for device %u/%u failed",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def419]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:301:9: warning[-Wanalyzer-malloc-leak]: leak of ‘device’
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:622:13: enter_function: entry to ‘handle_watch’
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:627:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:629:9: branch_true: ...to here
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:629:9: call_function: calling ‘scan_backend’ from ‘handle_watch’
#  299|       if ( !xs_watch(xs, p.path, token) )
#  300|       {
#  301|->         syslog(LOG_ERR, "Setting up watch for device %u/%u failed",
#  302|                  domid, devid);
#  303|           free(device);

Error: CPPCHECK_WARNING (CWE-401): [#def420]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:304: error[memleak]: Memory leak: device
#  302|                  domid, devid);
#  303|           free(device);
#  304|->         return NULL;
#  305|       }
#  306|   

Error: CPPCHECK_WARNING (CWE-909): [#def421]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:617: error[uninitStructMember]: Uninitialized struct member: device.last_seen
#  615|       XEN_TAILQ_FOREACH_SAFE( device, &devs, list, tmp )
#  616|       {
#  617|->         if ( device->last_seen != now )
#  618|               remove_device(device);
#  619|       }

Error: CPPCHECK_WARNING (CWE-457): [#def422]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:617: error[uninitvar]: Uninitialized variable: device
#  615|       XEN_TAILQ_FOREACH_SAFE( device, &devs, list, tmp )
#  616|       {
#  617|->         if ( device->last_seen != now )
#  618|               remove_device(device);
#  619|       }

Error: CPPCHECK_WARNING (CWE-909): [#def423]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:688: error[uninitStructMember]: Uninitialized struct member: device.num_rings
#  686|       XEN_TAILQ_FOREACH( device, &devs, list )
#  687|       {
#  688|->         for ( ring_idx = 0; ring_idx < device->num_rings; ring_idx++ )
#  689|           {
#  690|               ring = device->ring[ring_idx];

Error: CPPCHECK_WARNING (CWE-457): [#def424]
xen-4.20.2/tools/9pfsd/xen-9pfsd.c:688: error[uninitvar]: Uninitialized variable: device
#  686|       XEN_TAILQ_FOREACH( device, &devs, list )
#  687|       {
#  688|->         for ( ring_idx = 0; ring_idx < device->num_rings; ring_idx++ )
#  689|           {
#  690|               ring = device->ring[ring_idx];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def425]
xen-4.20.2/tools/console/daemon/io.c:452:16: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/console/daemon/io.c:1196:13: enter_function: entry to ‘console_open_log’
xen-4.20.2/tools/console/daemon/io.c:1201:31: call_function: calling ‘create_console_log’ from ‘console_open_log’
#  450|   	namepath = s;
#  451|   	strcat(namepath, "/name");
#  452|-> 	data = xs_read(xs, XBT_NULL, namepath, &len);
#  453|   	free(namepath);
#  454|   	if (!data)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def426]
xen-4.20.2/tools/console/daemon/io.c:650:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  648|   			break;
#  649|   		}
#  650|-> 		p = xs_read(xs, XBT_NULL, path, NULL);
#  651|   		free(path);
#  652|   		if (p == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def427]
xen-4.20.2/tools/console/daemon/io.c:795:27: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  793|   	snprintf(domid_str, sizeof(domid_str), "dom%u", dom->domid);
#  794|   	if (watch) {
#  795|-> 		success = xs_watch(xs, con->xspath, domid_str);
#  796|   		if (success)
#  797|   			console_iter_int_arg1(dom, console_create_ring);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def428]
xen-4.20.2/tools/console/daemon/io.c:795:27: warning[-Wanalyzer-malloc-leak]: leak of ‘dom’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  793|   	snprintf(domid_str, sizeof(domid_str), "dom%u", dom->domid);
#  794|   	if (watch) {
#  795|-> 		success = xs_watch(xs, con->xspath, domid_str);
#  796|   		if (success)
#  797|   			console_iter_int_arg1(dom, console_create_ring);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def429]
xen-4.20.2/tools/console/daemon/io.c:799:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  797|   			console_iter_int_arg1(dom, console_create_ring);
#  798|   		else
#  799|-> 			xs_unwatch(xs, con->xspath, domid_str);
#  800|   	} else {
#  801|   		success = xs_unwatch(xs, con->xspath, domid_str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def430]
xen-4.20.2/tools/console/daemon/io.c:799:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dom’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  797|   			console_iter_int_arg1(dom, console_create_ring);
#  798|   		else
#  799|-> 			xs_unwatch(xs, con->xspath, domid_str);
#  800|   	} else {
#  801|   		success = xs_unwatch(xs, con->xspath, domid_str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def431]
xen-4.20.2/tools/console/daemon/io.c:817:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dom’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  815|   
#  816|   	if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
#  817|-> 		dolog(LOG_ERR, "Cannot get time of day %s:%s:L%d",
#  818|   		      __FILE__, __FUNCTION__, __LINE__);
#  819|   		return err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def432]
xen-4.20.2/tools/console/daemon/io.c:837:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dom’
xen-4.20.2/tools/console/daemon/io.c:1316:6: enter_function: entry to ‘handle_io’
xen-4.20.2/tools/console/daemon/io.c:1324:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1344:22: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/io.c:1358:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/io.c:1358:9: call_function: calling ‘enum_domains’ from ‘handle_io’
#  835|   	con->use_gnttab = (*con_type)->use_gnttab;
#  836|   	xsname = (*con_type)->xsname;
#  837|-> 	xspath = xs_get_domain_path(xs, dom->domid);
#  838|   	s = realloc(xspath, strlen(xspath) +
#  839|   		    strlen(xsname) + 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def433]
xen-4.20.2/tools/console/daemon/main.c:85:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pidfile’
xen-4.20.2/tools/console/daemon/main.c:95:5: enter_function: entry to ‘main’
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
xen-4.20.2/tools/console/daemon/main.c:120:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:151:35: acquire_memory: allocated here
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
xen-4.20.2/tools/console/daemon/main.c:184:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:184:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:188:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:188:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:193:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:198:9: call_function: calling ‘increase_fd_limit’ from ‘main’
#   83|   	/* Try to increase our limit. */
#   84|   	if (setrlimit(RLIMIT_NOFILE, &new) < 0)
#   85|-> 		syslog(LOG_WARNING,
#   86|   		       "Unable to increase fd limit from {%llu, %llu} to "
#   87|   		       "{%llu, %llu}: (%s) - May run out with lots of domains",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
xen-4.20.2/tools/console/daemon/main.c:195:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pidfile’
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
xen-4.20.2/tools/console/daemon/main.c:120:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:151:35: acquire_memory: allocated here
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
xen-4.20.2/tools/console/daemon/main.c:184:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:184:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:188:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:188:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:193:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:195:9: throw: if ‘openlog’ throws an exception...
xen-4.20.2/tools/console/daemon/main.c:195:9: danger: ‘pidfile’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  193|   	signal(SIGHUP, handle_hup);
#  194|   
#  195|-> 	openlog("xenconsoled", syslog_option, LOG_DAEMON);
#  196|   	setlogmask(syslog_mask);
#  197|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def435]
xen-4.20.2/tools/console/daemon/main.c:201:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pidfile’
xen-4.20.2/tools/console/daemon/main.c:95:5: enter_function: entry to ‘main’
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
xen-4.20.2/tools/console/daemon/main.c:120:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:151:35: acquire_memory: allocated here
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
xen-4.20.2/tools/console/daemon/main.c:184:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:184:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:188:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:188:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:193:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:198:9: call_function: calling ‘increase_fd_limit’ from ‘main’
xen-4.20.2/tools/console/daemon/main.c:198:9: return_function: returning to ‘main’ from ‘increase_fd_limit’
xen-4.20.2/tools/console/daemon/main.c:200:12: branch_false: following ‘false’ branch (when ‘is_interactive == 0’)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: following ‘true’ branch (when ‘pidfile’ is non-NULL)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:201:17: throw: if ‘daemonize’ throws an exception...
xen-4.20.2/tools/console/daemon/main.c:201:17: danger: ‘pidfile’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  199|   
#  200|   	if (!is_interactive) {
#  201|-> 		daemonize(pidfile ? pidfile : XEN_RUN_DIR "/xenconsoled.pid");
#  202|   	}
#  203|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
xen-4.20.2/tools/console/daemon/main.c:204:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pidfile’
xen-4.20.2/tools/console/daemon/main.c:95:5: enter_function: entry to ‘main’
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
xen-4.20.2/tools/console/daemon/main.c:120:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:151:35: acquire_memory: allocated here
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
xen-4.20.2/tools/console/daemon/main.c:184:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:184:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:188:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:188:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:193:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:198:9: call_function: calling ‘increase_fd_limit’ from ‘main’
xen-4.20.2/tools/console/daemon/main.c:198:9: return_function: returning to ‘main’ from ‘increase_fd_limit’
xen-4.20.2/tools/console/daemon/main.c:200:12: branch_false: following ‘false’ branch (when ‘is_interactive == 0’)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: following ‘true’ branch (when ‘pidfile’ is non-NULL)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:204:14: throw: if ‘xen_setup’ throws an exception...
xen-4.20.2/tools/console/daemon/main.c:204:14: danger: ‘pidfile’ leaks here; was allocated at [(4)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/3)
#  202|   	}
#  203|   
#  204|-> 	if (!xen_setup())
#  205|   		exit(1);
#  206|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def437]
xen-4.20.2/tools/console/daemon/main.c:207:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pidfile’
xen-4.20.2/tools/console/daemon/main.c:95:5: enter_function: entry to ‘main’
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
xen-4.20.2/tools/console/daemon/main.c:120:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:151:35: acquire_memory: allocated here
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
xen-4.20.2/tools/console/daemon/main.c:184:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:184:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:188:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:188:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:193:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:198:9: call_function: calling ‘increase_fd_limit’ from ‘main’
xen-4.20.2/tools/console/daemon/main.c:198:9: return_function: returning to ‘main’ from ‘increase_fd_limit’
xen-4.20.2/tools/console/daemon/main.c:200:12: branch_false: following ‘false’ branch (when ‘is_interactive == 0’)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: following ‘true’ branch (when ‘pidfile’ is non-NULL)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:204:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/console/daemon/main.c:207:9: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:207:9: throw: if ‘handle_io’ throws an exception...
xen-4.20.2/tools/console/daemon/main.c:207:9: danger: ‘pidfile’ leaks here; was allocated at [(4)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/3)
#  205|   		exit(1);
#  206|   
#  207|-> 	handle_io();
#  208|   
#  209|   	closelog();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def438]
xen-4.20.2/tools/console/daemon/main.c:209:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pidfile’
xen-4.20.2/tools/console/daemon/main.c:95:5: enter_function: entry to ‘main’
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
xen-4.20.2/tools/console/daemon/main.c:120:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:151:35: acquire_memory: allocated here
xen-4.20.2/tools/console/daemon/main.c:119:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
xen-4.20.2/tools/console/daemon/main.c:184:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:184:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:188:13: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:188:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/main.c:193:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:198:9: call_function: calling ‘increase_fd_limit’ from ‘main’
xen-4.20.2/tools/console/daemon/main.c:198:9: return_function: returning to ‘main’ from ‘increase_fd_limit’
xen-4.20.2/tools/console/daemon/main.c:200:12: branch_false: following ‘false’ branch (when ‘is_interactive == 0’)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_false: ...to here
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: following ‘true’ branch (when ‘pidfile’ is non-NULL)...
xen-4.20.2/tools/console/daemon/main.c:201:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:204:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/console/daemon/main.c:207:9: branch_true: ...to here
xen-4.20.2/tools/console/daemon/main.c:209:9: throw: if ‘closelog’ throws an exception...
xen-4.20.2/tools/console/daemon/main.c:209:9: danger: ‘pidfile’ leaks here; was allocated at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
#  207|   	handle_io();
#  208|   
#  209|-> 	closelog();
#  210|   	free(log_dir);
#  211|   	free(pidfile);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def439]
xen-4.20.2/tools/console/daemon/utils.c:74:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
xen-4.20.2/tools/console/daemon/utils.c:54:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
xen-4.20.2/tools/console/daemon/utils.c:56:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:56:19: branch_false: following ‘false’ branch (when ‘pid != -1’)...
xen-4.20.2/tools/console/daemon/utils.c:60:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:62:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
xen-4.20.2/tools/console/daemon/utils.c:64:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:64:19: branch_false: following ‘false’ branch (when ‘pid != -1’)...
xen-4.20.2/tools/console/daemon/utils.c:69:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:69:19: acquire_resource: opened here
xen-4.20.2/tools/console/daemon/utils.c:69:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/utils.c:69:12: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:73:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
xen-4.20.2/tools/console/daemon/utils.c:74:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/utils.c:74:17: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/console/daemon/utils.c:74:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   72|   
#   73|   	for (i = 0; i <= 2; i++) {
#   74|-> 		close(i);
#   75|   		dup2(fd, i);
#   76|   	}

Error: GCC_ANALYZER_WARNING: [#def440]
xen-4.20.2/tools/console/daemon/utils.c:75:17: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘i’
xen-4.20.2/tools/console/daemon/utils.c:54:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
xen-4.20.2/tools/console/daemon/utils.c:56:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:56:19: branch_false: following ‘false’ branch (when ‘pid != -1’)...
xen-4.20.2/tools/console/daemon/utils.c:60:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:62:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
xen-4.20.2/tools/console/daemon/utils.c:64:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:64:19: branch_false: following ‘false’ branch (when ‘pid != -1’)...
xen-4.20.2/tools/console/daemon/utils.c:69:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:69:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/utils.c:69:12: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:73:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
xen-4.20.2/tools/console/daemon/utils.c:74:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/utils.c:74:17: release_resource: closed here
xen-4.20.2/tools/console/daemon/utils.c:75:17: danger: ‘i’ could be invalid
#   73|   	for (i = 0; i <= 2; i++) {
#   74|   		close(i);
#   75|-> 		dup2(fd, i);
#   76|   	}
#   77|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def441]
xen-4.20.2/tools/console/daemon/utils.c:78:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
xen-4.20.2/tools/console/daemon/utils.c:54:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
xen-4.20.2/tools/console/daemon/utils.c:56:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:56:19: branch_false: following ‘false’ branch (when ‘pid != -1’)...
xen-4.20.2/tools/console/daemon/utils.c:60:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:62:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
xen-4.20.2/tools/console/daemon/utils.c:64:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:64:19: branch_false: following ‘false’ branch (when ‘pid != -1’)...
xen-4.20.2/tools/console/daemon/utils.c:69:19: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:69:19: acquire_resource: opened here
xen-4.20.2/tools/console/daemon/utils.c:69:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/console/daemon/utils.c:69:12: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:73:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
xen-4.20.2/tools/console/daemon/utils.c:74:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/utils.c:73:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
xen-4.20.2/tools/console/daemon/utils.c:74:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/utils.c:73:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
xen-4.20.2/tools/console/daemon/utils.c:74:17: branch_true: ...to here
xen-4.20.2/tools/console/daemon/utils.c:73:21: branch_false: following ‘false’ branch (when ‘i == 3’)...
xen-4.20.2/tools/console/daemon/utils.c:78:9: branch_false: ...to here
xen-4.20.2/tools/console/daemon/utils.c:78:9: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#   76|   	}
#   77|   
#   78|-> 	close(fd);
#   79|   
#   80|   	umask(027);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def442]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:90:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock_fd’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:73:15: acquire_resource: stream socket created here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:74:8: branch_false: following ‘false’ branch (when ‘sock_fd >= 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:80:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:9: acquire_resource: socket created here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:90:56: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:90:9: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:90:9: danger: ‘sock_fd’ leaks here
#   88|       if (bind(sock_fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr))
#   89|           || listen (sock_fd, 1)) {
#   90|->         gxprt("ERROR: can't bind address. errno:%d\n", errno);
#   91|           close(sock_fd);
#   92|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def443]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:91:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock_fd’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:73:15: acquire_resource: stream socket created here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:74:8: branch_false: following ‘false’ branch (when ‘sock_fd >= 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:80:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:9: acquire_resource: socket created here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:90:56: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:91:9: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:91:9: danger: ‘sock_fd’ leaks here
#   89|           || listen (sock_fd, 1)) {
#   90|           gxprt("ERROR: can't bind address. errno:%d\n", errno);
#   91|->         close(sock_fd);
#   92|           return -1;
#   93|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def444]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:99:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock_fd’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:73:15: acquire_resource: stream socket created here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:74:8: branch_false: following ‘false’ branch (when ‘sock_fd >= 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:80:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:89:12: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:94:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:98:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:99:51: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:99:9: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:99:9: danger: ‘sock_fd’ leaks here
#   97|       remote_fd = accept(sock_fd, (struct sockaddr *) &sockaddr, &tmp);
#   98|       if (remote_fd == -1) {
#   99|->         gxprt("ERROR: accept failed. errno:%d\n", errno);
#  100|           close(sock_fd);
#  101|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def445]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:100:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock_fd’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:73:15: acquire_resource: stream socket created here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:74:8: branch_false: following ‘false’ branch (when ‘sock_fd >= 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:80:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:89:12: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:88:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:94:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:98:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:99:51: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:100:9: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:100:9: danger: ‘sock_fd’ leaks here
#   98|       if (remote_fd == -1) {
#   99|           gxprt("ERROR: accept failed. errno:%d\n", errno);
#  100|->         close(sock_fd);
#  101|           return -1;
#  102|       }

Error: CPPCHECK_WARNING (CWE-682): [#def446]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:286: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  284|   
#  285|       p = buf2;
#  286|->     *p++ = '$';
#  287|   
#  288|       for (i = 0; i < cnt; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def447]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:286: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p++
#  284|   
#  285|       p = buf2;
#  286|->     *p++ = '$';
#  287|   
#  288|       for (i = 0; i < cnt; i++) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def448]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:286:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: this call could return NULL
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:286:5: danger: ‘buf2’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  284|   
#  285|       p = buf2;
#  286|->     *p++ = '$';
#  287|   
#  288|       for (i = 0; i < cnt; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def449]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:293:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:293:12: throw: if ‘gx_tohex’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:293:12: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  291|       }
#  292|       *p++ = '#';
#  293|->     *p++ = gx_tohex((csum >> 4) & 0xf);
#  294|       *p++ = gx_tohex(csum & 0xf);
#  295|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def450]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:294:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:294:12: throw: if ‘gx_tohex’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:294:12: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  292|       *p++ = '#';
#  293|       *p++ = gx_tohex((csum >> 4) & 0xf);
#  294|->     *p++ = gx_tohex(csum & 0xf);
#  295|   
#  296|       *p = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def451]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:13: throw: if ‘write’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:13: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  301|           int cc;
#  302|   
#  303|->         if (write(remote_fd, buf2, p - buf2) != p - buf2) {
#  304|               perror("putpkt(write)");
#  305|               free(buf2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def452]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:304:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:304:13: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:304:13: throw: if ‘perror’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:304:13: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  302|   
#  303|           if (write(remote_fd, buf2, p - buf2) != p - buf2) {
#  304|->             perror("putpkt(write)");
#  305|               free(buf2);
#  306|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def453]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:309:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:13: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:309:13: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:309:13: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:309:13: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  307|           }
#  308|           if (gx_remote_dbg)
#  309|->             gxprt("putpkt (\"%s\"); [looking for ack]\n", buf2);
#  310|   
#  311|           cc = read(remote_fd, buf3, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def454]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:313:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:13: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:311:14: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:312:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:313:56: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:313:13: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:313:13: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  311|           cc = read(remote_fd, buf3, 1);
#  312|           if (gx_remote_dbg)
#  313|->             gxprt("[received '%c' (0x%x)]\n", buf3[0], buf3[0]);
#  314|   
#  315|           if (cc <= 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def455]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:317:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:13: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:311:14: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:315:12: branch_true: following ‘true’ branch (when ‘cc <= 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:316:16: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:316:16: branch_true: following ‘true’ branch (when ‘cc == 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:317:17: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:317:17: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:317:17: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  315|           if (cc <= 0) {
#  316|               if (cc == 0)
#  317|->                 gxprt("putpkt(read): Got EOF\n");
#  318|               else
#  319|                   gxprt("putpkt(read)");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def456]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:319:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:13: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:311:14: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:315:12: branch_true: following ‘true’ branch (when ‘cc <= 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:316:16: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:316:16: branch_false: following ‘false’ branch (when ‘cc != 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:319:17: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:319:17: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:319:17: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  317|                   gxprt("putpkt(read): Got EOF\n");
#  318|               else
#  319|->                 gxprt("putpkt(read)");
#  320|               free(buf2);
#  321|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def457]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:325:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:280:12: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:288:17: branch_false: following ‘false’ branch (when ‘i >= cnt’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:292:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:13: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:308:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:311:14: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:315:12: branch_false: following ‘false’ branch (when ‘cc > 0’)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:324:13: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:324:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:325:13: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:325:13: throw: if ‘gxprt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_comm.c:325:13: danger: ‘buf2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  323|           /* Check for an input interrupt while we're here.  */
#  324|           if (buf3[0] == '\003')
#  325|->             gxprt("WARN: need to send SIGINT in putpkt\n");
#  326|   
#  327|       } while (buf3[0] != '+');

Error: GCC_ANALYZER_WARNING (CWE-401): [#def458]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:207:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xbuf’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:203:15: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:203:8: branch_false: following ‘false’ branch (when ‘xbuf’ is non-NULL)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:207:17: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:207:17: throw: if ‘xg_read_mem’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:207:17: danger: ‘xbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  205|           return;
#  206|       }
#  207|->     if ((remain=xg_read_mem(addr, xbuf, len, pgd3val)) != 0) {
#  208|           XGTRC("Failed read mem. addr:0x%llx len:%d remn:%d errno:%d\n",
#  209|                 addr, len, remain, errno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def459]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:233:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xbuf’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:229:15: acquire_memory: allocated here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:229:8: branch_false: following ‘false’ branch (when ‘xbuf’ is non-NULL)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:233:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:233:5: throw: if ‘gx_convert_ascii_to_int’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:233:5: danger: ‘xbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  231|           return;
#  232|       }
#  233|->     gx_convert_ascii_to_int(data_strtp, xbuf, len);
#  234|   
#  235|       if ((remain=xg_write_mem(addr, xbuf, len, pgd3val)) != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def460]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:672:9: warning[-Wanalyzer-malloc-leak]: leak of ‘remote_buf’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:639:1: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:646:5: call_function: calling ‘check_usage_n_stuff’ from ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:646:5: return_function: returning to ‘main’ from ‘check_usage_n_stuff’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:648:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:652:21: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:652:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:657:9: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:657:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: call_function: calling ‘initialize’ from ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: return_function: returning to ‘main’ from ‘initialize’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:672:9: throw: if ‘gx_remote_open’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:672:9: danger: ‘remote_buf’ leaks here; was allocated at [(27)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/26)
#  670|       /* we have the guest paused at this point, ready for debug. wait for
#  671|        * connection from remote gdb */
#  672|->     if (gx_remote_open(argv[4]) == -1) {
#  673|           xg_detach_deinit();
#  674|           return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def461]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:673:9: warning[-Wanalyzer-malloc-leak]: leak of ‘remote_buf’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:639:1: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:646:5: call_function: calling ‘check_usage_n_stuff’ from ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:646:5: return_function: returning to ‘main’ from ‘check_usage_n_stuff’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:648:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:652:21: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:652:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:657:9: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:657:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: call_function: calling ‘initialize’ from ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: return_function: returning to ‘main’ from ‘initialize’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:672:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:673:9: branch_true: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:673:9: throw: if ‘xg_detach_deinit’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:673:9: danger: ‘remote_buf’ leaks here; was allocated at [(27)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/26)
#  671|        * connection from remote gdb */
#  672|       if (gx_remote_open(argv[4]) == -1) {
#  673|->         xg_detach_deinit();
#  674|           return 1;
#  675|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def462]
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:678:11: warning[-Wanalyzer-malloc-leak]: leak of ‘remote_buf’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:639:1: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:646:5: call_function: calling ‘check_usage_n_stuff’ from ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:646:5: return_function: returning to ‘main’ from ‘check_usage_n_stuff’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:648:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:652:21: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:652:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:657:9: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:657:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: call_function: calling ‘initialize’ from ‘main’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:668:5: return_function: returning to ‘main’ from ‘initialize’
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:672:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:672:8: branch_false: ...to here
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:678:11: throw: if ‘gx_getpkt’ throws an exception...
xen-4.20.2/tools/debugger/gdbsx/gx/gx_main.c:678:11: danger: ‘remote_buf’ leaks here; was allocated at [(27)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/26)
#  676|   
#  677|       /* we've a gdb connection at this point, process requests */
#  678|->     while(gx_getpkt(remote_buf) > 0) {
#  679|           if ((exit_rc=process_remote_request(remote_buf)))
#  680|               break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def463]
xen-4.20.2/tools/debugger/kdd/kdd-xen.c:582:11: warning[-Wanalyzer-malloc-leak]: leak of ‘g’
xen-4.20.2/tools/debugger/kdd/kdd-xen.c:575:9: acquire_memory: allocated here
xen-4.20.2/tools/debugger/kdd/kdd-xen.c:576:8: branch_false: following ‘false’ branch (when ‘g’ is non-NULL)...
xen-4.20.2/tools/debugger/kdd/kdd-xen.c:578:5: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd-xen.c:582:11: throw: if ‘xc_interface_open’ throws an exception...
xen-4.20.2/tools/debugger/kdd/kdd-xen.c:582:11: danger: ‘g’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  580|       g->xc_log.vmessage = kdd_xc_log;
#  581|   
#  582|->     xch = xc_interface_open(&g->xc_log, NULL, 0);
#  583|       if (!xch)
#  584|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def464]
xen-4.20.2/tools/debugger/kdd/kdd.c:806:5: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/debugger/kdd/kdd.c:1352:5: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:8: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1369:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1370:12: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: call_function: calling ‘kdd_init’ from ‘main’
#  804|   {
#  805|       uint16_t ilen;
#  806|->     KDD_LOG(s, "Break\n");
#  807|   
#  808|       if (s->running)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def465]
xen-4.20.2/tools/debugger/kdd/kdd.c:809:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/debugger/kdd/kdd.c:1352:5: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:8: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1369:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1370:12: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: call_function: calling ‘kdd_init’ from ‘main’
#  807|   
#  808|       if (s->running)
#  809|->         kdd_halt(s->guest);
#  810|       s->running = 0;
#  811|   

Error: CPPCHECK_WARNING (CWE-823): [#def466]
xen-4.20.2/tools/debugger/kdd/kdd.c:816: error[arrayIndexOutOfBounds]: Array 's->txb[56]' accessed at index 271, which is out of bounds.
#  814|           /* XXX debug pattern */
#  815|           for (i = 0; i < 0x100 ; i++) 
#  816|->             s->txb[sizeof (kdd_hdr) + i] = i;
#  817|       }
#  818|   

Error: GCC_ANALYZER_WARNING (CWE-787): [#def467]
xen-4.20.2/tools/debugger/kdd/kdd.c:1079:5: warning[-Wanalyzer-out-of-bounds]: buffer over-read
xen-4.20.2/tools/debugger/kdd/kdd.c:1278:6: enter_function: entry to ‘kdd_select_callback’
xen-4.20.2/tools/debugger/kdd/kdd.c:1304:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1309:9: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1318:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1320:9: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1320:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1327:8: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1327:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1328:9: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1329:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1330:13: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1330:13: call_function: calling ‘kdd_handle_pkt’ from ‘kdd_select_callback’
# 1077|       uint8_t *buf;
# 1078|   
# 1079|->     KDD_LOG(s, "Memory access \"%c%c\" (%s): %"PRIu32" bytes"
# 1080|               " @ 0x%"PRIx64"\n", 
# 1081|               s->rxp.cmd.subtype & 0xff, (s->rxp.cmd.subtype >>8) & 0xff, 

Error: GCC_ANALYZER_WARNING (CWE-401): [#def468]
xen-4.20.2/tools/debugger/kdd/kdd.c:1231:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/debugger/kdd/kdd.c:1219:9: acquire_memory: allocated here
xen-4.20.2/tools/debugger/kdd/kdd.c:1220:8: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1225:5: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1230:8: branch_true: following ‘true’ branch (when ‘fd < 0’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1231:9: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1231:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1231:9: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1231:9: throw: if ‘fflush’ throws an exception...
xen-4.20.2/tools/debugger/kdd/kdd.c:1231:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1229|       fd = socket(PF_INET, SOCK_STREAM, 0);
# 1230|       if (fd < 0) {
# 1231|->         KDD_LOG(s, "Could not open a socket for kdd: %s\n", 
# 1232|                   strerror(errno));
# 1233|           goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def469]
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/debugger/kdd/kdd.c:1220:8: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1225:5: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1229:10: acquire_resource: stream socket created here
xen-4.20.2/tools/debugger/kdd/kdd.c:1230:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1230:8: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1239:13: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: throw: if ‘fflush’ throws an exception...
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: danger: ‘fd’ leaks here
# 1243|               goto again;
# 1244|           }
# 1245|->         KDD_LOG(s, "Could not connect TCP stream for kdd: %s\n",
# 1246|                   strerror(errno));
# 1247|           goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def470]
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/debugger/kdd/kdd.c:1219:9: acquire_memory: allocated here
xen-4.20.2/tools/debugger/kdd/kdd.c:1220:8: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1225:5: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1230:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1230:8: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1239:13: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: branch_true: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: throw: if ‘fflush’ throws an exception...
xen-4.20.2/tools/debugger/kdd/kdd.c:1245:9: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1243|               goto again;
# 1244|           }
# 1245|->         KDD_LOG(s, "Could not connect TCP stream for kdd: %s\n",
# 1246|                   strerror(errno));
# 1247|           goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def471]
xen-4.20.2/tools/debugger/kdd/kdd.c:1261:5: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/debugger/kdd/kdd.c:1352:5: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:8: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1369:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1370:12: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: call_function: calling ‘kdd_init’ from ‘main’
# 1259|   
# 1260|       *sp = s;
# 1261|->     KDD_LOG(s, "KDD starts\n");
# 1262|   
# 1263|       kdd_break(s);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def472]
xen-4.20.2/tools/debugger/kdd/kdd.c:1269:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/debugger/kdd/kdd.c:1352:5: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:8: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1369:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1370:12: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: call_function: calling ‘kdd_init’ from ‘main’
# 1267|    fail:
# 1268|       if (fd >= 0)
# 1269|->         close(fd);
# 1270|       free(s);
# 1271|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def473]
xen-4.20.2/tools/debugger/kdd/kdd.c:1269:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/debugger/kdd/kdd.c:1352:5: enter_function: entry to ‘main’
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:8: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/tools/debugger/kdd/kdd.c:1369:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1370:12: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1368:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: branch_false: ...to here
xen-4.20.2/tools/debugger/kdd/kdd.c:1371:18: call_function: calling ‘kdd_init’ from ‘main’
# 1267|    fail:
# 1268|       if (fd >= 0)
# 1269|->         close(fd);
# 1270|       free(s);
# 1271|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def474]
xen-4.20.2/tools/firmware/hvmloader/hvmloader.c:331:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  329|   
#  330|       printf("HVM Loader\n");
#  331|->     BUG_ON(hvm_start_info->magic != XEN_HVM_START_MAGIC_VALUE);
#  332|   
#  333|       init_hypercalls();

Error: GCC_ANALYZER_WARNING (CWE-686): [#def475]
xen-4.20.2/tools/firmware/hvmloader/util.c:511:17: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘long unsigned int’ but received ‘char (*)[7]’ for variadic argument 1 of ‘ap’
xen-4.20.2/tools/firmware/hvmloader/util.c:698:21: enter_function: entry to ‘get_shared_info’
xen-4.20.2/tools/firmware/hvmloader/util.c:712:9: call_function: calling ‘__bug’ from ‘get_shared_info’
#  509|               if ( lflag )
#  510|               {
#  511|->                 value = va_arg(ap, unsigned long);
#  512|                   if ( (c == 'd') && ((long)value < 0) )
#  513|                   {

Error: GCC_ANALYZER_WARNING (CWE-685): [#def476]
xen-4.20.2/tools/firmware/hvmloader/util.c:511:17: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed)
xen-4.20.2/tools/firmware/hvmloader/util.c:681:24: enter_function: entry to ‘get_hvm_info_table’
xen-4.20.2/tools/firmware/hvmloader/util.c:691:5: call_function: calling ‘validate_hvm_info’ from ‘get_hvm_info_table’
#  509|               if ( lflag )
#  510|               {
#  511|->                 value = va_arg(ap, unsigned long);
#  512|                   if ( (c == 'd') && ((long)value < 0) )
#  513|                   {

Error: GCC_ANALYZER_WARNING (CWE-686): [#def477]
xen-4.20.2/tools/firmware/hvmloader/util.c:520:17: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘long unsigned int’ but received ‘char (*)[7]’ for variadic argument 1 of ‘ap’
xen-4.20.2/tools/firmware/hvmloader/util.c:698:21: enter_function: entry to ‘get_shared_info’
xen-4.20.2/tools/firmware/hvmloader/util.c:712:9: call_function: calling ‘__bug’ from ‘get_shared_info’
#  518|               else
#  519|               {
#  520|->                 value = va_arg(ap, unsigned int);
#  521|                   if ( (c == 'd') && ((int)value < 0) )
#  522|                   {

Error: GCC_ANALYZER_WARNING (CWE-685): [#def478]
xen-4.20.2/tools/firmware/hvmloader/util.c:520:17: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed)
xen-4.20.2/tools/firmware/hvmloader/util.c:681:24: enter_function: entry to ‘get_hvm_info_table’
xen-4.20.2/tools/firmware/hvmloader/util.c:691:5: call_function: calling ‘validate_hvm_info’ from ‘get_hvm_info_table’
#  518|               else
#  519|               {
#  520|->                 value = va_arg(ap, unsigned int);
#  521|                   if ( (c == 'd') && ((int)value < 0) )
#  522|                   {

Error: GCC_ANALYZER_WARNING (CWE-685): [#def479]
xen-4.20.2/tools/firmware/hvmloader/util.c:543:13: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed)
xen-4.20.2/tools/firmware/hvmloader/util.c:681:24: enter_function: entry to ‘get_hvm_info_table’
xen-4.20.2/tools/firmware/hvmloader/util.c:691:5: call_function: calling ‘validate_hvm_info’ from ‘get_hvm_info_table’
#  541|           else if ( c == 's' )
#  542|           {
#  543|->             str = va_arg(ap, char *);
#  544|               slen = strlen(str);
#  545|               if ( nflag == 0 )

Error: GCC_ANALYZER_WARNING (CWE-686): [#def480]
xen-4.20.2/tools/firmware/hvmloader/util.c:556:23: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘int’ but received ‘char (*)[7]’ for variadic argument 1 of ‘ap’
xen-4.20.2/tools/firmware/hvmloader/util.c:698:21: enter_function: entry to ‘get_shared_info’
xen-4.20.2/tools/firmware/hvmloader/util.c:712:9: call_function: calling ‘__bug’ from ‘get_shared_info’
#  554|           else if ( c == 'c' )
#  555|           {
#  556|->             emit(arg, va_arg(ap, int));
#  557|           }
#  558|           else

Error: GCC_ANALYZER_WARNING (CWE-685): [#def481]
xen-4.20.2/tools/firmware/hvmloader/util.c:556:23: warning[-Wanalyzer-va-list-exhausted]: ‘ap’ has no more arguments (0 consumed)
xen-4.20.2/tools/firmware/hvmloader/util.c:681:24: enter_function: entry to ‘get_hvm_info_table’
xen-4.20.2/tools/firmware/hvmloader/util.c:691:5: call_function: calling ‘validate_hvm_info’ from ‘get_hvm_info_table’
#  554|           else if ( c == 'c' )
#  555|           {
#  556|->             emit(arg, va_arg(ap, int));
#  557|           }
#  558|           else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def482]
xen-4.20.2/tools/firmware/hvmloader/xenbus.c:124:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data + done’
xen-4.20.2/tools/firmware/hvmloader/xenbus.c:176:13: enter_function: entry to ‘xenbus_send’
xen-4.20.2/tools/firmware/hvmloader/xenbus.c:188:5: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/hvmloader/xenbus.c:191:5: branch_false: ...to here
xen-4.20.2/tools/firmware/hvmloader/xenbus.c:209:5: call_function: inlined call to ‘ring_write’ from ‘xenbus_send’
#  122|               part = len;
#  123|   
#  124|->         memcpy(rings->req + MASK_XENSTORE_IDX(rings->req_prod),
#  125|                  data + done, part);
#  126|           barrier(); /* = wmb before prod write, rmb before next cons read */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def483]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:192:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:176:6: enter_function: entry to ‘unmap_domain_page’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:184:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:189:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:189:9: call_function: calling ‘mapcache_current_vcpu’ from ‘unmap_domain_page’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:189:9: return_function: return of NULL to ‘unmap_domain_page’ from ‘mapcache_current_vcpu’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/domain_page.c:192:15: danger: dereference of NULL ‘v’
#  190|       ASSERT(v && is_pv_vcpu(v));
#  191|   
#  192|->     dcache = &v->domain->arch.pv.mapcache;
#  193|       ASSERT(dcache->inuse);
#  194|   

Error: GCC_ANALYZER_WARNING (CWE-469): [#def484]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/extable.c:55:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/extable.c:59:13: enter_function: entry to ‘sort_exception_tables’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/extable.c:61:5: call_function: calling ‘sort_exception_table’ from ‘sort_exception_tables’
#   53|                                    const struct exception_table_entry *stop)
#   54|   {
#   55|->     sort(start, stop - start,
#   56|            sizeof(struct exception_table_entry), cmp_ex, swap_ex);
#   57|   }

Error: GCC_ANALYZER_WARNING (CWE-469): [#def485]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/extable.c:76:21: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/extable.c:220:26: enter_function: entry to ‘search_pre_exception_table’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/extable.c:223:27: call_function: calling ‘search_one_extable’ from ‘search_pre_exception_table’
#   74|       while ( first <= last )
#   75|       {
#   76|->         mid = (last - first) / 2 + first;
#   77|           diff = ex_addr(mid) - value;
#   78|           if (diff == 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def486]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/include/asm/shared.h:81:1: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/traps.c:131:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/traps.c:133:10: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/traps.c:145:28: call_function: inlined call to ‘arch_get_cr2’ from ‘show_registers’
#   79|   GET_SET_SHARED(unsigned long, nmi_reason)
#   80|   
#   81|-> GET_SET_VCPU(unsigned long, cr2)
#   82|   
#   83|   #undef GET_SET_VCPU

Error: GCC_ANALYZER_WARNING (CWE-121): [#def487]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/include/asm/uaccess.h:310:13: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:678:21: enter_function: entry to ‘rep_outs’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:693:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:696:10: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:696:10: call_function: calling ‘read_segment’ from ‘rep_outs’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:696:10: return_function: returning to ‘rep_outs’ from ‘read_segment’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:697:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:700:10: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:702:10: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:702:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:703:12: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:713:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:715:22: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:718:14: call_function: calling ‘pv_emul_virt_to_linear’ from ‘rep_outs’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:718:14: return_function: returning to ‘rep_outs’ from ‘pv_emul_virt_to_linear’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:720:12: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/pv/emul-priv-op.c:723:20: branch_false: ...to here
#  308|               return ret;
#  309|           case 8:
#  310|->             get_guest_size(*(uint64_t *)to, from, 8, ret, 8);
#  311|               return ret;
#  312|           }

Error: GCC_ANALYZER_WARNING (CWE-469): [#def488]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:586:5: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#  584|        * This includes a snapshot of the current stack.
#  585|        */
#  586|->     memcpy(__va(__pa(_start)), _start, _end - _start);
#  587|   
#  588|       /*

Error: GCC_ANALYZER_WARNING (CWE-469): [#def489]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1443:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1066:33: enter_function: entry to ‘__start_xen’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1118:14: call_function: calling ‘multiboot_fill_boot_info’ from ‘__start_xen’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1118:14: return_function: returning to ‘__start_xen’ from ‘multiboot_fill_boot_info’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1138:8: branch_false: following ‘false’ branch (when ‘kextra’ is NULL)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1150:5: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1246:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1250:8: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1431:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1442:22: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/setup.c:1443:22: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
# 1441|            */
# 1442|           xen->start = virt_to_maddr(_stext);
# 1443|->         xen->size  = __2M_rwdata_end - _stext;
# 1444|       }
# 1445|   

Error: GCC_ANALYZER_WARNING (CWE-469): [#def490]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/mm.c:727:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/mm.c:717:13: enter_function: entry to ‘zap_low_mappings’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/mm.c:719:5: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/mm.c:722:5: call_function: inlined call to ‘write_u64_atomic’ from ‘zap_low_mappings’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/arch/x86/x86_64/mm.c:727:22: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
#  725|       /* Replace with mapping of the boot trampoline only. */
#  726|       map_pages_to_xen(trampoline_phys, maddr_to_mfn(trampoline_phys),
#  727|->                      PFN_UP(trampoline_end - trampoline_start),
#  728|                        __PAGE_HYPERVISOR_RX);
#  729|   }

Error: GCC_ANALYZER_WARNING (CWE-1335): [#def491]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:140:55: warning[-Wanalyzer-shift-count-overflow]: shift by count (‘32’) >= precision of type (‘32’)
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:518:19: enter_function: entry to ‘read_bunzip’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:524:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:528:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:536:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:605:20: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/bunzip2.c:605:20: call_function: calling ‘get_next_block’ from ‘read_bunzip’
#  138|   	/* Calculate result */
#  139|   	bd->inbufBitCount -= bits_wanted;
#  140|-> 	bits |= (bd->inbufBits >> bd->inbufBitCount)&((1 << bits_wanted)-1);
#  141|   
#  142|   	return bits;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def492]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/domain.c:753:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘config’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/domain.c:887:13: enter_function: entry to ‘setup_system_domains’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/domain.c:896:15: call_function: calling ‘domain_create’ from ‘setup_system_domains’
#  751|       {
#  752|           err = -ENOMEM;
#  753|->         d->vcpu = xzalloc_array(struct vcpu *, config->max_vcpus);
#  754|           if ( !d->vcpu )
#  755|               goto fail;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def493]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/domain.c:813:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘config’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/domain.c:887:13: enter_function: entry to ‘setup_system_domains’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/domain.c:896:15: call_function: calling ‘domain_create’ from ‘setup_system_domains’
#  811|       atomic_inc(&d->pause_count);
#  812|   
#  813|->     if ( (err = evtchn_init(d, config->max_evtchn_port)) != 0 )
#  814|           goto fail;
#  815|       init_status |= INIT_evtchn;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def494]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:194:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch (when ‘i < count’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#argument 1 of ‘__builtin_strcmp’ must be non-null
#  192|           break;
#  193|       case XEN_ELFNOTE_PAE_MODE:
#  194|->         if ( !strcmp(str, "yes") )
#  195|               parms->pae = XEN_PAE_EXTCR3;
#  196|           if ( strstr(str, "bimodal") )

Error: GCC_ANALYZER_WARNING (CWE-688): [#def495]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:200:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch (when ‘i < count’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#argument 1 of ‘__builtin_strcmp’ must be non-null
#  198|           break;
#  199|       case XEN_ELFNOTE_BSD_SYMTAB:
#  200|->         if ( !strcmp(str, "yes") )
#  201|               parms->bsd_symtab = 1;
#  202|           break;

Error: GCC_ANALYZER_WARNING (CWE-469): [#def496]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/percpu.c:37:35: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/percpu.c:32:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/percpu.c:37:35: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/percpu.c:37:35: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
#   35|                  : -EBUSY;
#   36|   
#   37|->     if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
#   38|           return -ENOMEM;
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-469): [#def497]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/percpu.c:58:27: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#   56|       char *p = __per_cpu_start + __per_cpu_offset[cpu];
#   57|   
#   58|->     free_xenheap_pages(p, PERCPU_ORDER);
#   59|       __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
#   60|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def498]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:152:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:388:21: enter_function: entry to ‘merge’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:392:12: call_function: calling ‘rangeset_add_range’ from ‘merge’
#  150|           {
#  151|               x = first_range(r);
#  152|->             x->s = s;
#  153|           }
#  154|           else if ( (x->e < s) && ((x->e + 1) != s) )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def499]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:152:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘x’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:395:5: enter_function: entry to ‘rangeset_merge’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:397:12: call_function: calling ‘rangeset_report_ranges’ from ‘rangeset_merge’
#  150|           {
#  151|               x = first_range(r);
#  152|->             x->s = s;
#  153|           }
#  154|           else if ( (x->e < s) && ((x->e + 1) != s) )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def500]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:157:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:395:5: enter_function: entry to ‘rangeset_merge’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:397:12: call_function: calling ‘rangeset_report_ranges’ from ‘rangeset_merge’
#  155|           {
#  156|               x = next_range(r, x);
#  157|->             x->s = s;
#  158|           }
#  159|           

Error: GCC_ANALYZER_WARNING (CWE-476): [#def501]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:157:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘x’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:388:21: enter_function: entry to ‘merge’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:392:12: call_function: calling ‘rangeset_add_range’ from ‘merge’
#  155|           {
#  156|               x = next_range(r, x);
#  157|->             x->s = s;
#  158|           }
#  159|           

Error: GCC_ANALYZER_WARNING (CWE-476): [#def502]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:160:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘x’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:388:21: enter_function: entry to ‘merge’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/common/rangeset.c:392:12: call_function: calling ‘rangeset_add_range’ from ‘merge’
#  158|           }
#  159|           
#  160|->         x->e = (y->e > e) ? y->e : e;
#  161|   
#  162|           for ( ; ; )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def503]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1534:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pdev’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1514:12: enter_function: entry to ‘assign_device’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1520:11: call_function: inlined call to ‘is_iommu_enabled’ from ‘assign_device’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1523:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1528:31: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1528:12: call_function: calling ‘pci_get_pdev’ from ‘assign_device’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1528:12: return_function: return of NULL to ‘assign_device’ from ‘pci_get_pdev’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/drivers/passthrough/pci.c:1534:10: danger: dereference of NULL ‘pdev’
# 1532|       /* Do not allow broken devices to be assigned to guests. */
# 1533|       rc = -EBADF;
# 1534|->     if ( pdev->broken && d != hardware_domain && d != dom_io )
# 1535|           goto done;
# 1536|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def504]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:92:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:114:6: enter_function: entry to ‘list_sort’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:124:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:127:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:132:16: branch_false: following ‘false’ branch (when ‘list’ is NULL)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:132:16: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:152:23: branch_false: following ‘false’ branch (when ‘lev >= max_lev’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:156:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:156:9: release_memory: ‘list’ is NULL
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/lib/list-sort.c:156:9: call_function: calling ‘merge_and_restore_back_links’ from ‘list_sort’
#   90|   			(*cmp)(priv, tail->next, tail->next);
#   91|   
#   92|-> 		tail->next->prev = tail;
#   93|   		tail = tail->next;
#   94|   	} while (tail->next);

Error: GCC_ANALYZER_WARNING (CWE-127): [#def505]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:327:30: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:385:5: enter_function: entry to ‘main’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:390:12: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:393:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:397:9: call_function: calling ‘xprintf’ from ‘main’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:397:9: return_function: returning to ‘main’ from ‘xprintf’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:399:15: call_function: calling ‘read_file’ from ‘main’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:399:15: return_function: returning to ‘main’ from ‘read_file’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/fixdep.c:400:9: call_function: calling ‘parse_dep_file’ from ‘main’
#  325|   		is_last = (*p == '\0');
#  326|   		/* Is the token we found a target name? */
#  327|-> 		is_target = (*(p-1) == ':');
#  328|   		/* Don't write any target names into the dependency file */
#  329|   		if (is_target) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def506]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:96:9: warning[-Wanalyzer-out-of-bounds]: buffer over-read
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:988:12: enter_function: entry to ‘conf_touch_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:1001:9: branch_true: following ‘true’ branch (when ‘i != 9973’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:1001:9: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:1043:27: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:1052:38: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/confdata.c:1052:23: call_function: calling ‘conf_touch_dep’ from ‘conf_touch_deps’
#   94|   	char *p;
#   95|   
#   96|-> 	strncpy(tmp, path, sizeof(tmp));
#   97|   	tmp[sizeof(tmp) - 1] = 0;
#   98|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def507]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:3643:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
# 3641|   	 * we need to put in 2 end-of-buffer characters.
# 3642|   	 */
# 3643|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 3644|   	if ( ! b->yy_ch_buf )
# 3645|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def508]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:3643:54: warning[-Wanalyzer-malloc-leak]: leak of ‘yy_create_buffer(zconf_fopen(*file.name), 16384)’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: return_function: returning to ‘zconf_nextfile’ from ‘yy_create_buffer’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_switch_to_buffer’ from ‘zconf_nextfile’
# 3641|   	 * we need to put in 2 end-of-buffer characters.
# 3642|   	 */
# 3643|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 3644|   	if ( ! b->yy_ch_buf )
# 3645|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-775): [#def509]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:3651:16: warning[-Wanalyzer-file-leak]: leak of FILE
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: return_function: returning to ‘zconf_nextfile’ from ‘yy_create_buffer’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_switch_to_buffer’ from ‘zconf_nextfile’
# 3649|   	yy_init_buffer( b, file );
# 3650|   
# 3651|-> 	return b;
# 3652|   }
# 3653|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def510]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:3651:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: return_function: returning to ‘zconf_nextfile’ from ‘yy_create_buffer’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_switch_to_buffer’ from ‘zconf_nextfile’
# 3649|   	yy_init_buffer( b, file );
# 3650|   
# 3651|-> 	return b;
# 3652|   }
# 3653|   

Error: CPPCHECK_WARNING (CWE-476): [#def511]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:3684: warning[nullPointer]: Possible null pointer dereference: b
# 3682|   	yy_flush_buffer( b );
# 3683|   
# 3684|-> 	b->yy_input_file = file;
# 3685|   	b->yy_fill_buffer = 1;
# 3686|   

Error: CPPCHECK_WARNING (CWE-476): [#def512]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/lexer.lex.c:3685: warning[nullPointer]: Possible null pointer dereference: b
# 3683|   
# 3684|   	b->yy_input_file = file;
# 3685|-> 	b->yy_fill_buffer = 1;
# 3686|   
# 3687|       /* If b is the current buffer, then yy_init_buffer was _probably_

Error: GCC_ANALYZER_WARNING (CWE-401): [#def513]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:851:1: warning[-Wanalyzer-malloc-leak]: leak of ‘res.s’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:840:13: enter_function: entry to ‘get_relations_str’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:843:27: call_function: calling ‘str_new’ from ‘get_relations_str’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:843:27: return_function: returning to ‘get_relations_str’ from ‘str_new’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:846:21: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:847:17: call_function: calling ‘get_symbol_str’ from ‘get_relations_str’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:847:17: return_function: returning to ‘get_relations_str’ from ‘get_symbol_str’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:846:21: branch_true: following ‘true’ branch (when ‘sym_arr’ is non-NULL)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:846:46: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:846:21: branch_false: following ‘false’ branch (when ‘sym’ is NULL)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:848:12: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:848:12: branch_false: following ‘false’ branch (when ‘i != 0’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:850:16: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/menu.c:851:1: danger: ‘res.s’ leaks here; was allocated at [(47)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/46)
#  849|   		str_append(&res, "No matches found.\n");
#  850|   	return res;
#  851|-> }
#  852|   
#  853|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def514]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1073:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘prop’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1071|   		}
# 1072|   		if (stack->sym == last_sym)
# 1073|-> 			fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
# 1074|   				prop->file->name, prop->lineno);
# 1075|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def515]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1080:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1078|   				menu->file->name, menu->lineno,
# 1079|   				sym->name ? sym->name : "<choice>",
# 1080|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1081|   		} else if (sym_is_choice_value(sym)) {
# 1082|   			fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def516]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1085:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1083|   				menu->file->name, menu->lineno,
# 1084|   				sym->name ? sym->name : "<choice>",
# 1085|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1086|   		} else if (stack->expr == &sym->dir_dep.expr) {
# 1087|   			fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def517]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1090:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1088|   				prop->file->name, prop->lineno,
# 1089|   				sym->name ? sym->name : "<choice>",
# 1090|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1091|   		} else if (stack->expr == &sym->rev_dep.expr) {
# 1092|   			fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def518]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1095:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1093|   				prop->file->name, prop->lineno,
# 1094|   				sym->name ? sym->name : "<choice>",
# 1095|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1096|   		} else if (stack->expr == &sym->implied.expr) {
# 1097|   			fprintf(stderr, "%s:%d:\tsymbol %s is implied by %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def519]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1100:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1098|   				prop->file->name, prop->lineno,
# 1099|   				sym->name ? sym->name : "<choice>",
# 1100|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1101|   		} else if (stack->expr) {
# 1102|   			fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def520]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1106:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1104|   				sym->name ? sym->name : "<choice>",
# 1105|   				prop_get_type_name(prop->type),
# 1106|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1107|   		} else {
# 1108|   			fprintf(stderr, "%s:%d:\tsymbol %s %s is visible depending on %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def521]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1112:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1110|   				sym->name ? sym->name : "<choice>",
# 1111|   				prop_get_type_name(prop->type),
# 1112|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1113|   		}
# 1114|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def522]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1218:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1254:13: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1254:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1257:13: call_function: inlined call to ‘sym_is_choice_value’ from ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1257:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1265:20: call_function: inlined call to ‘sym_is_choice’ from ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1265:19: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1266:24: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1266:24: call_function: calling ‘sym_check_choice_deps’ from ‘sym_check_deps’
# 1216|   
# 1217|   	prop = sym_get_choice_prop(choice);
# 1218|-> 	expr_list_for_each_sym(prop->expr, e, sym)
# 1219|   		sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
# 1220|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def523]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1254:13: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1254:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1257:13: call_function: inlined call to ‘sym_is_choice_value’ from ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1257:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1265:20: call_function: inlined call to ‘sym_is_choice’ from ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1265:19: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1266:24: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1266:24: call_function: calling ‘sym_check_choice_deps’ from ‘sym_check_deps’
# 1248|   	struct property *prop;
# 1249|   
# 1250|-> 	if (sym->flags & SYMBOL_CHECK) {
# 1251|   		sym_check_print_recursive(sym);
# 1252|   		return sym;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def524]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1300:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1298|   struct symbol *prop_get_symbol(struct property *prop)
# 1299|   {
# 1300|-> 	if (prop->expr && (prop->expr->type == E_SYMBOL ||
# 1301|   			   prop->expr->type == E_LIST))
# 1302|   		return prop->expr->left.sym;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def525]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:120:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘0’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:594:5: enter_function: entry to ‘main’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:624:19: branch_false: following ‘false’ branch (when ‘argc == 1’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:627:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:627:9: call_function: calling ‘read_map’ from ‘main’
#  118|   	     input_format == fmt_sysv && !*type && stype == '?' && sym &&
#  119|   	     sym[1] && strchr("cSsoh", sym[1]) && !sym[2])) {
#  120|-> 		free(filename);
#  121|   		filename = *str ? strdup(str) : NULL;
#  122|   		goto skip_tail;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def526]
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:175:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*s.sym’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:594:5: enter_function: entry to ‘main’
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:624:19: branch_false: following ‘false’ branch (when ‘argc == 1’)...
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:627:9: branch_false: ...to here
xen-4.20.2/tools/firmware/xen-dir/xen-root/xen/tools/symbols.c:627:9: call_function: calling ‘read_map’ from ‘main’
#  173|   		s->type = stype; /* As s->sym[0] ends mangled. */
#  174|   	}
#  175|-> 	s->sym[0] = stype;
#  176|   	rc = 0;
#  177|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def527]
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&buf, "r")’
xen-4.20.2/tools/flask/utils/label-pci.c:46:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/label-pci.c:49:12: branch_false: ...to here
xen-4.20.2/tools/flask/utils/label-pci.c:56:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/label-pci.c:64:9: branch_false: ...to here
xen-4.20.2/tools/flask/utils/label-pci.c:70:13: acquire_resource: opened here
xen-4.20.2/tools/flask/utils/label-pci.c:71:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: branch_false: ...to here
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: throw: if ‘xc_flask_add_device’ throws an exception...
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: danger: ‘fopen(&buf, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   76|   	}
#   77|   
#   78|-> 	ret = xc_flask_add_device(xch, sbdf, argv[2]);
#   79|   	if (ret) {
#   80|   		fprintf(stderr, "xc_flask_add_device: Unable to set context of PCI device %s (0x%x) to %s: %d\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def528]
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&buf, "r")’
xen-4.20.2/tools/flask/utils/label-pci.c:46:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/label-pci.c:49:12: branch_false: ...to here
xen-4.20.2/tools/flask/utils/label-pci.c:56:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/label-pci.c:64:9: branch_false: ...to here
xen-4.20.2/tools/flask/utils/label-pci.c:70:13: acquire_memory: allocated here
xen-4.20.2/tools/flask/utils/label-pci.c:71:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: branch_false: ...to here
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: throw: if ‘xc_flask_add_device’ throws an exception...
xen-4.20.2/tools/flask/utils/label-pci.c:78:15: danger: ‘fopen(&buf, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   76|   	}
#   77|   
#   78|-> 	ret = xc_flask_add_device(xch, sbdf, argv[2]);
#   79|   	if (ret) {
#   80|   		fprintf(stderr, "xc_flask_add_device: Unable to set context of PCI device %s (0x%x) to %s: %d\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def529]
xen-4.20.2/tools/flask/utils/loadpolicy.c:55:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(polFName, 0)’
xen-4.20.2/tools/flask/utils/loadpolicy.c:39:8: branch_false: following ‘false’ branch (when ‘argCnt == 2’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:42:5: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:43:13: acquire_resource: opened here
xen-4.20.2/tools/flask/utils/loadpolicy.c:44:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:52:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:53:8: branch_true: following ‘true’ branch (when ‘ret < 0’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:56:62: branch_true: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:112:8: branch_false: following ‘false’ branch (when ‘polMem’ is NULL)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:118:8: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:118:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:119:9: branch_true: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:55:9: danger: ‘open(polFName, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   53|       if ( ret < 0 )
#   54|       {
#   55|->         fprintf(stderr, "Error occurred retrieving information about"
#   56|                   "policy file '%s': %s\n", polFName, strerror(errno));
#   57|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def530]
xen-4.20.2/tools/flask/utils/loadpolicy.c:72:11: warning[-Wanalyzer-malloc-leak]: leak of ‘polMemCp’
xen-4.20.2/tools/flask/utils/loadpolicy.c:39:8: branch_false: following ‘false’ branch (when ‘argCnt == 2’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:42:5: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:44:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:52:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:53:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:60:23: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:60:16: acquire_memory: allocated here
xen-4.20.2/tools/flask/utils/loadpolicy.c:64:8: branch_false: following ‘false’ branch (when ‘polMem != 18446744073709551615’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:72:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:72:11: throw: if ‘xc_interface_open’ throws an exception...
xen-4.20.2/tools/flask/utils/loadpolicy.c:72:11: danger: ‘polMemCp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#   70|       }
#   71|   
#   72|->     xch = xc_interface_open(0,0,0);
#   73|       if ( !xch )
#   74|       {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def531]
xen-4.20.2/tools/flask/utils/loadpolicy.c:81:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘polMemCp’ where non-null expected
xen-4.20.2/tools/flask/utils/loadpolicy.c:39:8: branch_false: following ‘false’ branch (when ‘argCnt == 2’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:42:5: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:44:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:52:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:53:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:60:23: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:60:16: acquire_memory: this call could return NULL
xen-4.20.2/tools/flask/utils/loadpolicy.c:64:8: branch_false: following ‘false’ branch (when ‘polMem != 18446744073709551615’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:72:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:73:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:81:30: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:81:5: danger: argument 1 (‘polMemCp’) from [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
#   79|       }
#   80|   
#   81|->     memcpy(polMemCp, polMem, info.st_size);
#   82|   #else
#   83|       ret = read(polFd, polMemCp, info.st_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def532]
xen-4.20.2/tools/flask/utils/loadpolicy.c:96:11: warning[-Wanalyzer-malloc-leak]: leak of ‘polMemCp’
xen-4.20.2/tools/flask/utils/loadpolicy.c:39:8: branch_false: following ‘false’ branch (when ‘argCnt == 2’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:42:5: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:44:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:52:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:53:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:60:23: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:60:16: acquire_memory: allocated here
xen-4.20.2/tools/flask/utils/loadpolicy.c:64:8: branch_false: following ‘false’ branch (when ‘polMem != 18446744073709551615’)...
xen-4.20.2/tools/flask/utils/loadpolicy.c:72:11: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:73:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/flask/utils/loadpolicy.c:81:30: branch_false: ...to here
xen-4.20.2/tools/flask/utils/loadpolicy.c:96:11: throw: if ‘xc_flask_load’ throws an exception...
xen-4.20.2/tools/flask/utils/loadpolicy.c:96:11: danger: ‘polMemCp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#   94|   #endif
#   95|   
#   96|->     ret = xc_flask_load(xch, polMemCp, info.st_size);
#   97|       if ( ret < 0 )
#   98|       {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def533]
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:182:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  180|       {
#  181|       case XEN_ELFNOTE_LOADER:
#  182|->         safe_strcpy(parms->loader, str);
#  183|           break;
#  184|       case XEN_ELFNOTE_GUEST_OS:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def534]
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:185:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  183|           break;
#  184|       case XEN_ELFNOTE_GUEST_OS:
#  185|->         safe_strcpy(parms->guest_os, str);
#  186|           break;
#  187|       case XEN_ELFNOTE_GUEST_VERSION:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def535]
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:188:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  186|           break;
#  187|       case XEN_ELFNOTE_GUEST_VERSION:
#  188|->         safe_strcpy(parms->guest_ver, str);
#  189|           break;
#  190|       case XEN_ELFNOTE_XEN_VERSION:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def536]
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:191:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  189|           break;
#  190|       case XEN_ELFNOTE_XEN_VERSION:
#  191|->         safe_strcpy(parms->xen_ver, str);
#  192|           break;
#  193|       case XEN_ELFNOTE_PAE_MODE:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def537]
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:194:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  192|           break;
#  193|       case XEN_ELFNOTE_PAE_MODE:
#  194|->         if ( !strcmp(str, "yes") )
#  195|               parms->pae = XEN_PAE_EXTCR3;
#  196|           if ( strstr(str, "bimodal") )

Error: GCC_ANALYZER_WARNING (CWE-688): [#def538]
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:200:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  198|           break;
#  199|       case XEN_ELFNOTE_BSD_SYMTAB:
#  200|->         if ( !strcmp(str, "yes") )
#  201|               parms->bsd_symtab = 1;
#  202|           break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def539]
xen-4.20.2/tools/fuzz/libelf/libelf-loader.c:122:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/fuzz/libelf/libelf-loader.c:116:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/libelf/libelf-loader.c:118:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/libelf/libelf-loader.c:121:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/fuzz/libelf/libelf-loader.c:122:5: throw: if the called function throws an exception...
xen-4.20.2/tools/fuzz/libelf/libelf-loader.c:122:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  120|   
#  121|       va_start(al,fmt);
#  122|->     elf->log_callback(elf, elf->log_caller_data, iserr, fmt, al);
#  123|       va_end(al);
#  124|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def540]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: warning[-Wanalyzer-null-argument]: use of NULL ‘fp’ where non-null expected
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:31:12: branch_true: following ‘true’ branch (when ‘c == -1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:53:11: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: danger: argument 4 (‘fp’) NULL where non-null expected
#   92|   #endif
#   93|   
#   94|->         size = fread(input, 1, INPUT_SIZE, fp);
#   95|   
#   96|           if ( ferror(fp) )

Error: GCC_ANALYZER_WARNING (CWE-775): [#def541]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:98:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:31:12: branch_true: following ‘true’ branch (when ‘c == -1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:53:11: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:74:45: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:75:18: acquire_resource: opened here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:76:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:98:13: throw: if ‘perror’ throws an exception...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:98:13: danger: ‘fp’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#   96|           if ( ferror(fp) )
#   97|           {
#   98|->             perror("fread");
#   99|               exit(-1);
#  100|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def542]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:98:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:31:12: branch_true: following ‘true’ branch (when ‘c == -1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:53:11: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:74:45: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:75:18: acquire_memory: allocated here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:76:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:98:13: throw: if ‘perror’ throws an exception...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:98:13: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#   96|           if ( ferror(fp) )
#   97|           {
#   98|->             perror("fread");
#   99|               exit(-1);
#  100|           }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def543]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:31:12: branch_true: following ‘true’ branch (when ‘c == -1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:53:11: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:74:45: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:75:18: acquire_resource: opened here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:76:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:14: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: throw: if ‘LLVMFuzzerTestOneInput’ throws an exception...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: danger: ‘fp’ leaks here; was opened at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  103|           if ( feof(fp) )
#  104|           {
#  105|->             LLVMFuzzerTestOneInput(input, size);
#  106|           }
#  107|           else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def544]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:31:12: branch_true: following ‘true’ branch (when ‘c == -1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:53:11: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:74:45: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:75:18: acquire_memory: allocated here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:76:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:14: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: throw: if ‘LLVMFuzzerTestOneInput’ throws an exception...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  103|           if ( feof(fp) )
#  104|           {
#  105|->             LLVMFuzzerTestOneInput(input, size);
#  106|           }
#  107|           else

Error: GCC_ANALYZER_WARNING (CWE-910): [#def545]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:117:13: warning[-Wanalyzer-double-fclose]: double ‘fclose’ of FILE ‘fp’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:31:12: branch_true: following ‘true’ branch (when ‘c == -1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:53:11: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:61:8: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:14: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:105:13: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:115:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:117:13: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:69:21: branch_true: following ‘true’ branch (when ‘max > count’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:14: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:72:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:94:16: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:14: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:103:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:109:13: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:111:16: branch_false: following ‘false’ branch (when ‘max != 1’)...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:115:14: branch_false: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:115:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:117:13: branch_true: ...to here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/afl-harness.c:117:13: danger: second ‘fclose’ here
#  115|           if ( fp != stdin )
#  116|           {
#  117|->             fclose(fp);
#  118|               fp = NULL;
#  119|           }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def546]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:51:10: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:50:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:51:10: throw: if ‘__real_vprintf’ throws an exception...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:51:10: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   49|       emul_save_fpu_state();
#   50|       va_start(varg, fmt);
#   51|->     rc = __real_vprintf(fmt, varg);
#   52|       va_end(varg);
#   53|       emul_restore_fpu_state();

Error: GCC_ANALYZER_WARNING (CWE-404): [#def547]
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:87:10: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:86:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:87:10: throw: if ‘__real_vsnprintf’ throws an exception...
xen-4.20.2/tools/fuzz/x86_instruction_emulator/wrappers.c:87:10: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   85|       emul_save_fpu_state();
#   86|       va_start(varg, fmt);
#   87|->     rc = __real_vsnprintf(buf, n, fmt, varg);
#   88|       va_end(varg);
#   89|       emul_restore_fpu_state();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def548]
xen-4.20.2/tools/helpers/init-xenstore-domain.c:109:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/xen/xenbus_backend", 2)’
xen-4.20.2/tools/helpers/init-xenstore-domain.c:102:13: acquire_resource: opened here
xen-4.20.2/tools/helpers/init-xenstore-domain.c:103:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/helpers/init-xenstore-domain.c:109:10: branch_false: ...to here
xen-4.20.2/tools/helpers/init-xenstore-domain.c:119:11: throw: if ‘xc_dom_allocate’ throws an exception...
xen-4.20.2/tools/helpers/init-xenstore-domain.c:109:10: danger: ‘open("/dev/xen/xenbus_backend", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  107|       }
#  108|   
#  109|->     if ( flask )
#  110|       {
#  111|           rv = xc_flask_context_to_sid(xch, flask, strlen(flask), &config.ssidref);

Error: CPPCHECK_WARNING (CWE-758): [#def549]
xen-4.20.2/tools/libacpi/mk_dsdt.c:444: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  442|                   stmt("Name", "_ADR, %#06x0000", slot);
#  443|                   push_block("Method", "_EJ0,1"); {
#  444|->                     stmt("Store", "%#010x, B0EJ", 1 << slot);
#  445|                   } pop_block();
#  446|                   stmt("Name", "_SUN, %i", slot);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def550]
xen-4.20.2/tools/libfsimage/common/fsimage.c:57:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
xen-4.20.2/tools/libfsimage/common/fsimage.c:45:19: acquire_resource: opened here
xen-4.20.2/tools/libfsimage/common/fsimage.c:45:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:12: branch_false: following ‘false’ branch (when ‘fsi’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage.c:51:9: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:57:15: throw: if ‘find_plugin’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage.c:57:15: danger: ‘open(path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   55|   
#   56|   	pthread_mutex_lock(&fsi_lock);
#   57|-> 	err = find_plugin(fsi, path, options);
#   58|   	pthread_mutex_unlock(&fsi_lock);
#   59|   	if (err != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def551]
xen-4.20.2/tools/libfsimage/common/fsimage.c:57:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fsi’
xen-4.20.2/tools/libfsimage/common/fsimage.c:45:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:20: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:12: branch_false: following ‘false’ branch (when ‘fsi’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage.c:51:9: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:57:15: throw: if ‘find_plugin’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage.c:57:15: danger: ‘fsi’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   55|   
#   56|   	pthread_mutex_lock(&fsi_lock);
#   57|-> 	err = find_plugin(fsi, path, options);
#   58|   	pthread_mutex_unlock(&fsi_lock);
#   59|   	if (err != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def552]
xen-4.20.2/tools/libfsimage/common/fsimage.c:67:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
xen-4.20.2/tools/libfsimage/common/fsimage.c:45:19: acquire_resource: opened here
xen-4.20.2/tools/libfsimage/common/fsimage.c:45:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:48:12: branch_true: following ‘true’ branch (when ‘fsi’ is NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage.c:49:17: branch_true: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:66:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage.c:67:24: branch_true: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage.c:67:24: danger: ‘open(path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   65|   	err = errno;
#   66|   	if (fd != -1)
#   67|-> 		(void) close(fd);
#   68|   	free(fsi);
#   69|   	errno = err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def553]
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:62:20: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:54:34: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:56:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:59:9: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:62:20: throw: if ‘fsip_file_alloc’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:62:20: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   60|   	bcopy(fsig_fs_buf(fsi), data->ffd_buf, FSYS_BUFLEN);
#   61|   
#   62|-> 	if ((ffi = fsip_file_alloc(fsi, data)) == NULL) {
#   63|   		free(data);
#   64|   		return (NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def554]
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:62:20: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:263:1: enter_function: entry to ‘fsig_open’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:266:22: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:12: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: call_function: calling ‘fsig_file_alloc’ from ‘fsig_open’
#   60|   	bcopy(fsig_fs_buf(fsi), data->ffd_buf, FSYS_BUFLEN);
#   61|   
#   62|-> 	if ((ffi = fsip_file_alloc(fsi, data)) == NULL) {
#   63|   		free(data);
#   64|   		return (NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def555]
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:73:29: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:51:1: enter_function: entry to ‘fsig_file_alloc’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:54:34: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:56:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:59:9: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:60:15: call_function: calling ‘fsig_fs_buf’ from ‘fsig_file_alloc’
#   71|   fsig_fs_buf(fsi_t *fsi)
#   72|   {
#   73|-> 	fsig_data_t *data = fsip_fs_data(fsi);
#   74|   	return ((void *)data->fd_buf);
#   75|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def556]
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:73:29: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:263:1: enter_function: entry to ‘fsig_open’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:266:22: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:12: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: call_function: calling ‘fsig_file_alloc’ from ‘fsig_open’
#   71|   fsig_fs_buf(fsi_t *fsi)
#   72|   {
#   73|-> 	fsig_data_t *data = fsip_fs_data(fsi);
#   74|   	return ((void *)data->fd_buf);
#   75|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def557]
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:272:13: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:263:1: enter_function: entry to ‘fsig_open’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:266:22: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:12: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: call_function: calling ‘fsig_file_alloc’ from ‘fsig_open’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:36: return_function: returning to ‘fsig_open’ from ‘fsig_file_alloc’
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:269:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:272:13: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:272:13: throw: if the called function throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_grub.c:272:13: danger: ‘path’ leaks here; was allocated at [(2)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/1)
#  270|   		goto out;
#  271|   
#  272|-> 	if (ops->fpo_dir(ffi, path) == 0) {
#  273|   		fsip_file_free(ffi);
#  274|   		ffi = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def558]
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:107:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:90:28: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:92:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:95:9: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:97:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:102:16: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:104:12: branch_false: following ‘false’ branch (when ‘init’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:107:22: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:107:22: throw: if the called function throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:107:22: danger: ‘fp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  105|   		goto fail;
#  106|   
#  107|-> 	fp->fp_ops = init(FSIMAGE_PLUGIN_VERSION, fp, &fp->fp_name);
#  108|   	if (fp->fp_ops == NULL ||
#  109|   	    fp->fp_ops->fpo_version > FSIMAGE_PLUGIN_VERSION)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def559]
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:135:12: branch_false: following ‘false’ branch (when ‘name_max != 18446744073709551615’)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: throw: if ‘opendir’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: danger: ‘tmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  139|   		goto fail;
#  140|   
#  141|-> 	if ((dir = opendir(fsdir)) == NULL)
#  142|   		goto fail;
#  143|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def560]
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:146:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(fsdir)’
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:135:12: branch_false: following ‘false’ branch (when ‘name_max != 18446744073709551615’)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:12: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:146:22: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:146:22: danger: ‘opendir(fsdir)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  144|   	for (;;) {
#  145|   		errno = 0;
#  146|-> 		dp = readdir(dir);
#  147|   
#  148|   		if (dp == NULL && errno != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def561]
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:146:22: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:135:12: branch_false: following ‘false’ branch (when ‘name_max != 18446744073709551615’)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:12: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:146:22: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:146:22: danger: ‘tmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  144|   	for (;;) {
#  145|   		errno = 0;
#  146|-> 		dp = readdir(dir);
#  147|   
#  148|   		if (dp == NULL && errno != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def562]
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:171:24: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:135:12: branch_false: following ‘false’ branch (when ‘name_max != 18446744073709551615’)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:20: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:138:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:20: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:141:12: branch_false: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:170:12: branch_true: following ‘true’ branch (when ‘dir’ is non-NULL)...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:171:24: branch_true: ...to here
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:171:24: throw: if ‘closedir’ throws an exception...
xen-4.20.2/tools/libfsimage/common/fsimage_plugin.c:171:24: danger: ‘tmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  169|   	err = errno;
#  170|   	if (dir != NULL)
#  171|-> 		(void) closedir(dir);
#  172|   	free(tmp);
#  173|   	free(dp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def563]
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:44:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fs’
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:40:14: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:41:12: branch_false: following ‘false’ branch (when ‘fs’ is non-NULL)...
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:44:15: branch_false: ...to here
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:44:15: throw: if ‘ext2fs_open2’ throws an exception...
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:44:15: danger: ‘fs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   42|   		return (-1);
#   43|   
#   44|-> 	err = ext2fs_open2(name, opts, 0, 0, 0, unix_io_manager, fs);
#   45|   
#   46|   	if (err != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def564]
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:90:15: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:81:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:86:13: branch_false: ...to here
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:86:13: acquire_memory: allocated here
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:87:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:90:15: branch_false: ...to here
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:90:15: throw: if ‘ext2fs_file_open’ throws an exception...
xen-4.20.2/tools/libfsimage/ext2fs-lib/ext2fs-lib.c:90:15: danger: ‘f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   88|   		return (NULL);
#   89|   
#   90|-> 	err = ext2fs_file_open(*fs, ino, 0, f);
#   91|   
#   92|   	if (err != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def565]
xen-4.20.2/tools/libs/call/core.c:44:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xcall’
xen-4.20.2/tools/libs/call/core.c:36:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/call/core.c:39:8: branch_false: following ‘false’ branch (when ‘xcall’ is non-NULL)...
xen-4.20.2/tools/libs/call/core.c:41:5: branch_false: ...to here
xen-4.20.2/tools/libs/call/core.c:44:5: throw: if ‘xentoolcore__register_active_handle’ throws an exception...
xen-4.20.2/tools/libs/call/core.c:44:5: danger: ‘xcall’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   42|       xcall->buf_fd = -1;
#   43|       xcall->tc_ah.restrict_callback = all_restrict_cb;
#   44|->     xentoolcore__register_active_handle(&xcall->tc_ah);
#   45|   
#   46|       xcall->flags = open_flags;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def566]
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:104:20: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:77:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:83:13: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:83:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:83:13: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:84:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:89:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:97:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:100:12: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:100:12: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:101:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:104:20: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:104:20: throw: if ‘xc_cpumap_alloc’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:104:20: danger: ‘info’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  102|   	goto out;
#  103|   
#  104|->     info->cpumap = xc_cpumap_alloc(xch);
#  105|       if (!info->cpumap) {
#  106|           free(info);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def567]
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:116:5: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:77:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:83:13: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:83:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:83:13: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:84:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:89:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:97:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:100:12: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:100:12: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:101:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:104:20: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:105:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:110:24: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:116:5: throw: if ‘xc__hypercall_buffer_free’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_cpupool.c:116:5: danger: ‘info’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  114|   
#  115|   out:
#  116|->     xc_hypercall_buffer_free(xch, local);
#  117|   
#  118|       return info;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def568]
xen-4.20.2/tools/libs/ctrl/xc_foreign_memory.c:31:12: warning[-Wanalyzer-malloc-leak]: leak of ‘arr’
xen-4.20.2/tools/libs/ctrl/xc_foreign_memory.c:56:7: enter_function: entry to ‘xc_map_foreign_ranges’
xen-4.20.2/tools/libs/ctrl/xc_foreign_memory.c:71:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_foreign_memory.c:72:8: branch_false: following ‘false’ branch (when ‘arr’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_foreign_memory.c:72:8: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_foreign_memory.c:79:11: call_function: calling ‘xc_map_foreign_pages’ from ‘xc_map_foreign_ranges’
#   29|       }
#   30|   
#   31|->     return xenforeignmemory_map(xch->fmem, dom, prot, num, arr, NULL);
#   32|   }
#   33|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def569]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:26:10: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:67:14: enter_function: entry to ‘_gnttab_map_table’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:109:10: call_function: calling ‘xc_gnttab_op’ from ‘_gnttab_map_table’
#   24|       DECLARE_HYPERCALL_BOUNCE(op, count * op_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
#   25|   
#   26|->     if ( xc_hypercall_bounce_pre(xch, op) )
#   27|       {
#   28|           PERROR("Could not bounce buffer for grant table op hypercall");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def570]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:28:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:67:14: enter_function: entry to ‘_gnttab_map_table’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:109:10: call_function: calling ‘xc_gnttab_op’ from ‘_gnttab_map_table’
#   26|       if ( xc_hypercall_bounce_pre(xch, op) )
#   27|       {
#   28|->         PERROR("Could not bounce buffer for grant table op hypercall");
#   29|           goto out1;
#   30|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def571]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:32:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:67:14: enter_function: entry to ‘_gnttab_map_table’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:109:10: call_function: calling ‘xc_gnttab_op’ from ‘_gnttab_map_table’
#   30|       }
#   31|   
#   32|->     ret = xencall3(xch->xcall,  __HYPERVISOR_grant_table_op,
#   33|                      cmd, HYPERCALL_BUFFER_AS_ARG(op), count);
#   34|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def572]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:35:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:67:14: enter_function: entry to ‘_gnttab_map_table’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:109:10: call_function: calling ‘xc_gnttab_op’ from ‘_gnttab_map_table’
#   33|                      cmd, HYPERCALL_BUFFER_AS_ARG(op), count);
#   34|   
#   35|->     xc_hypercall_bounce_post(xch, op);
#   36|   
#   37|    out1:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def573]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:114:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:112:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:114:9: branch_true: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:114:9: throw: if ‘xc_report_error’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:114:9: danger: ‘pfn_list’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  112|       if ( rc || (setup.status != GNTST_okay) )
#  113|       {
#  114|->         ERROR("Could not get grant table frame list\n");
#  115|           goto err;
#  116|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def574]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:121:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:112:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:121:11: throw: if ‘xc_map_foreign_pages’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:121:11: danger: ‘pfn_list’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  119|           pfn_list[i] = frame_list[i];
#  120|   
#  121|->     gnt = xc_map_foreign_pages(xch, domid, PROT_READ, pfn_list,
#  122|                                  setup.nr_frames);
#  123|       if ( !gnt )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def575]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:125:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:112:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:123:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:125:9: branch_true: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:125:9: throw: if ‘xc_report_error’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:125:9: danger: ‘pfn_list’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  123|       if ( !gnt )
#  124|       {
#  125|->         ERROR("Could not map grant table\n");
#  126|           goto err;
#  127|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def576]
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:131:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_list’
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:76:8: branch_false: following ‘false’ branch (when ‘gnt_num’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:79:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:90:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:91:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:23: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:97:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:98:8: branch_false: following ‘false’ branch (when ‘pfn_list’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:104:5: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:131:9: throw: if ‘xc__hypercall_buffer_free’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_gnttab.c:131:9: danger: ‘pfn_list’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  129|   err:
#  130|       if ( frame_list )
#  131|->         xc_hypercall_buffer_free(xch, frame_list);
#  132|       free(pfn_list);
#  133|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def577]
xen-4.20.2/tools/libs/ctrl/xc_version.c:150:5: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
xen-4.20.2/tools/libs/ctrl/xc_version.c:135:14: enter_function: entry to ‘varbuf_simple_string’
xen-4.20.2/tools/libs/ctrl/xc_version.c:137:26: call_function: calling ‘varbuf_op’ from ‘varbuf_simple_string’
xen-4.20.2/tools/libs/ctrl/xc_version.c:137:26: return_function: returning to ‘varbuf_simple_string’ from ‘varbuf_op’
xen-4.20.2/tools/libs/ctrl/xc_version.c:140:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_version.c:143:18: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_version.c:143:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_version.c:144:8: branch_true: following ‘true’ branch (when ‘res’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_version.c:146:9: branch_true: ...to here
xen-4.20.2/tools/libs/ctrl/xc_version.c:150:5: throw: if ‘xencall_free_buffer’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_version.c:150:5: danger: ‘res’ leaks here; was allocated at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  148|       }
#  149|   
#  150|->     xencall_free_buffer(xch->xcall, hbuf);
#  151|   
#  152|       return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def578]
xen-4.20.2/tools/libs/ctrl/xc_version.c:203:5: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
xen-4.20.2/tools/libs/ctrl/xc_version.c:188:7: enter_function: entry to ‘xc_xenver_buildid’
xen-4.20.2/tools/libs/ctrl/xc_version.c:190:26: call_function: calling ‘varbuf_op’ from ‘xc_xenver_buildid’
xen-4.20.2/tools/libs/ctrl/xc_version.c:190:26: return_function: returning to ‘xc_xenver_buildid’ from ‘varbuf_op’
xen-4.20.2/tools/libs/ctrl/xc_version.c:193:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/ctrl/xc_version.c:196:19: branch_false: ...to here
xen-4.20.2/tools/libs/ctrl/xc_version.c:196:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/ctrl/xc_version.c:197:8: branch_true: following ‘true’ branch (when ‘res’ is non-NULL)...
xen-4.20.2/tools/libs/ctrl/xc_version.c:199:9: branch_true: ...to here
xen-4.20.2/tools/libs/ctrl/xc_version.c:199:9: call_function: calling ‘str2hex’ from ‘xc_xenver_buildid’
xen-4.20.2/tools/libs/ctrl/xc_version.c:199:9: return_function: returning to ‘xc_xenver_buildid’ from ‘str2hex’
xen-4.20.2/tools/libs/ctrl/xc_version.c:203:5: throw: if ‘xencall_free_buffer’ throws an exception...
xen-4.20.2/tools/libs/ctrl/xc_version.c:203:5: danger: ‘res’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  201|       }
#  202|   
#  203|->     xencall_free_buffer(xch->xcall, hbuf);
#  204|   
#  205|       return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def579]
xen-4.20.2/tools/libs/devicemodel/core.c:45:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dmod’
xen-4.20.2/tools/libs/devicemodel/core.c:37:35: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:40:8: branch_false: following ‘false’ branch (when ‘dmod’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:43:5: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:45:5: throw: if ‘xentoolcore__register_active_handle’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:45:5: danger: ‘dmod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   43|       dmod->fd = -1;
#   44|       dmod->tc_ah.restrict_callback = all_restrict_cb;
#   45|->     xentoolcore__register_active_handle(&dmod->tc_ah);
#   46|   
#   47|       dmod->flags = open_flags;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def580]
xen-4.20.2/tools/libs/devicemodel/core.c:107:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xcall_bufs’
xen-4.20.2/tools/libs/devicemodel/core.c:103:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:104:8: branch_false: following ‘false’ branch (when ‘xcall_bufs’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:107:49: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:107:15: throw: if ‘xencall_alloc_buffer’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:107:15: danger: ‘xcall_bufs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  105|           goto out;
#  106|   
#  107|->     op_bufs = xencall_alloc_buffer(dmod->xcall, sizeof(xen_dm_op_buf_t) *
#  108|                                      nr_bufs);
#  109|       if (op_bufs == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def581]
xen-4.20.2/tools/libs/devicemodel/core.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘xcall_bufs’
xen-4.20.2/tools/libs/devicemodel/core.c:103:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:104:8: branch_false: following ‘false’ branch (when ‘xcall_bufs’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:107:49: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:109:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/devicemodel/core.c:109:8: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:112:17: branch_true: following ‘true’ branch (when ‘i < nr_bufs’)...
xen-4.20.2/tools/libs/devicemodel/core.c:113:63: branch_true: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:113:25: throw: if ‘xencall_alloc_buffer’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:113:25: danger: ‘xcall_bufs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  111|   
#  112|       for (i = 0; i < nr_bufs; i++)  {
#  113|->         xcall_bufs[i] = xencall_alloc_buffer(dmod->xcall, bufs[i].size);
#  114|           if ( xcall_bufs[i] == NULL )
#  115|               goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def582]
xen-4.20.2/tools/libs/devicemodel/core.c:123:11: warning[-Wanalyzer-malloc-leak]: leak of ‘xcall_bufs’
xen-4.20.2/tools/libs/devicemodel/core.c:103:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:104:8: branch_false: following ‘false’ branch (when ‘xcall_bufs’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:107:49: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:109:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/devicemodel/core.c:109:8: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:112:17: branch_false: following ‘false’ branch (when ‘i >= nr_bufs’)...
xen-4.20.2/tools/libs/devicemodel/core.c:123:11: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:123:11: throw: if ‘xencall3’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:123:11: danger: ‘xcall_bufs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  121|       }
#  122|   
#  123|->     ret = xencall3(dmod->xcall, __HYPERVISOR_dm_op,
#  124|                      domid, nr_bufs, (unsigned long)op_bufs);
#  125|       if (ret < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def583]
xen-4.20.2/tools/libs/devicemodel/core.c:134:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcall_bufs’
xen-4.20.2/tools/libs/devicemodel/core.c:103:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:104:8: branch_false: following ‘false’ branch (when ‘xcall_bufs’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:107:49: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:133:21: branch_true: following ‘true’ branch (when ‘i < nr_bufs’)...
xen-4.20.2/tools/libs/devicemodel/core.c:134:56: branch_true: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:134:13: throw: if ‘xencall_free_buffer’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:134:13: danger: ‘xcall_bufs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  132|       if (xcall_bufs)
#  133|           for (i = 0; i < nr_bufs; i++)
#  134|->             xencall_free_buffer(dmod->xcall, xcall_bufs[i]);
#  135|   
#  136|       xencall_free_buffer(dmod->xcall, op_bufs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def584]
xen-4.20.2/tools/libs/devicemodel/core.c:136:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xcall_bufs’
xen-4.20.2/tools/libs/devicemodel/core.c:103:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:104:8: branch_false: following ‘false’ branch (when ‘xcall_bufs’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:107:49: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:136:5: throw: if ‘xencall_free_buffer’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:136:5: danger: ‘xcall_bufs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  134|               xencall_free_buffer(dmod->xcall, xcall_bufs[i]);
#  135|   
#  136|->     xencall_free_buffer(dmod->xcall, op_bufs);
#  137|       free(xcall_bufs);
#  138|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def585]
xen-4.20.2/tools/libs/devicemodel/core.c:161:11: warning[-Wanalyzer-malloc-leak]: leak of ‘bufs’
xen-4.20.2/tools/libs/devicemodel/core.c:150:12: acquire_memory: allocated here
xen-4.20.2/tools/libs/devicemodel/core.c:151:8: branch_false: following ‘false’ branch (when ‘bufs’ is non-NULL)...
xen-4.20.2/tools/libs/devicemodel/core.c:154:5: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:155:17: branch_false: following ‘false’ branch (when ‘i >= nr_bufs’)...
xen-4.20.2/tools/libs/devicemodel/core.c:159:5: branch_false: ...to here
xen-4.20.2/tools/libs/devicemodel/core.c:161:11: throw: if ‘osdep_xendevicemodel_op’ throws an exception...
xen-4.20.2/tools/libs/devicemodel/core.c:161:11: danger: ‘bufs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  159|       va_end(args);
#  160|   
#  161|->     ret = osdep_xendevicemodel_op(dmod, domid, nr_bufs, bufs);
#  162|   
#  163|       free(bufs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def586]
xen-4.20.2/tools/libs/evtchn/core.c:45:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xce’
xen-4.20.2/tools/libs/evtchn/core.c:35:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/evtchn/core.c:37:8: branch_false: following ‘false’ branch (when ‘xce’ is non-NULL)...
xen-4.20.2/tools/libs/evtchn/core.c:40:5: branch_false: ...to here
xen-4.20.2/tools/libs/evtchn/core.c:45:5: throw: if ‘xentoolcore__register_active_handle’ throws an exception...
xen-4.20.2/tools/libs/evtchn/core.c:45:5: danger: ‘xce’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   43|   
#   44|       xce->tc_ah.restrict_callback = all_restrict_cb;
#   45|->     xentoolcore__register_active_handle(&xce->tc_ah);
#   46|   
#   47|       if ( !xce->logger )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def587]
xen-4.20.2/tools/libs/foreignmemory/core.c:47:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fmem’
xen-4.20.2/tools/libs/foreignmemory/core.c:37:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/foreignmemory/core.c:40:8: branch_false: following ‘false’ branch (when ‘fmem’ is non-NULL)...
xen-4.20.2/tools/libs/foreignmemory/core.c:42:5: branch_false: ...to here
xen-4.20.2/tools/libs/foreignmemory/core.c:47:5: throw: if ‘xentoolcore__register_active_handle’ throws an exception...
xen-4.20.2/tools/libs/foreignmemory/core.c:47:5: danger: ‘fmem’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   45|   
#   46|       fmem->tc_ah.restrict_callback = all_restrict_cb;
#   47|->     xentoolcore__register_active_handle(&fmem->tc_ah);
#   48|   
#   49|       if (!fmem->logger) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def588]
xen-4.20.2/tools/libs/foreignmemory/core.c:97:11: warning[-Wanalyzer-malloc-leak]: leak of ‘err_to_free’
xen-4.20.2/tools/libs/foreignmemory/core.c:91:8: branch_true: following ‘true’ branch (when ‘err’ is NULL)...
xen-4.20.2/tools/libs/foreignmemory/core.c:92:36: branch_true: ...to here
xen-4.20.2/tools/libs/foreignmemory/core.c:92:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/foreignmemory/core.c:94:8: branch_false: following ‘false’ branch (when ‘err_to_free’ is non-NULL)...
xen-4.20.2/tools/libs/foreignmemory/core.c:97:11: branch_false: ...to here
xen-4.20.2/tools/libs/foreignmemory/core.c:97:11: throw: if ‘osdep_xenforeignmemory_map’ throws an exception...
xen-4.20.2/tools/libs/foreignmemory/core.c:97:11: danger: ‘err_to_free’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   95|           return NULL;
#   96|   
#   97|->     ret = osdep_xenforeignmemory_map(fmem, dom, addr, prot, flags, num, arr, err);
#   98|   
#   99|       if ( ret && err_to_free )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def589]
xen-4.20.2/tools/libs/foreignmemory/core.c:171:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fres’
xen-4.20.2/tools/libs/foreignmemory/core.c:149:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/foreignmemory/core.c:155:12: branch_false: ...to here
xen-4.20.2/tools/libs/foreignmemory/core.c:155:12: acquire_memory: allocated here
xen-4.20.2/tools/libs/foreignmemory/core.c:156:8: branch_false: following ‘false’ branch (when ‘fres’ is non-NULL)...
xen-4.20.2/tools/libs/foreignmemory/core.c:162:5: branch_false: ...to here
xen-4.20.2/tools/libs/foreignmemory/core.c:171:10: throw: if ‘osdep_xenforeignmemory_map_resource’ throws an exception...
xen-4.20.2/tools/libs/foreignmemory/core.c:171:10: danger: ‘fres’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  169|       fres->flags = flags;
#  170|   
#  171|->     rc = osdep_xenforeignmemory_map_resource(fmem, fres);
#  172|       if ( rc )
#  173|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def590]
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:39:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xgs’
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:27:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:30:8: branch_false: following ‘false’ branch (when ‘xgs’ is non-NULL)...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:32:5: branch_false: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:36:8: branch_true: following ‘true’ branch (when ‘logger’ is NULL)...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:39:13: branch_true: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:39:13: throw: if ‘xtl_createlogger_stdiostream’ throws an exception...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:39:13: danger: ‘xgs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   37|           xgs->logger = xgs->logger_tofree =
#   38|               (xentoollog_logger*)
#   39|->             xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
#   40|           if (!xgs->logger) goto err;
#   41|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def591]
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:43:10: warning[-Wanalyzer-malloc-leak]: leak of ‘xgs’
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:27:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:30:8: branch_false: following ‘false’ branch (when ‘xgs’ is non-NULL)...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:32:5: branch_false: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:36:8: branch_false: following ‘false’ branch (when ‘logger’ is non-NULL)...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:43:10: branch_false: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:43:10: throw: if ‘osdep_gntshr_open’ throws an exception...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:43:10: danger: ‘xgs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   41|       }
#   42|   
#   43|->     rc = osdep_gntshr_open(xgs);
#   44|       if ( rc  < 0 ) goto err;
#   45|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def592]
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:49:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xgs’
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:27:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:30:8: branch_false: following ‘false’ branch (when ‘xgs’ is non-NULL)...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:32:5: branch_false: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:36:8: branch_true: following ‘true’ branch (when ‘logger’ is NULL)...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:39:13: branch_true: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:40:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:40:9: branch_true: ...to here
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:49:5: throw: if ‘osdep_gntshr_close’ throws an exception...
xen-4.20.2/tools/libs/gnttab/gntshr_core.c:49:5: danger: ‘xgs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   47|   
#   48|   err:
#   49|->     osdep_gntshr_close(xgs);
#   50|       xtl_logger_destroy(xgs->logger_tofree);
#   51|       free(xgs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def593]
xen-4.20.2/tools/libs/gnttab/gnttab_core.c:43:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xgt’
xen-4.20.2/tools/libs/gnttab/gnttab_core.c:33:29: acquire_memory: allocated here
xen-4.20.2/tools/libs/gnttab/gnttab_core.c:36:8: branch_false: following ‘false’ branch (when ‘xgt’ is non-NULL)...
xen-4.20.2/tools/libs/gnttab/gnttab_core.c:38:5: branch_false: ...to here
xen-4.20.2/tools/libs/gnttab/gnttab_core.c:43:5: throw: if ‘xentoolcore__register_active_handle’ throws an exception...
xen-4.20.2/tools/libs/gnttab/gnttab_core.c:43:5: danger: ‘xgt’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   41|   
#   42|       xgt->tc_ah.restrict_callback = all_restrict_cb;
#   43|->     xentoolcore__register_active_handle(&xgt->tc_ah);
#   44|   
#   45|       if (!xgt->logger) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def594]
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
#   90|       if ( strings == NULL )
#   91|       {
#   92|->         PERROR("Could not allocate string table init");
#   93|           free(strtab);
#   94|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def595]
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:565:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_false: following ‘false’ branch (when ‘p2m_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:573:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:577:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
#   90|       if ( strings == NULL )
#   91|       {
#   92|->         PERROR("Could not allocate string table init");
#   93|           free(strtab);
#   94|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def596]
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:582:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
#   90|       if ( strings == NULL )
#   91|       {
#   92|->         PERROR("Could not allocate string table init");
#   93|           free(strtab);
#   94|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strtab’
xen-4.20.2/tools/libs/guest/xg_core.c:85:14: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:86:8: branch_false: following ‘false’ branch (when ‘strtab’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:89:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:90:8: branch_true: following ‘true’ branch (when ‘strings’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:92:9: danger: ‘strtab’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   90|       if ( strings == NULL )
#   91|       {
#   92|->         PERROR("Could not allocate string table init");
#   93|           free(strtab);
#   94|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def598]
xen-4.20.2/tools/libs/guest/xg_core.c:121:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:709:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:710:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
#  119|       if ( strtab->length > UINT16_MAX - len )
#  120|       {
#  121|->         PERROR("too long string table");
#  122|           errno = E2BIG;
#  123|           return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def599]
xen-4.20.2/tools/libs/guest/xg_core.c:121:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:582:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:709:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:710:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
#  119|       if ( strtab->length > UINT16_MAX - len )
#  120|       {
#  121|->         PERROR("too long string table");
#  122|           errno = E2BIG;
#  123|           return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def600]
xen-4.20.2/tools/libs/guest/xg_core.c:139:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:709:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:710:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
#  137|           if ( tmp == NULL )
#  138|           {
#  139|->             PERROR("Could not allocate string table");
#  140|               return ret;
#  141|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def601]
xen-4.20.2/tools/libs/guest/xg_core.c:139:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:582:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:709:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:710:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
#  137|           if ( tmp == NULL )
#  138|           {
#  139|->             PERROR("Could not allocate string table");
#  140|               return ret;
#  141|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def602]
xen-4.20.2/tools/libs/guest/xg_core.c:196:10: warning[-Wanalyzer-malloc-leak]: leak of ‘xc_core_shdr_init(xch)’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:196:10: danger: ‘xc_core_shdr_init(xch)’ leaks here; was allocated at [(32)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/31)
#  194|       Elf64_Shdr *shdr;
#  195|   
#  196|->     if ( sheaders->num == sheaders->num_max )
#  197|       {
#  198|           Elf64_Shdr *shdrs;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def603]
xen-4.20.2/tools/libs/guest/xg_core.c:196:10: warning[-Wanalyzer-malloc-leak]: leak of ‘xc_core_strtab_init(xch)’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:196:10: danger: ‘xc_core_strtab_init(xch)’ leaks here; was allocated at [(23)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/22)
#  194|       Elf64_Shdr *shdr;
#  195|   
#  196|->     if ( sheaders->num == sheaders->num_max )
#  197|       {
#  198|           Elf64_Shdr *shdrs;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def604]
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: throw: if ‘xc_domain_getinfo_single’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
#  470|       }
#  471|   
#  472|->     if ( xc_domain_getinfo_single(xch, domid, &info) < 0 )
#  473|       {
#  474|           PERROR("Could not get info for dom%u", domid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def605]
xen-4.20.2/tools/libs/guest/xg_core.c:474:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:474:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:474:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:474:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
#  472|       if ( xc_domain_getinfo_single(xch, domid, &info) < 0 )
#  473|       {
#  474|->         PERROR("Could not get info for dom%u", domid);
#  475|           goto out;
#  476|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
xen-4.20.2/tools/libs/guest/xg_core.c:478:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:478:19: throw: if ‘xc_map_foreign_range’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:478:19: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
#  476|       }
#  477|       /* Map the shared info frame */
#  478|->     live_shinfo = xc_map_foreign_range(xch, domid, PAGE_SIZE,
#  479|                                          PROT_READ, info.shared_info_frame);
#  480|       if ( !live_shinfo && !(info.flags & XEN_DOMINF_hvm_guest) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def607]
xen-4.20.2/tools/libs/guest/xg_core.c:482:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:482:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:482:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
#  480|       if ( !live_shinfo && !(info.flags & XEN_DOMINF_hvm_guest) )
#  481|       {
#  482|->         PERROR("Couldn't map live_shinfo");
#  483|           goto out;
#  484|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def608]
xen-4.20.2/tools/libs/guest/xg_core.c:490:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:487:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:490:14: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:14: throw: if ‘xc_domain_get_guest_width’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:490:14: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
#  488|   
#  489|       {
#  490|->         if ( xc_domain_get_guest_width(xch, domid, &dinfo->guest_width) != 0 )
#  491|           {
#  492|               PERROR("Could not get address size for domain");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def609]
xen-4.20.2/tools/libs/guest/xg_core.c:492:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:487:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:490:14: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:492:13: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:492:13: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:492:13: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
#  490|           if ( xc_domain_get_guest_width(xch, domid, &dinfo->guest_width) != 0 )
#  491|           {
#  492|->             PERROR("Could not get address size for domain");
#  493|               goto out;
#  494|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def610]
xen-4.20.2/tools/libs/guest/xg_core.c:524:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:521:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_true: following ‘true’ branch (when ‘ctxt’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:524:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:524:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:524:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/0)
#  522|       if ( !ctxt )
#  523|       {
#  524|->         PERROR("Could not allocate vcpu context array");
#  525|           goto out;
#  526|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def611]
xen-4.20.2/tools/libs/guest/xg_core.c:530:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctxt’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:521:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:521:12: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:530:14: throw: if ‘xc_vcpu_getcontext’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:530:14: danger: ‘ctxt’ leaks here; was allocated at [(7)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/6)
#  528|       for ( i = 0; i <= info.max_vcpu_id; i++ )
#  529|       {
#  530|->         if ( xc_vcpu_getcontext(xch, domid, i, &ctxt[nr_vcpus]) == 0 )
#  531|           {
#  532|               if ( xc_core_arch_context_get(&arch_ctxt, &ctxt[nr_vcpus],

Error: GCC_ANALYZER_WARNING (CWE-401): [#def612]
xen-4.20.2/tools/libs/guest/xg_core.c:530:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:521:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:530:14: throw: if ‘xc_vcpu_getcontext’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:530:14: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/0)
#  528|       for ( i = 0; i <= info.max_vcpu_id; i++ )
#  529|       {
#  530|->         if ( xc_vcpu_getcontext(xch, domid, i, &ctxt[nr_vcpus]) == 0 )
#  531|           {
#  532|               if ( xc_core_arch_context_get(&arch_ctxt, &ctxt[nr_vcpus],

Error: GCC_ANALYZER_WARNING (CWE-401): [#def613]
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctxt’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:521:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:521:12: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_true: following ‘true’ branch (when ‘nr_vcpus == 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: danger: ‘ctxt’ leaks here; was allocated at [(7)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/6)
#  538|       if ( nr_vcpus == 0 )
#  539|       {
#  540|->         PERROR("No VCPU context could be grabbed");
#  541|           goto out;
#  542|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def614]
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:490:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:521:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_true: following ‘true’ branch (when ‘nr_vcpus == 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:540:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
#  538|       if ( nr_vcpus == 0 )
#  539|       {
#  540|->         PERROR("No VCPU context could be grabbed");
#  541|           goto out;
#  542|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def615]
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: throw: if ‘xc_core_arch_memory_map_get’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
#  543|   
#  544|       /* obtain memory map */
#  545|->     sts = xc_core_arch_memory_map_get(xch, &arch_ctxt, &info,
#  546|                                         live_shinfo, &memory_map,
#  547|                                         &nr_memory_map);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def616]
xen-4.20.2/tools/libs/guest/xg_core.c:568:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_true: following ‘true’ branch (when ‘p2m_array’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:568:13: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:568:13: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:568:13: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/0)
#  566|           if ( p2m_array == NULL )
#  567|           {
#  568|->             PERROR("Could not allocate p2m array");
#  569|               goto out;
#  570|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def617]
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_false: following ‘false’ branch (when ‘p2m_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: throw: if ‘xc_core_arch_map_p2m’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/0)
#  570|           }
#  571|   
#  572|->         sts = xc_core_arch_map_p2m(xch, dinfo, &info, live_shinfo, &p2m);
#  573|           if ( sts != 0 )
#  574|               goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def618]
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_array’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:565:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_false: following ‘false’ branch (when ‘p2m_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: throw: if ‘xc_core_arch_map_p2m’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: danger: ‘p2m_array’ leaks here; was allocated at [(15)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/14)
#  570|           }
#  571|   
#  572|->         sts = xc_core_arch_map_p2m(xch, dinfo, &info, live_shinfo, &p2m);
#  573|           if ( sts != 0 )
#  574|               goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def619]
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_false: following ‘false’ branch (when ‘p2m_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:573:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: throw: if ‘xc_maximum_ram_page’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
#  574|               goto out;
#  575|   
#  576|->         sts = xc_maximum_ram_page(xch, &max_mfn);
#  577|           if ( sts != 0 )
#  578|               goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def620]
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_array’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:565:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_false: following ‘false’ branch (when ‘p2m_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:573:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: throw: if ‘xc_maximum_ram_page’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: danger: ‘p2m_array’ leaks here; was allocated at [(15)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/14)
#  574|               goto out;
#  575|   
#  576|->         sts = xc_maximum_ram_page(xch, &max_mfn);
#  577|           if ( sts != 0 )
#  578|               goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def621]
xen-4.20.2/tools/libs/guest/xg_core.c:585:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_true: following ‘true’ branch (when ‘pfn_array’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:585:13: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:585:13: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:585:13: danger: ‘dump_mem_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/0)
#  583|           if ( pfn_array == NULL )
#  584|           {
#  585|->             PERROR("Could not allocate pfn array");
#  586|               goto out;
#  587|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def622]
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(2)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/1)
#  595|       if ( strtab == NULL )
#  596|       {
#  597|->         PERROR("Could not allocate string table");
#  598|           goto out;
#  599|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def623]
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:565:28: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:565:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:566:12: branch_false: following ‘false’ branch (when ‘p2m_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:572:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:573:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:576:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:577:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: danger: ‘p2m_array’ leaks here; was allocated at [(16)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/15)
#  595|       if ( strtab == NULL )
#  596|       {
#  597|->         PERROR("Could not allocate string table");
#  598|           goto out;
#  599|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def624]
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:582:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:597:9: danger: ‘pfn_array’ leaks here; was allocated at [(16)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/15)
#  595|       if ( strtab == NULL )
#  596|       {
#  597|->         PERROR("Could not allocate string table");
#  598|           goto out;
#  599|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def625]
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: danger: ‘<unknown>’ leaks here; was allocated at [(22)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/21)
#  601|       if ( sheaders == NULL )
#  602|       {
#  603|->         PERROR("Could not allocate section headers");
#  604|           goto out;
#  605|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def626]
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(2)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/1)
#  601|       if ( sheaders == NULL )
#  602|       {
#  603|->         PERROR("Could not allocate section headers");
#  604|           goto out;
#  605|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def627]
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:582:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: danger: ‘pfn_array’ leaks here; was allocated at [(16)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/15)
#  601|       if ( sheaders == NULL )
#  602|       {
#  603|->         PERROR("Could not allocate section headers");
#  604|           goto out;
#  605|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def628]
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xc_core_strtab_init(xch)’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:603:9: danger: ‘xc_core_strtab_init(xch)’ leaks here; was allocated at [(20)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/19)
#  601|       if ( sheaders == NULL )
#  602|       {
#  603|->         PERROR("Could not allocate section headers");
#  604|           goto out;
#  605|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def629]
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: danger: ‘<unknown>’ leaks here; was allocated at [(114)](sarif:/runs/0/results/72/codeFlows/0/threadFlows/0/locations/113)
#  704|       if ( shdr == NULL )
#  705|       {
#  706|->         PERROR("could not get section headers for .xen_pages");
#  707|           goto out;
#  708|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def630]
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_mem_start’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:28: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: danger: ‘dump_mem_start’ leaks here; was allocated at [(2)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/1)
#  704|       if ( shdr == NULL )
#  705|       {
#  706|->         PERROR("could not get section headers for .xen_pages");
#  707|           goto out;
#  708|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def631]
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfn_array’
xen-4.20.2/tools/libs/guest/xg_core.c:422:1: enter_function: entry to ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:466:8: branch_false: following ‘false’ branch (when ‘dump_mem_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:472:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:472:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:479:51: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:480:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:485:31: call_function: inlined call to ‘xc_core_arch_auto_translated_physmap’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: following ‘false’ branch (when ‘ctxt’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:522:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:528:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:530:53: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:538:8: branch_false: following ‘false’ branch (when ‘nr_vcpus != 0’)...
xen-4.20.2/tools/libs/guest/xg_core.c:545:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:548:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:560:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:562:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:582:28: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:582:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_core.c:583:12: branch_false: following ‘false’ branch (when ‘pfn_array’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_core.c:591:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: call_function: calling ‘xc_core_strtab_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:594:14: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_strtab_init’
xen-4.20.2/tools/libs/guest/xg_core.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: call_function: calling ‘xc_core_shdr_init’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:600:16: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_init’
xen-4.20.2/tools/libs/guest/xg_core.c:601:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:607:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:608:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:615:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:616:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:621:25: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:625:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:637:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:638:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:643:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:650:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:651:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:656:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:657:11: call_function: inlined call to ‘xc_core_shdr_set’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:696:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:697:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: call_function: calling ‘xc_core_shdr_get’ from ‘xc_domain_dumpcore_via_callback’
xen-4.20.2/tools/libs/guest/xg_core.c:703:12: return_function: returning to ‘xc_domain_dumpcore_via_callback’ from ‘xc_core_shdr_get’
xen-4.20.2/tools/libs/guest/xg_core.c:704:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_core.c:706:9: danger: ‘pfn_array’ leaks here; was allocated at [(19)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/18)
#  704|       if ( shdr == NULL )
#  705|       {
#  706|->         PERROR("could not get section headers for .xen_pages");
#  707|           goto out;
#  708|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def632]
xen-4.20.2/tools/libs/guest/xg_core_x86.c:154:26: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:378:1: enter_function: entry to ‘xc_core_arch_map_p2m_writable’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:381:12: call_function: calling ‘xc_core_arch_map_p2m_rw’ from ‘xc_core_arch_map_p2m_writable’
#  152|       {
#  153|           unsigned int n_pages = idx_end - idx_start + 1;
#  154|->         uint64_t *ptes = xc_map_foreign_pages(xch, dom, PROT_READ, mfns, n_pages);
#  155|           unsigned int shift, idx;
#  156|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def633]
xen-4.20.2/tools/libs/guest/xg_core_x86.c:159:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:378:1: enter_function: entry to ‘xc_core_arch_map_p2m_writable’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:381:12: call_function: calling ‘xc_core_arch_map_p2m_rw’ from ‘xc_core_arch_map_p2m_writable’
#  157|           if ( !ptes )
#  158|           {
#  159|->             PERROR("Failed to map %u page table pages for p2m list", n_pages);
#  160|               goto out;
#  161|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def634]
xen-4.20.2/tools/libs/guest/xg_core_x86.c:183:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:378:1: enter_function: entry to ‘xc_core_arch_map_p2m_writable’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:381:12: call_function: calling ‘xc_core_arch_map_p2m_rw’ from ‘xc_core_arch_map_p2m_writable’
#  181|               if ( mfn == 0 )
#  182|               {
#  183|->                 ERROR("Bad mfn %#lx during page table walk for vaddr %#" PRIx64 " at level %d of p2m list",
#  184|                         mfn, off + ((uint64_t)idx << shift), level);
#  185|                   errno = ERANGE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def635]
xen-4.20.2/tools/libs/guest/xg_core_x86.c:273:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_frame_list_list’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:378:1: enter_function: entry to ‘xc_core_arch_map_p2m_writable’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:381:12: call_function: calling ‘xc_core_arch_map_p2m_rw’ from ‘xc_core_arch_map_p2m_writable’
#  271|   
#  272|       live_p2m_frame_list =
#  273|->         xc_map_foreign_pages(xch, dom, PROT_READ,
#  274|                                p2m_frame_list_list,
#  275|                                P2M_FLL_ENTRIES);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def636]
xen-4.20.2/tools/libs/guest/xg_core_x86.c:279:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_frame_list_list’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:378:1: enter_function: entry to ‘xc_core_arch_map_p2m_writable’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:381:12: call_function: calling ‘xc_core_arch_map_p2m_rw’ from ‘xc_core_arch_map_p2m_writable’
#  277|       if ( !live_p2m_frame_list )
#  278|       {
#  279|->         PERROR("Couldn't map p2m_frame_list");
#  280|           goto out;
#  281|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def637]
xen-4.20.2/tools/libs/guest/xg_core_x86.c:286:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p2m_frame_list_list’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:378:1: enter_function: entry to ‘xc_core_arch_map_p2m_writable’
xen-4.20.2/tools/libs/guest/xg_core_x86.c:381:12: call_function: calling ‘xc_core_arch_map_p2m_rw’ from ‘xc_core_arch_map_p2m_writable’
#  284|       if ( !(p2m_frame_list = malloc(P2M_TOOLS_FL_SIZE)) )
#  285|       {
#  286|->         ERROR("Couldn't allocate p2m_frame_list array");
#  287|           goto out;
#  288|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def638]
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4888)’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:577:5: enter_function: entry to ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: call_function: inlined call to ‘xc_cpu_policy_init’ from ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:592:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: throw: if ‘xc_domain_getinfo_single’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: danger: ‘calloc(1, 4888)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  593|           return -ENOMEM;
#  594|   
#  595|->     if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
#  596|       {
#  597|           PERROR("Failed to obtain d%d info", domid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def639]
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xc_cpu_policy_init()’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:577:5: enter_function: entry to ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: call_function: calling ‘xc_cpu_policy_init’ from ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: return_function: returning to ‘xc_cpuid_apply_policy’ from ‘xc_cpu_policy_init’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:592:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: throw: if ‘xc_domain_getinfo_single’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: danger: ‘xc_cpu_policy_init()’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  593|           return -ENOMEM;
#  594|   
#  595|->     if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
#  596|       {
#  597|           PERROR("Failed to obtain d%d info", domid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def640]
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4888)’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:577:5: enter_function: entry to ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: call_function: inlined call to ‘xc_cpu_policy_init’ from ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:592:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: danger: ‘calloc(1, 4888)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  595|       if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
#  596|       {
#  597|->         PERROR("Failed to obtain d%d info", domid);
#  598|           rc = -errno;
#  599|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def641]
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xc_cpu_policy_init()’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:577:5: enter_function: entry to ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: call_function: calling ‘xc_cpu_policy_init’ from ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: return_function: returning to ‘xc_cpuid_apply_policy’ from ‘xc_cpu_policy_init’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:592:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:597:9: danger: ‘xc_cpu_policy_init()’ leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  595|       if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
#  596|       {
#  597|->         PERROR("Failed to obtain d%d info", domid);
#  598|           rc = -errno;
#  599|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def642]
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:601:11: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4888)’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:577:5: enter_function: entry to ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: call_function: inlined call to ‘xc_cpu_policy_init’ from ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:592:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:601:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:604:10: call_function: calling ‘xc_get_cpu_featureset’ from ‘xc_cpuid_apply_policy’
#  599|           goto out;
#  600|       }
#  601|->     hvm = di.flags & XEN_DOMINF_hvm_guest;
#  602|   
#  603|       /* Get the host policy. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def643]
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:601:11: warning[-Wanalyzer-malloc-leak]: leak of ‘xc_cpu_policy_init()’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:577:5: enter_function: entry to ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: call_function: calling ‘xc_cpu_policy_init’ from ‘xc_cpuid_apply_policy’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:586:31: return_function: returning to ‘xc_cpuid_apply_policy’ from ‘xc_cpu_policy_init’
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:592:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:595:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:601:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_cpuid_x86.c:604:10: call_function: calling ‘xc_get_cpu_featureset’ from ‘xc_cpuid_apply_policy’
#  599|           goto out;
#  600|       }
#  601|->     hvm = di.flags & XEN_DOMINF_hvm_guest;
#  602|   
#  603|       /* Get the host policy. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def644]
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:103:11: warning[-Wanalyzer-malloc-leak]: leak of ‘out_buf’
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:58:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:64:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:65:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:71:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:78:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:84:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:84:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:90:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:90:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:91:8: branch_false: following ‘false’ branch (when ‘out_buf’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:97:22: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:103:11: throw: if ‘BZ2_bzDecompress’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:103:11: danger: ‘out_buf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  101|       stream.avail_out = outsize;
#  102|   
#  103|->     ret = BZ2_bzDecompress(&stream);
#  104|       if ( ret == BZ_STREAM_END )
#  105|           DOMPRINTF("BZIP2: Saw data stream end");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def645]
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:580:14: warning[-Wanalyzer-malloc-leak]: leak of ‘outbuf’
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:558:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:564:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:567:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:573:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:573:14: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:574:8: branch_false: following ‘false’ branch (when ‘outbuf’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:580:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:580:14: throw: if ‘ZSTD_decompress’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_bzimageloader.c:580:14: danger: ‘outbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  578|       }
#  579|   
#  580|->     actual = ZSTD_decompress(outbuf, outsize, *blob, insize);
#  581|   
#  582|       if ( ZSTD_isError(actual) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def646]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:72:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:740:22: enter_function: entry to ‘xc_dom_allocate’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:749:8: branch_false: following ‘false’ branch (when ‘dom’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:752:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:755:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:756:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:758:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:765:8: branch_true: following ‘true’ branch (when ‘cmdline’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:766:24: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:766:24: call_function: calling ‘xc_dom_strdup’ from ‘xc_dom_allocate’
#   70|       if (!xch->dombuild_logger) return;
#   71|       va_start(args, fmt);
#   72|->     xtl_logv(xch->dombuild_logger, XTL_DETAIL, -1, "domainbuilder", fmt, args);
#   73|       va_end(args);
#   74|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def647]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:72:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dom’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:740:22: enter_function: entry to ‘xc_dom_allocate’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:748:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:749:8: branch_false: following ‘false’ branch (when ‘dom’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:752:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:756:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:757:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:784:9: call_function: calling ‘xc_dom_release’ from ‘xc_dom_allocate’
#   70|       if (!xch->dombuild_logger) return;
#   71|       va_start(args, fmt);
#   72|->     xtl_logv(xch->dombuild_logger, XTL_DETAIL, -1, "domainbuilder", fmt, args);
#   73|       va_end(args);
#   74|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def648]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:72:5: warning[-Wanalyzer-malloc-leak]: leak of ‘extents’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1054:12: enter_function: entry to ‘xc_dom_load_acpi’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1061:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1070:19: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1071:12: branch_false: following ‘false’ branch (when ‘extents’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1077:9: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1078:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: call_function: calling ‘populate_acpi_pages’ from ‘xc_dom_load_acpi’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: return_function: returning to ‘xc_dom_load_acpi’ from ‘populate_acpi_pages’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1087:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1089:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1091:13: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1091:13: call_function: calling ‘xc_dom_printf’ from ‘xc_dom_load_acpi’
#   70|       if (!xch->dombuild_logger) return;
#   71|       va_start(args, fmt);
#   72|->     xtl_logv(xch->dombuild_logger, XTL_DETAIL, -1, "domainbuilder", fmt, args);
#   73|       va_end(args);
#   74|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def649]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:72:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1112:5: enter_function: entry to ‘xc_dom_build_image’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1118:5: call_function: calling ‘xc_dom_printf’ from ‘xc_dom_build_image’
#   70|       if (!xch->dombuild_logger) return;
#   71|       va_start(args, fmt);
#   72|->     xtl_logv(xch->dombuild_logger, XTL_DETAIL, -1, "domainbuilder", fmt, args);
#   73|       va_end(args);
#   74|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def650]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:88:5: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:809:5: enter_function: entry to ‘xc_dom_kernel_file’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:812:24: call_function: calling ‘xc_dom_malloc_filemap’ from ‘xc_dom_kernel_file’
#   86|       msg[sizeof(msg)-1] = 0;
#   87|       
#   88|->     xc_report(xch,
#   89|                 xch->dombuild_logger ? xch->dombuild_logger : xch->error_handler,
#   90|                 XTL_ERROR, err, "panic: %s:%d: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def651]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:266:9: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:809:5: enter_function: entry to ‘xc_dom_kernel_file’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:812:24: call_function: calling ‘xc_dom_malloc_filemap’ from ‘xc_dom_kernel_file’
#  264|    err:
#  265|       if ( fd != -1 )
#  266|->         close(fd);
#  267|       free(block);
#  268|       DOMPRINTF("%s: failed (on file `%s')", __FUNCTION__, filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def652]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:749:8: branch_false: following ‘false’ branch (when ‘dom’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:752:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:755:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:756:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:758:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:765:8: branch_false: following ‘false’ branch (when ‘cmdline’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:767:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:767:8: branch_true: following ‘true’ branch (when ‘features’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:42: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:9: throw: if ‘elf_xen_parse_features’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  766|           dom->cmdline = xc_dom_strdup(dom, cmdline);
#  767|       if ( features )
#  768|->         elf_xen_parse_features(features, dom->f_requested, NULL);
#  769|   
#  770|       dom->parms->virt_base = UNSET_ADDR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def653]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dom’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:748:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:749:8: branch_false: following ‘false’ branch (when ‘dom’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:752:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:756:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:758:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:765:8: branch_false: following ‘false’ branch (when ‘cmdline’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:767:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:767:8: branch_true: following ‘true’ branch (when ‘features’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:42: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:9: throw: if ‘elf_xen_parse_features’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:768:9: danger: ‘dom’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  766|           dom->cmdline = xc_dom_strdup(dom, cmdline);
#  767|       if ( features )
#  768|->         elf_xen_parse_features(features, dom->f_requested, NULL);
#  769|   
#  770|       dom->parms->virt_base = UNSET_ADDR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def654]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1030:14: warning[-Wanalyzer-malloc-leak]: leak of ‘extents’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1054:12: enter_function: entry to ‘xc_dom_load_acpi’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1061:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1070:19: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1071:12: branch_false: following ‘false’ branch (when ‘extents’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1077:9: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1078:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: call_function: calling ‘populate_acpi_pages’ from ‘xc_dom_load_acpi’
# 1028|       {
# 1029|   
# 1030|->         if ( xc_domain_populate_physmap(xch, domid, 1, 0, 0, extents) == 1 )
# 1031|               continue;
# 1032|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def655]
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1086:15: warning[-Wanalyzer-malloc-leak]: leak of ‘extents’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1054:12: enter_function: entry to ‘xc_dom_load_acpi’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1061:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1070:19: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1071:12: branch_false: following ‘false’ branch (when ‘extents’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1077:9: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1078:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: call_function: calling ‘populate_acpi_pages’ from ‘xc_dom_load_acpi’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:14: return_function: returning to ‘xc_dom_load_acpi’ from ‘populate_acpi_pages’
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1080:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1087:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1086:15: throw: if ‘xc_map_foreign_range’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_core.c:1086:15: danger: ‘extents’ leaks here; was allocated at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
# 1084|           }
# 1085|   
# 1086|->         ptr = xc_map_foreign_range(dom->xch, dom->guest_domid,
# 1087|                                      XC_PAGE_SIZE * num_pages,
# 1088|                                      PROT_READ | PROT_WRITE, base);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def656]
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:200:22: warning[-Wanalyzer-malloc-leak]: leak of ‘entries’
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:193:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:194:8: branch_false: following ‘false’ branch (when ‘entries’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:194:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:197:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:200:22: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:200:22: throw: if ‘xc_map_foreign_ranges’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_hvmloader.c:200:22: danger: ‘entries’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  198|           entries[i].mfn = (elf->pstart >> PAGE_SHIFT) + i;
#  199|   
#  200|->     elf->dest_base = xc_map_foreign_ranges(
#  201|           dom->xch, dom->guest_domid, pages << PAGE_SHIFT,
#  202|           PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def657]
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1033:10: warning[-Wanalyzer-malloc-leak]: leak of ‘full_ctx’
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1005:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1014:10: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1015:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1023:16: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1023:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1024:8: branch_false: following ‘false’ branch (when ‘full_ctx’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1033:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1033:10: throw: if ‘xc_domain_hvm_getcontext’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_dom_x86.c:1033:10: danger: ‘full_ctx’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 1031|       }
# 1032|   
# 1033|->     rc = xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, full_ctx, rc);
# 1034|       if ( rc <= 0 )
# 1035|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def658]
xen-4.20.2/tools/libs/guest/xg_offline_page.c:421:10: warning[-Wanalyzer-malloc-leak]: leak of ‘extent_start’
xen-4.20.2/tools/libs/guest/xg_offline_page.c:414:20: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:415:8: branch_false: following ‘false’ branch (when ‘extent_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:421:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:421:10: throw: if ‘xc_machphys_mfn_list’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:421:10: danger: ‘extent_start’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  419|       }
#  420|   
#  421|->     if ( xc_machphys_mfn_list(xch, m2p_chunks, extent_start) )
#  422|       {
#  423|           PERROR("xc_get_m2p_mfns");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def659]
xen-4.20.2/tools/libs/guest/xg_offline_page.c:437:11: warning[-Wanalyzer-malloc-leak]: leak of ‘entries’
xen-4.20.2/tools/libs/guest/xg_offline_page.c:415:8: branch_false: following ‘false’ branch (when ‘extent_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:421:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:421:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:427:15: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:427:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:428:8: branch_false: following ‘false’ branch (when ‘entries’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:428:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:434:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:437:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_offline_page.c:437:11: throw: if ‘xc_map_foreign_ranges’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_offline_page.c:437:11: danger: ‘entries’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  435|           entries[i].mfn = extent_start[i];
#  436|   
#  437|->     m2p = xc_map_foreign_ranges(xch, DOMID_XEN,
#  438|   			m2p_size, prot, M2P_CHUNK_SIZE,
#  439|   			entries, m2p_chunks);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def660]
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 0)’
xen-4.20.2/tools/libs/guest/xg_private.c:34:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:37:23: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:37:23: acquire_resource: opened here
xen-4.20.2/tools/libs/guest/xg_private.c:37:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: throw: if ‘gzdopen’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: danger: ‘open(filename, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   41|       }
#   42|   
#   43|->     if ( (kernel_gfd = gzdopen(kernel_fd, "rb")) == NULL )
#   44|       {
#   45|           PERROR("Could not allocate decompression state for state file");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def661]
xen-4.20.2/tools/libs/guest/xg_private.c:56:13: warning[-Wanalyzer-malloc-leak]: leak of ‘image’
xen-4.20.2/tools/libs/guest/xg_private.c:34:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:37:23: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:37:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:43:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:49:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_true: following ‘true’ branch (when ‘tmp’ is NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:56:13: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:56:13: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_private.c:56:13: danger: ‘image’ leaks here; was allocated at [(12)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/11)
#   54|           if ( (tmp = realloc(image, *size + CHUNK)) == NULL )
#   55|           {
#   56|->             PERROR("Could not allocate memory for kernel image");
#   57|               free(image);
#   58|               image = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def662]
xen-4.20.2/tools/libs/guest/xg_private.c:63:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libs/guest/xg_private.c:34:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:37:23: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:37:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:43:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:49:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:63:17: throw: if ‘gzread’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_private.c:63:17: danger: ‘tmp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#   61|           image = tmp;
#   62|   
#   63|->         bytes = gzread(kernel_gfd, image + *size, CHUNK);
#   64|           switch (bytes)
#   65|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def663]
xen-4.20.2/tools/libs/guest/xg_private.c:67:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libs/guest/xg_private.c:34:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:37:23: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:37:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:43:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:49:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:67:13: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_private.c:67:13: danger: ‘tmp’ leaks here; was allocated at [(12)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/11)
#   65|           {
#   66|           case -1:
#   67|->             PERROR("Error reading kernel image");
#   68|               free(image);
#   69|               image = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def664]
xen-4.20.2/tools/libs/guest/xg_private.c:74:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libs/guest/xg_private.c:34:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:37:23: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:37:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:43:24: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:43:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:49:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_private.c:63:36: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:72:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_private.c:74:17: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_private.c:74:17: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_private.c:74:17: danger: ‘tmp’ leaks here; was allocated at [(12)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/11)
#   72|               if ( *size == 0 )
#   73|               {
#   74|->                 PERROR("Could not read kernel image");
#   75|                   free(image);
#   76|                   image = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def665]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:62:14: warning[-Wanalyzer-malloc-leak]: leak of ‘cpuid.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:62:14: throw: if ‘xc_cpu_policy_init’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:62:14: danger: ‘cpuid.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   60|       cpuid.data = malloc(nr_leaves * sizeof(xen_cpuid_leaf_t));
#   61|       msrs.data  = malloc(nr_msrs   * sizeof(xen_msr_entry_t));
#   62|->     policy = xc_cpu_policy_init();
#   63|       if ( !cpuid.data || !msrs.data || !policy )
#   64|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def666]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:62:14: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:61:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:62:14: throw: if ‘xc_cpu_policy_init’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:62:14: danger: ‘msrs.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   60|       cpuid.data = malloc(nr_leaves * sizeof(xen_cpuid_leaf_t));
#   61|       msrs.data  = malloc(nr_msrs   * sizeof(xen_msr_entry_t));
#   62|->     policy = xc_cpu_policy_init();
#   63|       if ( !cpuid.data || !msrs.data || !policy )
#   64|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def667]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cpuid.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:26: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: throw: if ‘xc_report_error’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: danger: ‘cpuid.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   63|       if ( !cpuid.data || !msrs.data || !policy )
#   64|       {
#   65|->         ERROR("Cannot allocate memory for CPU Policy");
#   66|           rc = -1;
#   67|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def668]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:61:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: throw: if ‘xc_report_error’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:65:9: danger: ‘msrs.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   63|       if ( !cpuid.data || !msrs.data || !policy )
#   64|       {
#   65|->         ERROR("Cannot allocate memory for CPU Policy");
#   66|           rc = -1;
#   67|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def669]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:10: warning[-Wanalyzer-malloc-leak]: leak of ‘cpuid.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:10: throw: if ‘xc_cpu_policy_get_domain’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:10: danger: ‘cpuid.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#   68|       }
#   69|   
#   70|->     if ( xc_cpu_policy_get_domain(xch, ctx->domid, policy) )
#   71|       {
#   72|           PERROR("Unable to get d%d CPU Policy", ctx->domid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def670]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:10: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:61:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:26: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:10: throw: if ‘xc_cpu_policy_get_domain’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:10: danger: ‘msrs.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#   68|       }
#   69|   
#   70|->     if ( xc_cpu_policy_get_domain(xch, ctx->domid, policy) )
#   71|       {
#   72|           PERROR("Unable to get d%d CPU Policy", ctx->domid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def671]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cpuid.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: danger: ‘cpuid.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#   70|       if ( xc_cpu_policy_get_domain(xch, ctx->domid, policy) )
#   71|       {
#   72|->         PERROR("Unable to get d%d CPU Policy", ctx->domid);
#   73|           rc = -1;
#   74|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def672]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:61:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:26: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: throw: if ‘xc_strerror’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:72:9: danger: ‘msrs.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#   70|       if ( xc_cpu_policy_get_domain(xch, ctx->domid, policy) )
#   71|       {
#   72|->         PERROR("Unable to get d%d CPU Policy", ctx->domid);
#   73|           rc = -1;
#   74|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def673]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:76:10: warning[-Wanalyzer-malloc-leak]: leak of ‘cpuid.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:77:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:76:10: throw: if ‘xc_cpu_policy_serialise’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:76:10: danger: ‘cpuid.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#   74|           goto out;
#   75|       }
#   76|->     if ( xc_cpu_policy_serialise(xch, policy, cpuid.data, &nr_leaves,
#   77|                                    msrs.data, &nr_msrs) )
#   78|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def674]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:76:10: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs.data’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:54:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:60:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:61:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:26: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:63:10: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:70:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:77:34: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:76:10: throw: if ‘xc_cpu_policy_serialise’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86.c:76:10: danger: ‘msrs.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#   74|           goto out;
#   75|       }
#   76|->     if ( xc_cpu_policy_serialise(xch, policy, cpuid.data, &nr_leaves,
#   77|                                    msrs.data, &nr_msrs) )
#   78|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def675]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:123:10: warning[-Wanalyzer-malloc-leak]: leak of ‘extents_start’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:105:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:111:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:115:21: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:116:8: branch_false: following ‘false’ branch (when ‘extents_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:123:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:123:10: throw: if ‘xc_machphys_mfn_list’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:123:10: danger: ‘extents_start’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  121|       }
#  122|   
#  123|->     if ( xc_machphys_mfn_list(xch, m2p_chunks, extents_start) )
#  124|       {
#  125|           PERROR("Failed to get m2p mfn list");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def676]
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:140:23: warning[-Wanalyzer-malloc-leak]: leak of ‘entries’
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:105:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:111:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:116:8: branch_false: following ‘false’ branch (when ‘extents_start’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:123:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:123:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:129:22: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:129:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:130:8: branch_false: following ‘false’ branch (when ‘entries’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:130:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:140:23: throw: if ‘xc_map_foreign_ranges’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_common_x86_pv.c:140:23: danger: ‘entries’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  138|           entries[i].mfn = extents_start[i];
#  139|   
#  140|->     ctx->x86.pv.m2p = xc_map_foreign_ranges(
#  141|           xch, DOMID_XEN, m2p_size, PROT_READ,
#  142|           M2P_CHUNK_SIZE, entries, m2p_chunks);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def677]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:115:13: warning[-Wanalyzer-malloc-leak]: leak of ‘map_errs’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  113|           if ( !p )
#  114|           {
#  115|->             ERROR("Failed to realloc populated bitmap");
#  116|               errno = ENOMEM;
#  117|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def678]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:115:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  113|           if ( !p )
#  114|           {
#  115|->             ERROR("Failed to realloc populated bitmap");
#  116|               errno = ENOMEM;
#  117|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def679]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:115:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  113|           if ( !p )
#  114|           {
#  115|->             ERROR("Failed to realloc populated bitmap");
#  116|               errno = ENOMEM;
#  117|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def680]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘map_errs’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  146|       if ( !mfns || !pfns )
#  147|       {
#  148|->         ERROR("Failed to allocate %zu bytes for populating the physmap",
#  149|                 2 * count * sizeof(*mfns));
#  150|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def681]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  146|       if ( !mfns || !pfns )
#  147|       {
#  148|->         ERROR("Failed to allocate %zu bytes for populating the physmap",
#  149|                 2 * count * sizeof(*mfns));
#  150|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def682]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  146|       if ( !mfns || !pfns )
#  147|       {
#  148|->         ERROR("Failed to allocate %zu bytes for populating the physmap",
#  149|                 2 * count * sizeof(*mfns));
#  150|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def683]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  146|       if ( !mfns || !pfns )
#  147|       {
#  148|->         ERROR("Failed to allocate %zu bytes for populating the physmap",
#  149|                 2 * count * sizeof(*mfns));
#  150|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def684]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:155:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  153|       for ( i = 0; i < count; ++i )
#  154|       {
#  155|->         if ( (!types || page_type_to_populate(types[i])) &&
#  156|                !pfn_is_populated(ctx, original_pfns[i]) )
#  157|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def685]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:218:9: warning[-Wanalyzer-malloc-leak]: leak of ‘map_errs’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  216|       {
#  217|           rc = -1;
#  218|->         ERROR("Failed to allocate %zu bytes to process page data",
#  219|                 count * (sizeof(*mfns) + sizeof(*map_errs)));
#  220|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def686]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:218:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  216|       {
#  217|           rc = -1;
#  218|->         ERROR("Failed to allocate %zu bytes to process page data",
#  219|                 count * (sizeof(*mfns) + sizeof(*map_errs)));
#  220|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def687]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:218:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  216|       {
#  217|           rc = -1;
#  218|->         ERROR("Failed to allocate %zu bytes to process page data",
#  219|                 count * (sizeof(*mfns) + sizeof(*map_errs)));
#  220|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def688]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:218:9: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  216|       {
#  217|           rc = -1;
#  218|->         ERROR("Failed to allocate %zu bytes to process page data",
#  219|                 count * (sizeof(*mfns) + sizeof(*map_errs)));
#  220|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def689]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:226:9: warning[-Wanalyzer-malloc-leak]: leak of ‘map_errs’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  224|       if ( rc )
#  225|       {
#  226|->         ERROR("Failed to populate pfns for batch of %u pages", count);
#  227|           goto err;
#  228|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def690]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:226:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  224|       if ( rc )
#  225|       {
#  226|->         ERROR("Failed to populate pfns for batch of %u pages", count);
#  227|           goto err;
#  228|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def691]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:226:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  224|       if ( rc )
#  225|       {
#  226|->         ERROR("Failed to populate pfns for batch of %u pages", count);
#  227|           goto err;
#  228|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def692]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:226:9: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  224|       if ( rc )
#  225|       {
#  226|->         ERROR("Failed to populate pfns for batch of %u pages", count);
#  227|           goto err;
#  228|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def693]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:232:54: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  230|       for ( i = 0; i < count; ++i )
#  231|       {
#  232|->         ctx->restore.ops.set_page_type(ctx, pfns[i], types[i]);
#  233|   
#  234|           if ( page_type_has_stream_data(types[i]) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def694]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:369:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  367|       if ( !pfns || !types )
#  368|       {
#  369|->         ERROR("Unable to allocate enough memory for %u pfns",
#  370|                 pages->count);
#  371|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def695]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:369:9: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  367|       if ( !pfns || !types )
#  368|       {
#  369|->         ERROR("Unable to allocate enough memory for %u pfns",
#  370|                 pages->count);
#  371|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def696]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:377:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  375|       {
#  376|           pfn = pages->pfn[i] & PAGE_DATA_PFN_MASK;
#  377|->         if ( !ctx->restore.ops.pfn_is_valid(ctx, pfn) )
#  378|           {
#  379|               ERROR("pfn %#"PRIpfn" (index %u) outside domain maximum", pfn, i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def697]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:377:15: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  375|       {
#  376|           pfn = pages->pfn[i] & PAGE_DATA_PFN_MASK;
#  377|->         if ( !ctx->restore.ops.pfn_is_valid(ctx, pfn) )
#  378|           {
#  379|               ERROR("pfn %#"PRIpfn" (index %u) outside domain maximum", pfn, i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def698]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:379:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  377|           if ( !ctx->restore.ops.pfn_is_valid(ctx, pfn) )
#  378|           {
#  379|->             ERROR("pfn %#"PRIpfn" (index %u) outside domain maximum", pfn, i);
#  380|               goto err;
#  381|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def699]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:379:13: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  377|           if ( !ctx->restore.ops.pfn_is_valid(ctx, pfn) )
#  378|           {
#  379|->             ERROR("pfn %#"PRIpfn" (index %u) outside domain maximum", pfn, i);
#  380|               goto err;
#  381|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def700]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:386:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  384|           if ( !is_known_page_type(type) )
#  385|           {
#  386|->             ERROR("Unknown type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
#  387|                     type, pfn, i);
#  388|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def701]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:386:13: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  384|           if ( !is_known_page_type(type) )
#  385|           {
#  386|->             ERROR("Unknown type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
#  387|                     type, pfn, i);
#  388|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def702]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:404:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  402|                            (PAGE_SIZE * pages_of_data)) )
#  403|       {
#  404|->         ERROR("PAGE_DATA record wrong size: length %u, expected "
#  405|                 "%zu + %zu + %lu", rec->length, sizeof(*pages),
#  406|                 (sizeof(uint64_t) * pages->count), (PAGE_SIZE * pages_of_data));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def703]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:404:9: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  402|                            (PAGE_SIZE * pages_of_data)) )
#  403|       {
#  404|->         ERROR("PAGE_DATA record wrong size: length %u, expected "
#  405|                 "%zu + %zu + %lu", rec->length, sizeof(*pages),
#  406|                 (sizeof(uint64_t) * pages->count), (PAGE_SIZE * pages_of_data));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def704]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:469:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  467|           if ( written > count )
#  468|           {
#  469|->             ERROR("Dirty pfn list exceed");
#  470|               goto err;
#  471|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def705]
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:481:10: warning[-Wanalyzer-malloc-leak]: leak of ‘pfns’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:756:12: enter_function: entry to ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: call_function: calling ‘setup’ from ‘restore’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:764:10: return_function: returning to ‘restore’ from ‘setup’
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:765:8: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:771:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:779:14: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore.c:789:18: call_function: calling ‘process_record’ from ‘restore’
#  479|       iov[1].iov_len = rec.length;
#  480|   
#  481|->     if ( writev_exact(ctx->restore.send_back_fd, iov, ARRAY_SIZE(iov)) )
#  482|       {
#  483|           PERROR("Failed to write dirty bitmap to stream");

Error: GCC_ANALYZER_WARNING (CWE-131): [#def706]
xen-4.20.2/tools/libs/guest/xg_sr_restore_x86_pv.c:32:11: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
xen-4.20.2/tools/libs/guest/xg_sr_restore_x86_pv.c:29:5: branch_true: following ‘true’ branch (when ‘old_max < max_pfn’)...
xen-4.20.2/tools/libs/guest/xg_sr_restore_x86_pv.c:31:13: branch_true: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_restore_x86_pv.c:32:11: danger: allocated ‘(max_pfn + 1) * (long unsigned int)*ctx.<Ufe60>.x86.pv.width’ bytes and assigned to ‘xen_pfn_t *’ {{aka ‘long unsigned int *’}} here; ‘sizeof (xen_pfn_t {{aka long unsigned int}})’ is ‘8’
#   30|   
#   31|       p2msz = (max_pfn + 1) * ctx->x86.pv.width;
#   32|->     p2m = realloc(ctx->x86.pv.p2m, p2msz);
#   33|       if ( !p2m )
#   34|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def707]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  120|       if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
#  121|       {
#  122|->         ERROR("Unable to allocate arrays for a batch of %u pages",
#  123|                 nr_pfns);
#  124|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def708]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  120|       if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
#  121|       {
#  122|->         ERROR("Unable to allocate arrays for a batch of %u pages",
#  123|                 nr_pfns);
#  124|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def709]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  120|       if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
#  121|       {
#  122|->         ERROR("Unable to allocate arrays for a batch of %u pages",
#  123|                 nr_pfns);
#  124|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def710]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  120|       if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
#  121|       {
#  122|->         ERROR("Unable to allocate arrays for a batch of %u pages",
#  123|                 nr_pfns);
#  124|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def711]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  120|       if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
#  121|       {
#  122|->         ERROR("Unable to allocate arrays for a batch of %u pages",
#  123|                 nr_pfns);
#  124|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def712]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  120|       if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
#  121|       {
#  122|->         ERROR("Unable to allocate arrays for a batch of %u pages",
#  123|                 nr_pfns);
#  124|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def713]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:129:30: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  127|       for ( i = 0; i < nr_pfns; ++i )
#  128|       {
#  129|->         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
#  130|                                                         ctx->save.batch_pfns[i]);
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def714]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:129:30: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  127|       for ( i = 0; i < nr_pfns; ++i )
#  128|       {
#  129|->         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
#  130|                                                         ctx->save.batch_pfns[i]);
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def715]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:129:30: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  127|       for ( i = 0; i < nr_pfns; ++i )
#  128|       {
#  129|->         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
#  130|                                                         ctx->save.batch_pfns[i]);
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def716]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:129:30: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  127|       for ( i = 0; i < nr_pfns; ++i )
#  128|       {
#  129|->         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
#  130|                                                         ctx->save.batch_pfns[i]);
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def717]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:129:30: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  127|       for ( i = 0; i < nr_pfns; ++i )
#  128|       {
#  129|->         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
#  130|                                                         ctx->save.batch_pfns[i]);
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def718]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:129:30: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  127|       for ( i = 0; i < nr_pfns; ++i )
#  128|       {
#  129|->         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
#  130|                                                         ctx->save.batch_pfns[i]);
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def719]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:140:10: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  138|       }
#  139|   
#  140|->     rc = xc_get_pfn_type_batch(xch, ctx->domid, nr_pfns, types);
#  141|       if ( rc )
#  142|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def720]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:140:10: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  138|       }
#  139|   
#  140|->     rc = xc_get_pfn_type_batch(xch, ctx->domid, nr_pfns, types);
#  141|       if ( rc )
#  142|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def721]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:140:10: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  138|       }
#  139|   
#  140|->     rc = xc_get_pfn_type_batch(xch, ctx->domid, nr_pfns, types);
#  141|       if ( rc )
#  142|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def722]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:140:10: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  138|       }
#  139|   
#  140|->     rc = xc_get_pfn_type_batch(xch, ctx->domid, nr_pfns, types);
#  141|       if ( rc )
#  142|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def723]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:140:10: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  138|       }
#  139|   
#  140|->     rc = xc_get_pfn_type_batch(xch, ctx->domid, nr_pfns, types);
#  141|       if ( rc )
#  142|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def724]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:140:10: warning[-Wanalyzer-malloc-leak]: leak of ‘types’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  138|       }
#  139|   
#  140|->     rc = xc_get_pfn_type_batch(xch, ctx->domid, nr_pfns, types);
#  141|       if ( rc )
#  142|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def725]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  141|       if ( rc )
#  142|       {
#  143|->         PERROR("Failed to get types for pfn batch");
#  144|           goto err;
#  145|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def726]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  141|       if ( rc )
#  142|       {
#  143|->         PERROR("Failed to get types for pfn batch");
#  144|           goto err;
#  145|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def727]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  141|       if ( rc )
#  142|       {
#  143|->         PERROR("Failed to get types for pfn batch");
#  144|           goto err;
#  145|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def728]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  141|       if ( rc )
#  142|       {
#  143|->         PERROR("Failed to get types for pfn batch");
#  144|           goto err;
#  145|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def729]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  141|       if ( rc )
#  142|       {
#  143|->         PERROR("Failed to get types for pfn batch");
#  144|           goto err;
#  145|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def730]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:152:13: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  150|           if ( !is_known_page_type(types[i]) )
#  151|           {
#  152|->             ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
#  153|               goto err;
#  154|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def731]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:152:13: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  150|           if ( !is_known_page_type(types[i]) )
#  151|           {
#  152|->             ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
#  153|               goto err;
#  154|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def732]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:152:13: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  150|           if ( !is_known_page_type(types[i]) )
#  151|           {
#  152|->             ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
#  153|               goto err;
#  154|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def733]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:152:13: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  150|           if ( !is_known_page_type(types[i]) )
#  151|           {
#  152|->             ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
#  153|               goto err;
#  154|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def734]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:152:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  150|           if ( !is_known_page_type(types[i]) )
#  151|           {
#  152|->             ERROR("Unknown type %#"PRIpfn" for pfn %#"PRIpfn, types[i], mfns[i]);
#  153|               goto err;
#  154|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def735]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:164:25: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  162|       if ( nr_pages > 0 )
#  163|       {
#  164|->         guest_mapping = xenforeignmemory_map(
#  165|               xch->fmem, ctx->domid, PROT_READ, nr_pages, mfns, errors);
#  166|           if ( !guest_mapping )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def736]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:164:25: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  162|       if ( nr_pages > 0 )
#  163|       {
#  164|->         guest_mapping = xenforeignmemory_map(
#  165|               xch->fmem, ctx->domid, PROT_READ, nr_pages, mfns, errors);
#  166|           if ( !guest_mapping )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def737]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:164:25: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  162|       if ( nr_pages > 0 )
#  163|       {
#  164|->         guest_mapping = xenforeignmemory_map(
#  165|               xch->fmem, ctx->domid, PROT_READ, nr_pages, mfns, errors);
#  166|           if ( !guest_mapping )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def738]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:164:25: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  162|       if ( nr_pages > 0 )
#  163|       {
#  164|->         guest_mapping = xenforeignmemory_map(
#  165|               xch->fmem, ctx->domid, PROT_READ, nr_pages, mfns, errors);
#  166|           if ( !guest_mapping )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def739]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:164:25: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  162|       if ( nr_pages > 0 )
#  163|       {
#  164|->         guest_mapping = xenforeignmemory_map(
#  165|               xch->fmem, ctx->domid, PROT_READ, nr_pages, mfns, errors);
#  166|           if ( !guest_mapping )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def740]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:168:13: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  166|           if ( !guest_mapping )
#  167|           {
#  168|->             PERROR("Failed to map guest pages");
#  169|               goto err;
#  170|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def741]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:168:13: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  166|           if ( !guest_mapping )
#  167|           {
#  168|->             PERROR("Failed to map guest pages");
#  169|               goto err;
#  170|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def742]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:168:13: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  166|           if ( !guest_mapping )
#  167|           {
#  168|->             PERROR("Failed to map guest pages");
#  169|               goto err;
#  170|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def743]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:168:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  166|           if ( !guest_mapping )
#  167|           {
#  168|->             PERROR("Failed to map guest pages");
#  169|               goto err;
#  170|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def744]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:180:17: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  178|               if ( errors[p] )
#  179|               {
#  180|->                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
#  181|                         ctx->save.batch_pfns[i], mfns[p], errors[p]);
#  182|                   goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def745]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:180:17: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  178|               if ( errors[p] )
#  179|               {
#  180|->                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
#  181|                         ctx->save.batch_pfns[i], mfns[p], errors[p]);
#  182|                   goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def746]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:180:17: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  178|               if ( errors[p] )
#  179|               {
#  180|->                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
#  181|                         ctx->save.batch_pfns[i], mfns[p], errors[p]);
#  182|                   goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def747]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:180:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  178|               if ( errors[p] )
#  179|               {
#  180|->                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
#  181|                         ctx->save.batch_pfns[i], mfns[p], errors[p]);
#  182|                   goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def748]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:186:18: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  184|   
#  185|               orig_page = page = guest_mapping + (p * PAGE_SIZE);
#  186|->             rc = ctx->save.ops.normalise_page(ctx, types[i], &page);
#  187|   
#  188|               if ( orig_page != page )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def749]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:186:18: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  184|   
#  185|               orig_page = page = guest_mapping + (p * PAGE_SIZE);
#  186|->             rc = ctx->save.ops.normalise_page(ctx, types[i], &page);
#  187|   
#  188|               if ( orig_page != page )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def750]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:186:18: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  184|   
#  185|               orig_page = page = guest_mapping + (p * PAGE_SIZE);
#  186|->             rc = ctx->save.ops.normalise_page(ctx, types[i], &page);
#  187|   
#  188|               if ( orig_page != page )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def751]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:186:18: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  184|   
#  185|               orig_page = page = guest_mapping + (p * PAGE_SIZE);
#  186|->             rc = ctx->save.ops.normalise_page(ctx, types[i], &page);
#  187|   
#  188|               if ( orig_page != page )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def752]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  212|       if ( !rec_pfns )
#  213|       {
#  214|->         ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
#  215|                 nr_pfns * sizeof(*rec_pfns));
#  216|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def753]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of ‘guest_data’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  212|       if ( !rec_pfns )
#  213|       {
#  214|->         ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
#  215|                 nr_pfns * sizeof(*rec_pfns));
#  216|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def754]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of ‘iov’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  212|       if ( !rec_pfns )
#  213|       {
#  214|->         ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
#  215|                 nr_pfns * sizeof(*rec_pfns));
#  216|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def755]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  212|       if ( !rec_pfns )
#  213|       {
#  214|->         ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
#  215|                 nr_pfns * sizeof(*rec_pfns));
#  216|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def756]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:773:12: enter_function: entry to ‘send_domain_memory_nonlive’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:779:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:782:5: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:784:10: call_function: calling ‘send_all_pages’ from ‘send_domain_memory_nonlive’
#  212|       if ( !rec_pfns )
#  213|       {
#  214|->         ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
#  215|                 nr_pfns * sizeof(*rec_pfns));
#  216|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def757]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:811:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx.<U61e0>.restore.dirty_bitmap_hbuf.ubuf’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:981:5: enter_function: entry to ‘xc_domain_save’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:998:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1004:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1030:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1037:9: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1038:16: call_function: calling ‘save’ from ‘xc_domain_save’
#  809|       if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
#  810|       {
#  811|->         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
#  812|                 " deferred pages");
#  813|           rc = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def758]
xen-4.20.2/tools/libs/guest/xg_sr_save.c:811:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx.<U61e0>.save.deferred_pages’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:981:5: enter_function: entry to ‘xc_domain_save’
xen-4.20.2/tools/libs/guest/xg_sr_save.c:998:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1004:11: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1030:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1037:9: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save.c:1038:16: call_function: calling ‘save’ from ‘xc_domain_save’
#  809|       if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
#  810|       {
#  811|->         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
#  812|                 " deferred pages");
#  813|           rc = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def759]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:34:20: warning[-Wanalyzer-malloc-leak]: leak of ‘hvm_rec.data’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:19:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:26:20: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:26:20: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:27:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:34:20: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:34:20: throw: if ‘xc_domain_hvm_getcontext’ throws an exception...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_hvm.c:34:20: danger: ‘hvm_rec.data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   32|       }
#   33|   
#   34|->     hvm_buf_size = xc_domain_hvm_getcontext(xch, ctx->domid,
#   35|                                               hvm_rec.data, hvm_buf_size);
#   36|       if ( hvm_buf_size < 0 )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def760]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:85:23: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   83|       unsigned int x;
#   84|   
#   85|->     ctx->x86.pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
#   86|                                              mfns, n_mfns);
#   87|       if ( !ctx->x86.pv.p2m )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def761]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:85:23: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fl’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   83|       unsigned int x;
#   84|   
#   85|->     ctx->x86.pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
#   86|                                              mfns, n_mfns);
#   87|       if ( !ctx->x86.pv.p2m )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def762]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:85:23: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   83|       unsigned int x;
#   84|   
#   85|->     ctx->x86.pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
#   86|                                              mfns, n_mfns);
#   87|       if ( !ctx->x86.pv.p2m )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def763]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:89:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   87|       if ( !ctx->x86.pv.p2m )
#   88|       {
#   89|->         PERROR("Failed to map p2m frames");
#   90|           return -1;
#   91|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def764]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:89:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fl’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   87|       if ( !ctx->x86.pv.p2m )
#   88|       {
#   89|->         PERROR("Failed to map p2m frames");
#   90|           return -1;
#   91|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def765]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:89:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   87|       if ( !ctx->x86.pv.p2m )
#   88|       {
#   89|->         PERROR("Failed to map p2m frames");
#   90|           return -1;
#   91|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def766]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:98:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   96|       if ( !ctx->x86.pv.p2m_pfns )
#   97|       {
#   98|->         ERROR("Cannot allocate %zu bytes for p2m pfns list",
#   99|                 n_mfns * sizeof(*mfns));
#  100|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def767]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:98:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fl’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   96|       if ( !ctx->x86.pv.p2m_pfns )
#   97|       {
#   98|->         ERROR("Cannot allocate %zu bytes for p2m pfns list",
#   99|                 n_mfns * sizeof(*mfns));
#  100|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def768]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:98:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#   96|       if ( !ctx->x86.pv.p2m_pfns )
#   97|       {
#   98|->         ERROR("Cannot allocate %zu bytes for p2m pfns list",
#   99|                 n_mfns * sizeof(*mfns));
#  100|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def769]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:106:15: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  104|       for ( x = 0; x < n_mfns; ++x )
#  105|       {
#  106|->         if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
#  107|           {
#  108|               ERROR("Bad mfn in p2m_frame_list[%u]", x);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def770]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:106:15: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fl’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  104|       for ( x = 0; x < n_mfns; ++x )
#  105|       {
#  106|->         if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
#  107|           {
#  108|               ERROR("Bad mfn in p2m_frame_list[%u]", x);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def771]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:106:15: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  104|       for ( x = 0; x < n_mfns; ++x )
#  105|       {
#  106|->         if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
#  107|           {
#  108|               ERROR("Bad mfn in p2m_frame_list[%u]", x);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def772]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:106:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  104|       for ( x = 0; x < n_mfns; ++x )
#  105|       {
#  106|->         if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
#  107|           {
#  108|               ERROR("Bad mfn in p2m_frame_list[%u]", x);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def773]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:108:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  106|           if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
#  107|           {
#  108|->             ERROR("Bad mfn in p2m_frame_list[%u]", x);
#  109|               dump_bad_pseudophysmap_entry(ctx, mfns[x]);
#  110|               errno = ERANGE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def774]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:109:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  107|           {
#  108|               ERROR("Bad mfn in p2m_frame_list[%u]", x);
#  109|->             dump_bad_pseudophysmap_entry(ctx, mfns[x]);
#  110|               errno = ERANGE;
#  111|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def775]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:114:35: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  112|           }
#  113|   
#  114|->         ctx->x86.pv.p2m_pfns[x] = mfn_to_pfn(ctx, mfns[x]);
#  115|       }
#  116|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def776]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:114:35: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fl’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  112|           }
#  113|   
#  114|->         ctx->x86.pv.p2m_pfns[x] = mfn_to_pfn(ctx, mfns[x]);
#  115|       }
#  116|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def777]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:114:35: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  112|           }
#  113|   
#  114|->         ctx->x86.pv.p2m_pfns[x] = mfn_to_pfn(ctx, mfns[x]);
#  115|       }
#  116|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def778]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:194:13: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  192|           if ( local_fll[x] == 0 || local_fll[x] > ctx->x86.pv.max_mfn )
#  193|           {
#  194|->             ERROR("Bad mfn %#lx at index %u (of %u) in p2m frame list list",
#  195|                     local_fll[x], x, fll_entries);
#  196|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def779]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:222:5: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  220|       }
#  221|       ctx->x86.pv.p2m_frames = (ctx->x86.pv.max_pfn + fpp) / fpp;
#  222|->     DPRINTF("max_pfn %#lx, p2m_frames %d", ctx->x86.pv.max_pfn,
#  223|               ctx->x86.pv.p2m_frames);
#  224|       fl_entries  = (ctx->x86.pv.max_pfn / fpp) + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def780]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:227:16: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  225|   
#  226|       /* Map the guest mid p2m frames. */
#  227|->     guest_fl = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
#  228|                                       local_fll, fll_entries);
#  229|       if ( !guest_fl )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def781]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:231:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  229|       if ( !guest_fl )
#  230|       {
#  231|->         PERROR("Failed to map p2m frame list");
#  232|           goto err;
#  233|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def782]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:239:9: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  237|       if ( !local_fl )
#  238|       {
#  239|->         ERROR("Cannot allocate %zu bytes for local p2m frame list",
#  240|                 local_fl_size);
#  241|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def783]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:254:13: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fll’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  252|           if ( local_fl[x] == 0 || local_fl[x] > ctx->x86.pv.max_mfn )
#  253|           {
#  254|->             ERROR("Bad mfn %#lx at index %u (of %u) in p2m frame list",
#  255|                     local_fl[x], x, fl_entries);
#  256|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def784]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:254:13: warning[-Wanalyzer-malloc-leak]: leak of ‘local_fl’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  252|           if ( local_fl[x] == 0 || local_fl[x] > ctx->x86.pv.max_mfn )
#  253|           {
#  254|->             ERROR("Bad mfn %#lx at index %u (of %u) in p2m frame list",
#  255|                     local_fl[x], x, fl_entries);
#  256|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def785]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:388:16: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  386|       {
#  387|           n_pages = idx_end - idx_start + 1;
#  388|->         ptes = xc_map_foreign_pages(xch, ctx->domid, PROT_READ, mfns, n_pages);
#  389|           if ( !ptes )
#  390|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def786]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:391:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  389|           if ( !ptes )
#  390|           {
#  391|->             PERROR("Failed to map %u page table pages for p2m list", n_pages);
#  392|               goto err;
#  393|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def787]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:412:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mfns’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1032:12: enter_function: entry to ‘x86_pv_setup’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1048:10: call_function: calling ‘map_p2m’ from ‘x86_pv_setup’
#  410|               if ( mfn == 0 || mfn > ctx->x86.pv.max_mfn )
#  411|               {
#  412|->                 ERROR("Bad mfn %#lx during page table walk for vaddr %#" PRIx64 " at level %d of p2m list",
#  413|                         mfn, off + ((xen_vaddr_t)idx << shift), level);
#  414|                   errno = ERANGE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def788]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:895:13: warning[-Wanalyzer-malloc-leak]: leak of ‘local_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1001:12: enter_function: entry to ‘x86_pv_normalise_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1010:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1014:8: branch_false: following ‘false’ branch (when ‘local_page’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: call_function: calling ‘normalise_pagetable’ from ‘x86_pv_normalise_page’
#  893|           {
#  894|           case XEN_DOMCTL_PFINFO_L4TAB:
#  895|->             ERROR("??? Found L4 table for 32bit guest");
#  896|               errno = EINVAL;
#  897|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def789]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:960:17: warning[-Wanalyzer-malloc-leak]: leak of ‘local_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1001:12: enter_function: entry to ‘x86_pv_normalise_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1010:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1014:8: branch_false: following ‘false’ branch (when ‘local_page’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: call_function: calling ‘normalise_pagetable’ from ‘x86_pv_normalise_page’
#  958|               if ( (type > XEN_DOMCTL_PFINFO_L1TAB) && (pte & _PAGE_PSE) )
#  959|               {
#  960|->                 ERROR("Cannot migrate superpage (L%lu[%u]: 0x%016"PRIx64")",
#  961|                         type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT, i, pte);
#  962|                   errno = E2BIG;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def790]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:966:19: warning[-Wanalyzer-malloc-leak]: leak of ‘local_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1001:12: enter_function: entry to ‘x86_pv_normalise_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1010:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1014:8: branch_false: following ‘false’ branch (when ‘local_page’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: call_function: calling ‘normalise_pagetable’ from ‘x86_pv_normalise_page’
#  964|               }
#  965|   
#  966|->             if ( !mfn_in_pseudophysmap(ctx, mfn) )
#  967|               {
#  968|                   if ( !(ctx->dominfo.flags & XEN_DOMINF_paused) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def791]
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:972:21: warning[-Wanalyzer-malloc-leak]: leak of ‘local_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1001:12: enter_function: entry to ‘x86_pv_normalise_page’
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1010:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1013:18: acquire_memory: allocated here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1014:8: branch_false: following ‘false’ branch (when ‘local_page’ is non-NULL)...
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: branch_false: ...to here
xen-4.20.2/tools/libs/guest/xg_sr_save_x86_pv.c:1021:10: call_function: calling ‘normalise_pagetable’ from ‘x86_pv_normalise_page’
#  970|                   else
#  971|                   {
#  972|->                     ERROR("Bad mfn for L%lu[%u]",
#  973|                             type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT, i);
#  974|                       dump_bad_pseudophysmap_entry(ctx, mfn);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def792]
xen-4.20.2/tools/libs/hypfs/core.c:60:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fshdl’
xen-4.20.2/tools/libs/hypfs/core.c:48:30: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:50:8: branch_false: following ‘false’ branch (when ‘fshdl’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:53:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:57:8: branch_true: following ‘true’ branch (when ‘logger’ is NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:60:13: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:60:13: throw: if ‘xtl_createlogger_stdiostream’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:60:13: danger: ‘fshdl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   58|           fshdl->logger = fshdl->logger_tofree =
#   59|               (xentoollog_logger*)
#   60|->             xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
#   61|           if (!fshdl->logger)
#   62|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def793]
xen-4.20.2/tools/libs/hypfs/core.c:65:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fshdl’
xen-4.20.2/tools/libs/hypfs/core.c:48:30: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:50:8: branch_false: following ‘false’ branch (when ‘fshdl’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:53:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:57:8: branch_false: following ‘false’ branch (when ‘logger’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:65:33: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:65:20: throw: if ‘xencall_open’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:65:20: danger: ‘fshdl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   63|       }
#   64|   
#   65|->     fshdl->xcall = xencall_open(fshdl->logger, 0);
#   66|       if (!fshdl->xcall)
#   67|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def794]
xen-4.20.2/tools/libs/hypfs/core.c:70:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fshdl’
xen-4.20.2/tools/libs/hypfs/core.c:48:30: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:50:8: branch_false: following ‘false’ branch (when ‘fshdl’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:53:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:57:8: branch_false: following ‘false’ branch (when ‘logger’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:65:33: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:66:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:70:9: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:70:9: throw: if ‘xencall5’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:70:9: danger: ‘fshdl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   68|   
#   69|       /* No need to remember supported version, we only support V1. */
#   70|->     if (xencall5(fshdl->xcall, __HYPERVISOR_hypfs_op,
#   71|                    XEN_HYPFS_OP_get_version, 0, 0, 0, 0) < 0)
#   72|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def795]
xen-4.20.2/tools/libs/hypfs/core.c:77:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fshdl’
xen-4.20.2/tools/libs/hypfs/core.c:48:30: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:50:8: branch_false: following ‘false’ branch (when ‘fshdl’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:53:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:57:8: branch_false: following ‘false’ branch (when ‘logger’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:65:33: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:77:5: throw: if ‘xencall_close’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:77:5: danger: ‘fshdl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   75|   
#   76|   err:
#   77|->     xencall_close(fshdl->xcall);
#   78|       xtl_logger_destroy(fshdl->logger_tofree);
#   79|       free(fshdl);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def796]
xen-4.20.2/tools/libs/hypfs/core.c:78:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fshdl’
xen-4.20.2/tools/libs/hypfs/core.c:48:30: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:50:8: branch_false: following ‘false’ branch (when ‘fshdl’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:53:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:57:8: branch_false: following ‘false’ branch (when ‘logger’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:65:33: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:78:5: throw: if ‘xtl_logger_destroy’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:78:5: danger: ‘fshdl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   76|   err:
#   77|       xencall_close(fshdl->xcall);
#   78|->     xtl_logger_destroy(fshdl->logger_tofree);
#   79|       free(fshdl);
#   80|       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def797]
xen-4.20.2/tools/libs/hypfs/core.c:144:15: warning[-Wanalyzer-malloc-leak]: leak of ‘content’
xen-4.20.2/tools/libs/hypfs/core.c:134:8: branch_false: following ‘false’ branch (when ‘workbuf’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:137:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:145:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:148:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:150:12: branch_false: following ‘false’ branch (when ‘content’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:154:16: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:144:15: throw: if ‘inflate’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:144:15: danger: ‘content’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  142|           z.next_out = workbuf;
#  143|           z.avail_out = BUF_SIZE;
#  144|->         ret = inflate(&z, Z_SYNC_FLUSH);
#  145|           if (ret != Z_OK && ret != Z_STREAM_END)
#  146|               break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def798]
xen-4.20.2/tools/libs/hypfs/core.c:144:15: warning[-Wanalyzer-malloc-leak]: leak of ‘workbuf’
xen-4.20.2/tools/libs/hypfs/core.c:133:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:134:8: branch_false: following ‘false’ branch (when ‘workbuf’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:137:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:144:15: throw: if ‘inflate’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:144:15: danger: ‘workbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  142|           z.next_out = workbuf;
#  143|           z.avail_out = BUF_SIZE;
#  144|->         ret = inflate(&z, Z_SYNC_FLUSH);
#  145|           if (ret != Z_OK && ret != Z_STREAM_END)
#  146|               break;

Error: CPPCHECK_WARNING (CWE-401): [#def799]
xen-4.20.2/tools/libs/hypfs/core.c:149: error[memleakOnRealloc]: Common realloc mistake: 'content' nulled but not freed upon failure
#  147|   
#  148|           out_sz = z.next_out - workbuf;
#  149|->         content = realloc(content, *sz + out_sz + 1);
#  150|           if (!content) {
#  151|               ret = Z_MEM_ERROR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def800]
xen-4.20.2/tools/libs/hypfs/core.c:158:5: warning[-Wanalyzer-malloc-leak]: leak of ‘content’
xen-4.20.2/tools/libs/hypfs/core.c:134:8: branch_false: following ‘false’ branch (when ‘workbuf’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:137:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:145:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:148:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:150:12: branch_false: following ‘false’ branch (when ‘content’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:154:16: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:158:5: throw: if ‘inflateEnd’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:158:5: danger: ‘content’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  156|       }
#  157|   
#  158|->     inflateEnd(&z);
#  159|       if (ret != Z_STREAM_END) {
#  160|           free(content);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def801]
xen-4.20.2/tools/libs/hypfs/core.c:158:5: warning[-Wanalyzer-malloc-leak]: leak of ‘workbuf’
xen-4.20.2/tools/libs/hypfs/core.c:133:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:134:8: branch_false: following ‘false’ branch (when ‘workbuf’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:137:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_false: following ‘false’ branch (when ‘ret != 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:158:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:158:5: throw: if ‘inflateEnd’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:158:5: danger: ‘workbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  156|       }
#  157|   
#  158|->     inflateEnd(&z);
#  159|       if (ret != Z_STREAM_END) {
#  160|           free(content);

Error: GCC_ANALYZER_WARNING (CWE-415): [#def802]
xen-4.20.2/tools/libs/hypfs/core.c:160:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘content’
xen-4.20.2/tools/libs/hypfs/core.c:134:8: branch_false: following ‘false’ branch (when ‘workbuf’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:137:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:145:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:148:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:149:19: release_memory: first ‘free’ here
xen-4.20.2/tools/libs/hypfs/core.c:150:12: branch_false: following ‘false’ branch (when ‘content’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:154:16: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:145:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:148:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:150:12: branch_true: following ‘true’ branch (when ‘content’ is NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:158:5: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:159:8: branch_true: following ‘true’ branch (when ‘ret != 1’)...
xen-4.20.2/tools/libs/hypfs/core.c:160:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:160:9: danger: second ‘free’ here; first ‘free’ was at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  158|       inflateEnd(&z);
#  159|       if (ret != Z_STREAM_END) {
#  160|->         free(content);
#  161|           content = NULL;
#  162|           errno = EIO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def803]
xen-4.20.2/tools/libs/hypfs/core.c:166:1: warning[-Wanalyzer-malloc-leak]: leak of ‘content’
xen-4.20.2/tools/libs/hypfs/core.c:134:8: branch_false: following ‘false’ branch (when ‘workbuf’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:137:5: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:145:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:148:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:150:12: branch_false: following ‘false’ branch (when ‘content’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:154:16: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:141:19: branch_true: following ‘true’ branch (when ‘ret == 0’)...
xen-4.20.2/tools/libs/hypfs/core.c:142:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:145:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:148:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:150:12: branch_true: following ‘true’ branch (when ‘content’ is NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:158:5: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:159:8: branch_true: following ‘true’ branch (when ‘ret != 1’)...
xen-4.20.2/tools/libs/hypfs/core.c:160:9: branch_true: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:166:1: danger: ‘content’ leaks here; was allocated at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  164|       free(workbuf);
#  165|       return content;
#  166|-> }
#  167|   
#  168|   static void xenhypfs_set_attrs(struct xen_hypfs_direntry *entry,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def804]
xen-4.20.2/tools/libs/hypfs/core.c:275:5: warning[-Wanalyzer-malloc-leak]: leak of ‘content’
xen-4.20.2/tools/libs/hypfs/core.c:211:7: enter_function: entry to ‘xenhypfs_read_raw’
xen-4.20.2/tools/libs/hypfs/core.c:222:11: call_function: calling ‘xenhypfs_get_pathbuf’ from ‘xenhypfs_read_raw’
xen-4.20.2/tools/libs/hypfs/core.c:222:11: return_function: returning to ‘xenhypfs_read_raw’ from ‘xenhypfs_get_pathbuf’
xen-4.20.2/tools/libs/hypfs/core.c:223:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:223:8: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:229:12: branch_false: following ‘false’ branch (when ‘retbuf’ is NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:232:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:233:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:239:15: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:249:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:250:8: branch_false: following ‘false’ branch (when ‘content’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:252:21: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:263:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:269:31: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:275:5: throw: if ‘xencall_free_buffer’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:275:5: danger: ‘content’ leaks here; was allocated at [(17)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/16)
#  273|    out:
#  274|       ret = errno;
#  275|->     xencall_free_buffer(fshdl->xcall, path_buf);
#  276|       xencall_free_buffer(fshdl->xcall, retbuf);
#  277|       errno = ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def805]
xen-4.20.2/tools/libs/hypfs/core.c:276:5: warning[-Wanalyzer-malloc-leak]: leak of ‘content’
xen-4.20.2/tools/libs/hypfs/core.c:211:7: enter_function: entry to ‘xenhypfs_read_raw’
xen-4.20.2/tools/libs/hypfs/core.c:222:11: call_function: calling ‘xenhypfs_get_pathbuf’ from ‘xenhypfs_read_raw’
xen-4.20.2/tools/libs/hypfs/core.c:222:11: return_function: returning to ‘xenhypfs_read_raw’ from ‘xenhypfs_get_pathbuf’
xen-4.20.2/tools/libs/hypfs/core.c:223:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:223:8: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:229:12: branch_false: following ‘false’ branch (when ‘retbuf’ is NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:232:18: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:233:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:239:15: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:249:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/hypfs/core.c:250:8: branch_false: following ‘false’ branch (when ‘content’ is non-NULL)...
xen-4.20.2/tools/libs/hypfs/core.c:252:21: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:263:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/hypfs/core.c:269:31: branch_false: ...to here
xen-4.20.2/tools/libs/hypfs/core.c:276:5: throw: if ‘xencall_free_buffer’ throws an exception...
xen-4.20.2/tools/libs/hypfs/core.c:276:5: danger: ‘content’ leaks here; was allocated at [(17)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/16)
#  274|       ret = errno;
#  275|       xencall_free_buffer(fshdl->xcall, path_buf);
#  276|->     xencall_free_buffer(fshdl->xcall, retbuf);
#  277|       errno = ret;
#  278|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def806]
xen-4.20.2/tools/libs/light/flexarray.c:54:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/light/flexarray.c:86:5: enter_function: entry to ‘flexarray_vappend’
xen-4.20.2/tools/libs/light/flexarray.c:92:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/libs/light/flexarray.c:93:18: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
xen-4.20.2/tools/libs/light/flexarray.c:94:14: call_function: inlined call to ‘flexarray_append’ from ‘flexarray_vappend’
#   52|   
#   53|       newsize = array->size + extents;
#   54|->     GCREALLOC_ARRAY(array->data, newsize);
#   55|       array->size += extents;
#   56|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def807]
xen-4.20.2/tools/libs/light/libxl.c:78:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
xen-4.20.2/tools/libs/light/libxl.c:26:8: branch_false: following ‘false’ branch (when ‘version == 0’)...
xen-4.20.2/tools/libs/light/libxl.c:28:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl.c:28:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl.c:29:8: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl.c:36:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl.c:78:9: throw: if ‘libxl__init_recursive_mutex’ throws an exception...
xen-4.20.2/tools/libs/light/libxl.c:78:9: danger: ‘ctx’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   76|       /* The mutex is special because we can't idempotently destroy it */
#   77|   
#   78|->     if (libxl__init_recursive_mutex(ctx, &ctx->lock) < 0) {
#   79|           LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex");
#   80|           free(ctx);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def808]
xen-4.20.2/tools/libs/light/libxl_bootloader.c:244:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*bl.outputpath, "r")’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:231:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:243:16: branch_true: following ‘true’ branch (when ‘l <= 8190’)...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:244:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:247:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:256:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:256:12: branch_true: following ‘true’ branch (when ‘l > 8191’)...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:257:13: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:257:13: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:244:17: danger: ‘fopen(*bl.outputpath, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  242|           while ((c = getc(f)) != EOF && c != '\0') {
#  243|               if (l < sizeof(buf)-1)
#  244|->                 buf[l] = c;
#  245|               l++;
#  246|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def809]
xen-4.20.2/tools/libs/light/libxl_bootloader.c:244:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*bl.outputpath, "r")’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:231:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:243:16: branch_true: following ‘true’ branch (when ‘l <= 8190’)...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:244:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:247:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:256:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:256:12: branch_true: following ‘true’ branch (when ‘l > 8191’)...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:257:13: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:257:13: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:244:17: danger: ‘fopen(*bl.outputpath, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  242|           while ((c = getc(f)) != EOF && c != '\0') {
#  243|               if (l < sizeof(buf)-1)
#  244|->                 buf[l] = c;
#  245|               l++;
#  246|           }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def810]
xen-4.20.2/tools/libs/light/libxl_bootloader.c:249:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*bl.outputpath, "r")’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:231:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:249:17: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:249:17: danger: ‘fopen(*bl.outputpath, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  247|           if (c == EOF) {
#  248|               if (ferror(f)) {
#  249|->                 LOGED(ERROR, bl->domid, "read bootloader output file %s",
#  250|                         bl->outputpath);
#  251|                   goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def811]
xen-4.20.2/tools/libs/light/libxl_bootloader.c:249:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*bl.outputpath, "r")’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:231:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:249:17: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:249:17: danger: ‘fopen(*bl.outputpath, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  247|           if (c == EOF) {
#  248|               if (ferror(f)) {
#  249|->                 LOGED(ERROR, bl->domid, "read bootloader output file %s",
#  250|                         bl->outputpath);
#  251|                   goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def812]
xen-4.20.2/tools/libs/light/libxl_bootloader.c:266:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*bl.outputpath, "r")’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:223:12: enter_function: entry to ‘parse_bootloader_result’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:231:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:247:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:256:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:266:13: call_function: calling ‘bootloader_result_command’ from ‘parse_bootloader_result’
#  264|   #define COMMAND(s) ((rhs = bootloader_result_command(gc, buf, s, sizeof(s)-1, bl->domid)))
#  265|   
#  266|->         if (COMMAND("kernel")) {
#  267|               bl->kernel->path = libxl__strdup(gc, rhs);
#  268|               libxl__file_reference_map(bl->kernel);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def813]
xen-4.20.2/tools/libs/light/libxl_bootloader.c:266:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*bl.outputpath, "r")’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:223:12: enter_function: entry to ‘parse_bootloader_result’
xen-4.20.2/tools/libs/light/libxl_bootloader.c:231:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:232:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:247:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_bootloader.c:256:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_bootloader.c:266:13: call_function: calling ‘bootloader_result_command’ from ‘parse_bootloader_result’
#  264|   #define COMMAND(s) ((rhs = bootloader_result_command(gc, buf, s, sizeof(s)-1, bl->domid)))
#  265|   
#  266|->         if (COMMAND("kernel")) {
#  267|               bl->kernel->path = libxl__strdup(gc, rhs);
#  268|               libxl__file_reference_map(bl->kernel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def814]
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:298:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘h’
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:204:5: enter_function: entry to ‘colo_proxy_setup’
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:211:14: release_memory: ‘buff’ is NULL
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:217:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:257:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:258:8: branch_false: following ‘false’ branch (when ‘skfd >= 0’)...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:262:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:269:8: branch_false: following ‘false’ branch (when ‘i != 11’)...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:274:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:278:15: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:283:18: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:284:11: call_function: calling ‘colo_proxy_send’ from ‘colo_proxy_setup’
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:284:11: return_function: returning to ‘colo_proxy_setup’ from ‘colo_proxy_send’
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:285:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:289:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:289:12: call_function: calling ‘colo_proxy_recv’ from ‘colo_proxy_setup’
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:289:12: return_function: returning to ‘colo_proxy_setup’ from ‘colo_proxy_recv’
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:296:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:296:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:297:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:297:9: release_memory: ‘buff’ is NULL
xen-4.20.2/tools/libs/light/libxl_colo_proxy.c:298:13: danger: dereference of NULL ‘h’
#  296|       if (size) {
#  297|           h = (struct nlmsghdr *)buff;
#  298|->         if (h->nlmsg_type == NLMSG_ERROR) {
#  299|               /* ack's type is NLMSG_ERROR */
#  300|               struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def815]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:87:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘policy’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:83:8: branch_true: following ‘true’ branch (when ‘policy’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:84:24: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:84:24: acquire_memory: this call could return NULL
xen-4.20.2/tools/libs/light/libxl_cpuid.c:87:9: danger: ‘policy’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   85|   
#   86|       list = &policy->cpuid;
#   87|->     if (*list != NULL) {
#   88|           for (i = 0; (*list)[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
#   89|               if ((*list)[i].input[0] == leaf && (*list)[i].input[1] == subleaf)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def816]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:137:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(unsigned int *)(&flags[4])’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:232:5: enter_function: entry to ‘libxl_cpuid_parse_config’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:358:8: branch_false: following ‘false’ branch (when ‘sep’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:361:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:363:30: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:364:38: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:370:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:370:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:373:12: call_function: inlined call to ‘bsearch’ from ‘libxl_cpuid_parse_config’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:377:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:380:31: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:392:16: call_function: calling ‘cpuid_add’ from ‘libxl_cpuid_parse_config’
#  135|       if (!strcmp(flag->name, "family")) {
#  136|           if (num < 16) {
#  137|->             memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
#  138|               memcpy(resstr + (32 - 8) - 20, "00000000", 8);
#  139|           } else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def817]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:149:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘resstr’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:101:12: enter_function: entry to ‘cpuid_add’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:104:35: call_function: calling ‘cpuid_find_match’ from ‘cpuid_add’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:104:35: return_function: returning to ‘cpuid_add’ from ‘cpuid_find_match’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:113:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:113:8: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:128:8: branch_true: following ‘true’ branch (when ‘resstr’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:129:18: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:129:18: acquire_memory: this call could return NULL
xen-4.20.2/tools/libs/light/libxl_cpuid.c:135:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:148:17: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:148:15: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:149:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:149:9: danger: ‘resstr’ could be NULL: unchecked value from [(17)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/16)
#  147|           }
#  148|       } else if (!strcmp(flag->name, "model")) {
#  149|->         memcpy(resstr + (32 - 4) - 16, flags, 4);
#  150|           memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
#  151|       } else {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def818]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:150:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(unsigned int *)(&flags[4])’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:232:5: enter_function: entry to ‘libxl_cpuid_parse_config’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:358:8: branch_false: following ‘false’ branch (when ‘sep’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:361:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:363:30: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:364:38: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:370:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:370:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:373:12: call_function: inlined call to ‘bsearch’ from ‘libxl_cpuid_parse_config’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:377:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:380:31: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:392:16: call_function: calling ‘cpuid_add’ from ‘libxl_cpuid_parse_config’
#  148|       } else if (!strcmp(flag->name, "model")) {
#  149|           memcpy(resstr + (32 - 4) - 16, flags, 4);
#  150|->         memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
#  151|       } else {
#  152|           memcpy(resstr + (32 - flag->length) - flag->bit, flags,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def819]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:168:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘policy’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:165:8: branch_true: following ‘true’ branch (when ‘policy’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:166:24: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:166:24: acquire_memory: this call could return NULL
xen-4.20.2/tools/libs/light/libxl_cpuid.c:168:9: danger: ‘policy’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  166|           policy = *pl = calloc(1, sizeof(*policy));
#  167|   
#  168|->     if (policy->msr != NULL) {
#  169|           for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
#  170|               if (policy->msr[i].index == idx) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def820]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:177:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:165:8: branch_true: following ‘true’ branch (when ‘policy’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:166:24: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:168:9: release_memory: using NULL here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:168:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:176:64: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:177:5: danger: dereference of NULL ‘realloc(*policy.msr, (long unsigned int)(i + 2) * 72) + (long unsigned int)i * 72’
#  175|   
#  176|       policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
#  177|->     policy->msr[i].index = idx;
#  178|       memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);
#  179|       policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';

Error: COMPILER_WARNING (CWE-704): [#def821]
xen-4.20.2/tools/libs/light/libxl_cpuid.c: scope_hint: In function ‘libxl_cpuid_parse_config_xend’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:447:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  447 |         endptr = strchr(str, '=');
#      |                ^
#  445|           }
#  446|           value = str[1] - 'a';
#  447|->         endptr = strchr(str, '=');
#  448|           if (value > 3 || endptr == NULL) {
#  449|               return 4;

Error: COMPILER_WARNING (CWE-704): [#def822]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:447:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  445|           }
#  446|           value = str[1] - 'a';
#  447|->         endptr = strchr(str, '=');
#  448|           if (value > 3 || endptr == NULL) {
#  449|               return 4;

Error: COMPILER_WARNING (CWE-704): [#def823]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:452:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  452 |         endptr = strchr(str, ',');
#      |                ^
#  450|           }
#  451|           str = endptr + 1;
#  452|->         endptr = strchr(str, ',');
#  453|           if (endptr == NULL) {
#  454|               endptr = strchr(str, 0);

Error: COMPILER_WARNING (CWE-704): [#def824]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:452:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  450|           }
#  451|           str = endptr + 1;
#  452|->         endptr = strchr(str, ',');
#  453|           if (endptr == NULL) {
#  454|               endptr = strchr(str, 0);

Error: COMPILER_WARNING (CWE-704): [#def825]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:454:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  454 |             endptr = strchr(str, 0);
#      |                    ^
#  452|           endptr = strchr(str, ',');
#  453|           if (endptr == NULL) {
#  454|->             endptr = strchr(str, 0);
#  455|           }
#  456|           if (endptr - str != 32) {

Error: COMPILER_WARNING (CWE-704): [#def826]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:454:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  452|           endptr = strchr(str, ',');
#  453|           if (endptr == NULL) {
#  454|->             endptr = strchr(str, 0);
#  455|           }
#  456|           if (endptr - str != 32) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def827]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:460:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘calloc(33, 1)’ where non-null expected
xen-4.20.2/tools/libs/light/libxl_cpuid.c:414:5: enter_function: entry to ‘libxl_cpuid_parse_config_xend’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:424:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:427:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:437:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:437:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:441:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:441:13: call_function: calling ‘cpuid_find_match’ from ‘libxl_cpuid_parse_config_xend’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:441:13: return_function: returning to ‘libxl_cpuid_parse_config_xend’ from ‘cpuid_find_match’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:442:28: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:443:12: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:443:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:448:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:453:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:456:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:456:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:459:32: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:459:32: acquire_memory: this call could return NULL
xen-4.20.2/tools/libs/light/libxl_cpuid.c:460:9: danger: argument 1 (‘calloc(33, 1)’) from [(28)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/27) could be NULL where non-null expected
#  458|           }
#  459|           entry->policy[value] = calloc(32 + 1, 1);
#  460|->         strncpy(entry->policy[value], str, 32);
#  461|           entry->policy[value][32] = 0;
#  462|           if (*endptr == 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def828]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:670:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:634:5: enter_function: entry to ‘libxl__cpuid_policy_list_parse_json’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:669:13: call_function: inlined call to ‘libxl__json_object_get_array’ from ‘libxl__cpuid_policy_list_parse_json’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:670:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:670:10: danger: dereference of NULL ‘<unknown>’
#  668|   
#  669|       array = libxl__json_object_get_array(co);
#  670|->     if (!array->count)
#  671|           goto cpuid_empty;
#  672|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def829]
xen-4.20.2/tools/libs/light/libxl_cpuid.c:744:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
xen-4.20.2/tools/libs/light/libxl_cpuid.c:634:5: enter_function: entry to ‘libxl__cpuid_policy_list_parse_json’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:714:8: branch_false: following ‘false’ branch (when ‘cpuid_only == 0’)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:717:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:722:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:724:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:730:17: branch_true: following ‘true’ branch (when ‘i < size’)...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:733:13: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:733:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:736:14: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_cpuid.c:740:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:741:24: call_function: inlined call to ‘libxl__json_object_get_integer’ from ‘libxl__cpuid_policy_list_parse_json’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:743:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_cpuid.c:744:13: call_function: inlined call to ‘libxl__json_object_get_string’ from ‘libxl__cpuid_policy_list_parse_json’
xen-4.20.2/tools/libs/light/libxl_cpuid.c:744:13: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  742|           r = libxl__json_map_get("policy", t, JSON_STRING);
#  743|           if (!r) return ERROR_FAIL;
#  744|->         if (strlen(libxl__json_object_get_string(r)) !=
#  745|               ARRAY_SIZE(msr[i].policy) - 1)
#  746|               return ERROR_FAIL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def830]
xen-4.20.2/tools/libs/light/libxl_device.c:1311:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/libxl_device.c:1231:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:1235:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:1235:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:1262:15: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:1282:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:1283:5: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:1303:14: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_device.c:1304:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:1310:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:1311:17: throw: if ‘libxl__sprintf’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_device.c:1311:17: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 1309|   
# 1310|       aes->ao = ao;
# 1311|->     aes->what = GCSPRINTF("%s %s", args[0], args[1]);
# 1312|       aes->env = env;
# 1313|       aes->args = args;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def831]
xen-4.20.2/tools/libs/light/libxl_device.c:2143:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dir’
xen-4.20.2/tools/libs/light/libxl_device.c:2117:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:2124:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:2126:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:2133:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:2133:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:2136:32: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:2139:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:2140:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:2142:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:2143:22: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:2143:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_device.c:2143:43: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_device.c:2143:43: danger: dereference of NULL ‘dir’
# 2141|   
# 2142|           if (dt->from_xenstore) {
# 2143|->             int nr = dt->get_num ? *num : atoi(*dir);
# 2144|               char *device_path = dt->get_num ? path :
# 2145|                   GCSPRINTF("%s/%d", path, nr);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def832]
xen-4.20.2/tools/libs/light/libxl_disk.c:233:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘creat(libxl__sprintf(&*gc_49(D)->owner.nogc_gc, "/var/run/xen/empty-cdrom.%u",  target_domid), 256)’
xen-4.20.2/tools/libs/light/libxl_disk.c:156:12: enter_function: entry to ‘libxl__device_disk_setdefault’
xen-4.20.2/tools/libs/light/libxl_disk.c:167:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:169:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:210:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:211:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:210:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:212:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:210:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:213:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:210:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:217:13: call_function: inlined call to ‘libxl__gc_owner’ from ‘libxl__device_disk_setdefault’
xen-4.20.2/tools/libs/light/libxl_disk.c:226:14: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_disk.c:227:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:233:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:233:9: danger: ‘creat(libxl__sprintf(&*gc_49(D)->owner.nogc_gc, "/var/run/xen/empty-cdrom.%u",  target_domid), 256)’ leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  231|           }
#  232|   
#  233|->         close(fd);
#  234|       }
#  235|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def833]
xen-4.20.2/tools/libs/light/libxl_disk.c:892:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
xen-4.20.2/tools/libs/light/libxl_disk.c:860:17: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:865:20: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:866:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:871:15: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:872:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:872:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:882:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_disk.c:886:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_disk.c:892:17: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  890|   
#  891|               opaque_str = libxl__json_object_get_string(opaque);
#  892|->             if (strcmp(opaque_str, needle) == 0) {
#  893|                   return libxl__json_object_get_integer(fdset_id);
#  894|               }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def834]
xen-4.20.2/tools/libs/light/libxl_dm.c:1138:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/libs/light/libxl_dm.c:3117:13: enter_function: entry to ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: call_function: calling ‘libxl__dm_vnc’ from ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: return_function: returning to ‘device_model_launch’ from ‘libxl__dm_vnc’
xen-4.20.2/tools/libs/light/libxl_dm.c:3140:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3145:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: call_function: calling ‘libxl__pre_open_qmp_socket’ from ‘device_model_launch’
# 1136|       }
# 1137|   
# 1138|->     rc = libxl__prepare_sockaddr_un(gc, &un, path, "QEMU's QMP socket");
# 1139|       if (rc)
# 1140|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def835]
xen-4.20.2/tools/libs/light/libxl_dm.c:1142:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/libs/light/libxl_dm.c:3117:13: enter_function: entry to ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: call_function: calling ‘libxl__dm_vnc’ from ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: return_function: returning to ‘device_model_launch’ from ‘libxl__dm_vnc’
xen-4.20.2/tools/libs/light/libxl_dm.c:3140:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3145:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: call_function: calling ‘libxl__pre_open_qmp_socket’ from ‘device_model_launch’
# 1140|           goto out;
# 1141|   
# 1142|->     rc = libxl__remove_file(gc, path);
# 1143|       if (rc)
# 1144|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def836]
xen-4.20.2/tools/libs/light/libxl_dm.c:1155:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/libs/light/libxl_dm.c:3117:13: enter_function: entry to ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: call_function: calling ‘libxl__dm_vnc’ from ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: return_function: returning to ‘device_model_launch’ from ‘libxl__dm_vnc’
xen-4.20.2/tools/libs/light/libxl_dm.c:3140:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3145:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: call_function: calling ‘libxl__pre_open_qmp_socket’ from ‘device_model_launch’
# 1153|       r = listen(fd, 1);
# 1154|       if (r < 0) {
# 1155|->         LOGED(ERROR, domid, "listen() failed");
# 1156|           rc = ERROR_FAIL;
# 1157|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def837]
xen-4.20.2/tools/libs/light/libxl_dm.c:1165:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/libs/light/libxl_dm.c:3117:13: enter_function: entry to ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: call_function: calling ‘libxl__dm_vnc’ from ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: return_function: returning to ‘device_model_launch’ from ‘libxl__dm_vnc’
xen-4.20.2/tools/libs/light/libxl_dm.c:3140:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3145:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: call_function: calling ‘libxl__pre_open_qmp_socket’ from ‘device_model_launch’
# 1163|   out:
# 1164|       if (rc && fd >= 0)
# 1165|->         close(fd);
# 1166|       return rc;
# 1167|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def838]
xen-4.20.2/tools/libs/light/libxl_dm.c:2241:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘null’
xen-4.20.2/tools/libs/light/libxl_dm.c:3610:6: enter_function: entry to ‘libxl__spawn_qemu_xenpv_backend’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3685:5: call_function: calling ‘dmss_dispose’ from ‘libxl__spawn_qemu_xenpv_backend’
# 2239|   static void dmss_dispose(libxl__gc *gc, libxl__dm_spawn_state *dmss)
# 2240|   {
# 2241|->     libxl__ev_qmp_dispose(gc, &dmss->qmp);
# 2242|       libxl__ev_time_deregister(gc, &dmss->timeout);
# 2243|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def839]
xen-4.20.2/tools/libs/light/libxl_dm.c:2242:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘null’
xen-4.20.2/tools/libs/light/libxl_dm.c:3610:6: enter_function: entry to ‘libxl__spawn_qemu_xenpv_backend’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3685:5: call_function: calling ‘dmss_dispose’ from ‘libxl__spawn_qemu_xenpv_backend’
# 2240|   {
# 2241|       libxl__ev_qmp_dispose(gc, &dmss->qmp);
# 2242|->     libxl__ev_time_deregister(gc, &dmss->timeout);
# 2243|   }
# 2244|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def840]
xen-4.20.2/tools/libs/light/libxl_dm.c:3049:14: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
xen-4.20.2/tools/libs/light/libxl_dm.c:3022:13: enter_function: entry to ‘device_model_probe_cmdline’
xen-4.20.2/tools/libs/light/libxl_dm.c:3028:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3028:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3037:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3042:13: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3043:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3047:19: call_function: inlined call to ‘libxl__json_object_get_string’ from ‘device_model_probe_cmdline’
xen-4.20.2/tools/libs/light/libxl_dm.c:3049:14: danger: argument 2 (‘<unknown>’) NULL where non-null expected
# 3047|           opt_str = libxl__json_object_get_string(o);
# 3048|   
# 3049|->         if (!strcmp("run-with", opt_str)) {
# 3050|               const libxl__json_object *params;
# 3051|               const libxl__json_object *item;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def841]
xen-4.20.2/tools/libs/light/libxl_dm.c:3060:22: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
xen-4.20.2/tools/libs/light/libxl_dm.c:3022:13: enter_function: entry to ‘device_model_probe_cmdline’
xen-4.20.2/tools/libs/light/libxl_dm.c:3028:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3028:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3037:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3042:13: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3043:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3047:19: call_function: inlined call to ‘libxl__json_object_get_string’ from ‘device_model_probe_cmdline’
xen-4.20.2/tools/libs/light/libxl_dm.c:3054:29: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3055:21: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3056:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3060:22: call_function: inlined call to ‘libxl__json_object_get_string’ from ‘device_model_probe_cmdline’
xen-4.20.2/tools/libs/light/libxl_dm.c:3060:22: danger: argument 2 (‘<unknown>’) NULL where non-null expected
# 3058|                       goto out;
# 3059|                   }
# 3060|->                 if (!strcmp("chroot", libxl__json_object_get_string(o))) {
# 3061|                       dmss->qemu_opts.have_runwith_chroot = true;
# 3062|                   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def842]
xen-4.20.2/tools/libs/light/libxl_dm.c:3359:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
xen-4.20.2/tools/libs/light/libxl_dm.c:3331:13: enter_function: entry to ‘device_model_qmp_cb’
xen-4.20.2/tools/libs/light/libxl_dm.c:3343:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3346:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3347:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3354:14: call_function: inlined call to ‘libxl__json_object_get_string’ from ‘device_model_qmp_cb’
xen-4.20.2/tools/libs/light/libxl_dm.c:3355:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3359:9: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 3357|       else
# 3358|           expected_state = "paused";
# 3359|->     if (strcmp(status, expected_state)) {
# 3360|           LOGD(ERROR, ev->domid, "Unexpected QEMU status: %s", status);
# 3361|           rc = ERROR_NOT_READY;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def843]
xen-4.20.2/tools/libs/light/libxl_dm.c:3582:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/libs/light/libxl_dm.c:3573:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3575:41: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3576:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3582:33: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3582:33: danger: dereference of NULL ‘libxl__dm_vnc(((libxl__dm_spawn_state *)((char *)qmp + 304))[16470307208669242].guest_config)’
# 3580|       rc = libxl__xs_printf(gc, XBT_NULL,
# 3581|                             GCSPRINTF("%s/console/vnc-pass", dompath),
# 3582|->                           "%s", vnc->passwd);
# 3583|   
# 3584|   out:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def844]
xen-4.20.2/tools/libs/light/libxl_dm.c:3659:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3659:25: throw: if ‘libxl__zalloc’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3659:25: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
# 3657|        * device_model_spawn_outcome doesn't try to unlink it.
# 3658|        */
# 3659|->     dmss->build_state = libxl__zalloc(gc, sizeof(*dmss->build_state));
# 3660|       dmss->build_state->saved_state = 0;
# 3661|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def845]
xen-4.20.2/tools/libs/light/libxl_dm.c:3662:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3662:24: throw: if ‘libxl__sprintf’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3662:24: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 3660|       dmss->build_state->saved_state = 0;
# 3661|   
# 3662|->     dmss->spawn.what = GCSPRINTF("domain %u Qdisk backend", domid);
# 3663|       dmss->spawn.xspath = GCSPRINTF("device-model/%u/state", domid);
# 3664|       dmss->spawn.timeout_ms = LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def846]
xen-4.20.2/tools/libs/light/libxl_dm.c:3663:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3663:26: throw: if ‘libxl__sprintf’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3663:26: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 3661|   
# 3662|       dmss->spawn.what = GCSPRINTF("domain %u Qdisk backend", domid);
# 3663|->     dmss->spawn.xspath = GCSPRINTF("device-model/%u/state", domid);
# 3664|       dmss->spawn.timeout_ms = LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000;
# 3665|       /*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def847]
xen-4.20.2/tools/libs/light/libxl_dm.c:3670:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3670:27: throw: if ‘libxl__sprintf’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3670:27: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 3668|        * so save it in the current domain libxl private dir.
# 3669|        */
# 3670|->     dmss->spawn.pidpath = GCSPRINTF("libxl/%u/qdisk-backend-pid", domid);
# 3671|       dmss->spawn.midproc_cb = libxl__spawn_record_pid;
# 3672|       dmss->spawn.confirm_cb = device_model_confirm;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def848]
xen-4.20.2/tools/libs/light/libxl_dm.c:3675:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3675:10: throw: if ‘libxl__spawn_spawn’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3675:10: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 3673|       dmss->spawn.failure_cb = device_model_startup_failed;
# 3674|       dmss->spawn.detached_cb = device_model_detached;
# 3675|->     rc = libxl__spawn_spawn(egc, &dmss->spawn);
# 3676|       if (rc < 0)
# 3677|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def849]
xen-4.20.2/tools/libs/light/libxl_dm.c:3686:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘null’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3686:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3686:25: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3686:25: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3686:25: danger: ‘null’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 3684|   out:
# 3685|       dmss_dispose(gc, dmss);
# 3686|->     if (logfile_w >= 0) close(logfile_w);
# 3687|       if (null >= 0) close(null);
# 3688|       /* callback on error only, success goes via dmss->spawn.*_cb */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def850]
xen-4.20.2/tools/libs/light/libxl_dm.c:3687:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘null’
xen-4.20.2/tools/libs/light/libxl_dm.c:3644:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3648:12: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_dm.c:3649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3654:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3687:8: branch_true: following ‘true’ branch (when ‘null >= 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3687:20: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3687:20: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_dm.c:3687:20: danger: ‘null’ leaks here; was opened at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 3685|       dmss_dispose(gc, dmss);
# 3686|       if (logfile_w >= 0) close(logfile_w);
# 3687|->     if (null >= 0) close(null);
# 3688|       /* callback on error only, success goes via dmss->spawn.*_cb */
# 3689|       if (rc) dmss->callback(egc, dmss, rc);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def851]
xen-4.20.2/tools/libs/light/libxl_domain.c:1377:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(libxl__domid_history_path(gc, ".new"), "a")’
xen-4.20.2/tools/libs/light/libxl_domain.c:1402:12: enter_function: entry to ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1411:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1417:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1417:10: call_function: calling ‘libxl__open_domid_history’ from ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1417:10: return_function: returning to ‘libxl__mark_domid_recent’ from ‘libxl__open_domid_history’
xen-4.20.2/tools/libs/light/libxl_domain.c:1418:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1420:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1420:11: call_function: calling ‘libxl__domid_history_path’ from ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1420:11: return_function: returning to ‘libxl__mark_domid_recent’ from ‘libxl__domid_history_path’
xen-4.20.2/tools/libs/light/libxl_domain.c:1421:10: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_domain.c:1422:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1422:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1431:14: call_function: inlined call to ‘libxl__read_recent’ from ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1434:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1434:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1437:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1439:13: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_domain.c:1431:14: call_function: inlined call to ‘libxl__read_recent’ from ‘libxl__mark_domid_recent’
# 1375|                                 unsigned long *sec, unsigned int *domid)
# 1376|   {
# 1377|->     if (!ctxt->f) {
# 1378|           *domid = INVALID_DOMID;
# 1379|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def852]
xen-4.20.2/tools/libs/light/libxl_domain.c:1377:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(libxl__domid_history_path(gc, ".new"), "a")’
xen-4.20.2/tools/libs/light/libxl_domain.c:1402:12: enter_function: entry to ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1411:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1417:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1417:10: call_function: calling ‘libxl__open_domid_history’ from ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1417:10: return_function: returning to ‘libxl__mark_domid_recent’ from ‘libxl__open_domid_history’
xen-4.20.2/tools/libs/light/libxl_domain.c:1418:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1420:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1420:11: call_function: calling ‘libxl__domid_history_path’ from ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1420:11: return_function: returning to ‘libxl__mark_domid_recent’ from ‘libxl__domid_history_path’
xen-4.20.2/tools/libs/light/libxl_domain.c:1421:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_domain.c:1422:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1422:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1431:14: call_function: inlined call to ‘libxl__read_recent’ from ‘libxl__mark_domid_recent’
xen-4.20.2/tools/libs/light/libxl_domain.c:1432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1434:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1434:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_domain.c:1437:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_domain.c:1439:13: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_domain.c:1431:14: call_function: inlined call to ‘libxl__read_recent’ from ‘libxl__mark_domid_recent’
# 1375|                                 unsigned long *sec, unsigned int *domid)
# 1376|   {
# 1377|->     if (!ctxt->f) {
# 1378|           *domid = INVALID_DOMID;
# 1379|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def853]
xen-4.20.2/tools/libs/light/libxl_event.c:1729:22: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1727|   void libxl__pipe_close(int fds[2])
# 1728|   {
# 1729|->     if (fds[0] >= 0) close(fds[0]);
# 1730|       if (fds[1] >= 0) close(fds[1]);
# 1731|       fds[0] = fds[1] = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def854]
xen-4.20.2/tools/libs/light/libxl_event.c:1730:22: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1728|   {
# 1729|       if (fds[0] >= 0) close(fds[0]);
# 1730|->     if (fds[1] >= 0) close(fds[1]);
# 1731|       fds[0] = fds[1] = -1;
# 1732|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def855]
xen-4.20.2/tools/libs/light/libxl_event.c:1738:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1736|       int r, rc;
# 1737|   
# 1738|->     r = libxl_pipe(ctx, fds);
# 1739|       if (r) {
# 1740|           fds[0] = fds[1] = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def856]
xen-4.20.2/tools/libs/light/libxl_event.c:1745:10: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1743|       }
# 1744|   
# 1745|->     rc = libxl_fd_set_nonblock(ctx, fds[0], 1);
# 1746|       if (rc) goto out;
# 1747|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def857]
xen-4.20.2/tools/libs/light/libxl_event.c:1748:10: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1746|       if (rc) goto out;
# 1747|   
# 1748|->     rc = libxl_fd_set_nonblock(ctx, fds[1], 1);
# 1749|       if (rc) goto out;
# 1750|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def858]
xen-4.20.2/tools/libs/light/libxl_event.c:1803:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1801|       if (rc) goto out;
# 1802|   
# 1803|->     libxl_fd_set_cloexec(CTX, p->wakeup_pipe[0], 1);
# 1804|       libxl_fd_set_cloexec(CTX, p->wakeup_pipe[1], 1);
# 1805|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def859]
xen-4.20.2/tools/libs/light/libxl_event.c:1804:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1802|   
# 1803|       libxl_fd_set_cloexec(CTX, p->wakeup_pipe[0], 1);
# 1804|->     libxl_fd_set_cloexec(CTX, p->wakeup_pipe[1], 1);
# 1805|   
# 1806|       return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def860]
xen-4.20.2/tools/libs/light/libxl_event.c:1829:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_false: following ‘false’ branch (when ‘how’ is NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2145:22: call_function: calling ‘libxl__poller_get’ from ‘libxl__ao_create’
# 1827|           XEN_LIST_REMOVE(p, entry);
# 1828|       } else {
# 1829|->         p = libxl__zalloc(NOGC, sizeof(*p));
# 1830|   
# 1831|           rc = libxl__poller_init(gc, p);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def861]
xen-4.20.2/tools/libs/light/libxl_event.c:2148:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ao’
xen-4.20.2/tools/libs/light/libxl_event.c:2125:12: enter_function: entry to ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2131:10: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_event.c:2132:8: branch_false: following ‘false’ branch (when ‘ao’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2134:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2137:5: call_function: inlined call to ‘ao__manip_enter’ from ‘libxl__ao_create’
xen-4.20.2/tools/libs/light/libxl_event.c:2142:8: branch_true: following ‘true’ branch (when ‘how’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_event.c:2143:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_event.c:2148:5: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_event.c:2148:5: danger: ‘ao’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
# 2146|           if (!ao->poller) goto out;
# 2147|       }
# 2148|->     libxl__log(ctx,XTL_DEBUG,-1,file,line,func,domid,
# 2149|                  "ao %p: create: how=%p callback=%p poller=%p",
# 2150|                  ao, how, ao->how.callback, ao->poller);

Error: COMPILER_WARNING (CWE-704): [#def862]
xen-4.20.2/tools/libs/light/libxl_internal.c: scope_hint: In function ‘libxl__dirname’
xen-4.20.2/tools/libs/light/libxl_internal.c:207:15: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  207 |     char *c = strrchr(s, '/');
#      |               ^~~~~~~
#  205|   char *libxl__dirname(libxl__gc *gc, const char *s)
#  206|   {
#  207|->     char *c = strrchr(s, '/');
#  208|   
#  209|       if (!c)

Error: COMPILER_WARNING (CWE-704): [#def863]
xen-4.20.2/tools/libs/light/libxl_internal.c:207:15: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  205|   char *libxl__dirname(libxl__gc *gc, const char *s)
#  206|   {
#  207|->     char *c = strrchr(s, '/');
#  208|   
#  209|       if (!c)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def864]
xen-4.20.2/tools/libs/light/libxl_internal.h:839:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev, 0)’
xen-4.20.2/tools/libs/light/libxl_utils.c:1225:5: enter_function: entry to ‘libxl__random_bytes’
xen-4.20.2/tools/libs/light/libxl_utils.c:1231:10: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_utils.c:1232:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1236:11: call_function: inlined call to ‘libxl__gc_owner’ from ‘libxl__random_bytes’
xen-4.20.2/tools/libs/light/libxl_utils.c:1236:11: throw: if ‘libxl_fd_set_cloexec’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:1236:11: call_function: inlined call to ‘libxl__gc_owner’ from ‘libxl__random_bytes’
#  837|   static inline libxl_ctx *libxl__gc_owner(libxl__gc *gc)
#  838|   {
#  839|->     return gc->owner;
#  840|   }
#  841|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def865]
xen-4.20.2/tools/libs/light/libxl_internal.h:839:12: warning[-Wanalyzer-malloc-leak]: leak of ‘qmp_init_handler(gc,  domid)’
xen-4.20.2/tools/libs/light/libxl_qmp.c:739:12: enter_function: entry to ‘qmp_run_command’
xen-4.20.2/tools/libs/light/libxl_qmp.c:746:11: call_function: calling ‘libxl__qmp_initialize’ from ‘qmp_run_command’
#  837|   static inline libxl_ctx *libxl__gc_owner(libxl__gc *gc)
#  838|   {
#  839|->     return gc->owner;
#  840|   }
#  841|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def866]
xen-4.20.2/tools/libs/light/libxl_internal.h:4852:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*((libxl__domain_build_state *)state).dm_monitor_fd’
xen-4.20.2/tools/libs/light/libxl_dm.c:3117:13: enter_function: entry to ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: call_function: calling ‘libxl__dm_vnc’ from ‘device_model_launch’
xen-4.20.2/tools/libs/light/libxl_dm.c:3125:33: return_function: returning to ‘device_model_launch’ from ‘libxl__dm_vnc’
xen-4.20.2/tools/libs/light/libxl_dm.c:3140:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3145:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3143:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_dm.c:3149:14: call_function: calling ‘libxl__pre_open_qmp_socket’ from ‘device_model_launch’
# 4850|   static inline const char *libxl__qemu_qmp_path(libxl__gc *gc, int domid)
# 4851|   {
# 4852|->     return GCSPRINTF("%s/qmp-libxl-%d", libxl__run_dir_path(), domid);
# 4853|   }
# 4854|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def867]
xen-4.20.2/tools/libs/light/libxl_json.c:1005:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’
xen-4.20.2/tools/libs/light/libxl_json.c:992:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_json.c:995:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_json.c:996:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_json.c:999:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_json.c:1000:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_json.c:1002:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_json.c:1002:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_json.c:1005:5: throw: if ‘yajl_gen_free’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_json.c:1005:5: danger: ‘ret’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1003|   
# 1004|   out:
# 1005|->     yajl_gen_free(hand);
# 1006|   
# 1007|       if (s != yajl_gen_status_ok) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def868]
xen-4.20.2/tools/libs/light/libxl_linux.c:257:21: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/bus/pci/devices")’
xen-4.20.2/tools/libs/light/libxl_linux.c:251:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_linux.c:252:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_linux.c:252:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_linux.c:257:21: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_linux.c:257:21: danger: ‘opendir("/sys/bus/pci/devices")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  255|       }
#  256|   
#  257|->     while ((entry = readdir(dir))) {
#  258|           if (entry->d_name[0] == '.')
#  259|               continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def869]
xen-4.20.2/tools/libs/light/libxl_linux.c:283:21: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/bus/pci/devices")’
xen-4.20.2/tools/libs/light/libxl_linux.c:276:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_linux.c:277:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_linux.c:277:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_linux.c:283:21: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_linux.c:283:21: danger: ‘opendir("/sys/bus/pci/devices")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  281|   
#  282|       i = 0;
#  283|->     while ((entry = readdir(dir))) {
#  284|           unsigned int dom, bus, dev, func;
#  285|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def870]
xen-4.20.2/tools/libs/light/libxl_pci.c:992:18: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/bus/pci/devices")’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
#  990|       }
#  991|   
#  992|->     while( (de = readdir(dir)) ) {
#  993|           unsigned dom, bus, dev, func;
#  994|           struct stat st;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def871]
xen-4.20.2/tools/libs/light/libxl_pci.c:1565:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/do_flr", "/sys/bus/pci/drivers/pciback"), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1563|       fd = open(reset, O_WRONLY);
# 1564|       if (fd >= 0) {
# 1565|->         char *buf = GCSPRINTF(PCI_BDF, domain, bus, dev, func);
# 1566|           rc = write(fd, buf, strlen(buf));
# 1567|           if (rc < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def872]
xen-4.20.2/tools/libs/light/libxl_pci.c:1566:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/do_flr", "/sys/bus/pci/drivers/pciback"), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1564|       if (fd >= 0) {
# 1565|           char *buf = GCSPRINTF(PCI_BDF, domain, bus, dev, func);
# 1566|->         rc = write(fd, buf, strlen(buf));
# 1567|           if (rc < 0)
# 1568|               LOGE(ERROR, "write '%s' to %s failed", buf, reset);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def873]
xen-4.20.2/tools/libs/light/libxl_pci.c:1568:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/do_flr", "/sys/bus/pci/drivers/pciback"), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1566|           rc = write(fd, buf, strlen(buf));
# 1567|           if (rc < 0)
# 1568|->             LOGE(ERROR, "write '%s' to %s failed", buf, reset);
# 1569|           close(fd);
# 1570|           return rc < 0 ? rc : 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def874]
xen-4.20.2/tools/libs/light/libxl_pci.c:1569:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/do_flr", "/sys/bus/pci/drivers/pciback"), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1567|           if (rc < 0)
# 1568|               LOGE(ERROR, "write '%s' to %s failed", buf, reset);
# 1569|->         close(fd);
# 1570|           return rc < 0 ? rc : 0;
# 1571|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def875]
xen-4.20.2/tools/libs/light/libxl_pci.c:1577:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/%04x:%02x:%02x.%01x/reset", "/sys/bus/pci/devices",  domain,  bus,  dev,  func), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1575|       fd = open(reset, O_WRONLY);
# 1576|       if (fd >= 0) {
# 1577|->         rc = write(fd, "1", 1);
# 1578|           if (rc < 0)
# 1579|               LOGE(ERROR, "write to %s failed", reset);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def876]
xen-4.20.2/tools/libs/light/libxl_pci.c:1579:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/%04x:%02x:%02x.%01x/reset", "/sys/bus/pci/devices",  domain,  bus,  dev,  func), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1577|           rc = write(fd, "1", 1);
# 1578|           if (rc < 0)
# 1579|->             LOGE(ERROR, "write to %s failed", reset);
# 1580|           close(fd);
# 1581|           return rc < 0 ? rc : 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def877]
xen-4.20.2/tools/libs/light/libxl_pci.c:1580:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/%04x:%02x:%02x.%01x/reset", "/sys/bus/pci/devices",  domain,  bus,  dev,  func), 1)’
xen-4.20.2/tools/libs/light/libxl_pci.c:2058:13: enter_function: entry to ‘pci_remove_qmp_device_del_cb’
xen-4.20.2/tools/libs/light/libxl_pci.c:2073:5: call_function: calling ‘pci_remove_qmp_retry_timer_cb’ from ‘pci_remove_qmp_device_del_cb’
# 1578|           if (rc < 0)
# 1579|               LOGE(ERROR, "write to %s failed", reset);
# 1580|->         close(fd);
# 1581|           return rc < 0 ? rc : 0;
# 1582|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def878]
xen-4.20.2/tools/libs/light/libxl_qmp.c:344:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor
xen-4.20.2/tools/libs/light/libxl_qmp.c:839:5: enter_function: entry to ‘libxl__qmp_nbd_server_stop’
xen-4.20.2/tools/libs/light/libxl_qmp.c:841:12: call_function: calling ‘qmp_run_command’ from ‘libxl__qmp_nbd_server_stop’
#  342|           goto out;
#  343|       }
#  344|->     ret = libxl_fd_set_nonblock(qmp->ctx, qmp->qmp_fd, 1);
#  345|       if (ret) {
#  346|           ret = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def879]
xen-4.20.2/tools/libs/light/libxl_qmp.c:1286:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/libs/light/libxl_qmp.c:1282:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_qmp.c:1284:5: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_qmp.c:1285:10: acquire_resource: stream socket created here
xen-4.20.2/tools/libs/light/libxl_qmp.c:1286:15: throw: if ‘libxl__carefd_opened’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_qmp.c:1286:15: danger: ‘fd’ leaks here
# 1284|       libxl__carefd_begin();
# 1285|       fd = socket(AF_UNIX, SOCK_STREAM, 0);
# 1286|->     ev->cfd = libxl__carefd_opened(CTX, fd);
# 1287|       if (!ev->cfd) {
# 1288|           LOGED(ERROR, ev->domid, "socket() failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def880]
xen-4.20.2/tools/libs/light/libxl_save_callout.c:137:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup_fd’
xen-4.20.2/tools/libs/light/libxl_save_callout.c:126:12: enter_function: entry to ‘dup_cloexec’
xen-4.20.2/tools/libs/light/libxl_save_callout.c:130:8: branch_true: following ‘true’ branch (when ‘fd <= 2’)...
xen-4.20.2/tools/libs/light/libxl_save_callout.c:131:18: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_save_callout.c:131:18: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_save_callout.c:132:12: branch_false: following ‘false’ branch (when ‘dup_fd >= 0’)...
xen-4.20.2/tools/libs/light/libxl_save_callout.c:137:5: call_function: inlined call to ‘libxl__gc_owner’ from ‘dup_cloexec’
xen-4.20.2/tools/libs/light/libxl_save_callout.c:137:5: throw: if ‘libxl_fd_set_cloexec’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_save_callout.c:137:5: danger: ‘dup_fd’ leaks here; was opened at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  135|           }
#  136|       }
#  137|->     libxl_fd_set_cloexec(CTX, dup_fd, 0);
#  138|   
#  139|       return dup_fd;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def881]
xen-4.20.2/tools/libs/light/libxl_save_helper.c:102:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/light/libxl_save_helper.c:101:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/libs/light/libxl_save_helper.c:102:5: throw: if ‘xtl_logv’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_save_helper.c:102:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  100|       va_list al;
#  101|       va_start(al,fmt);
#  102|->     xtl_logv(&logger,XTL_ERROR,errnoval,program,fmt,al);
#  103|       exit(-1);
#  104|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def882]
xen-4.20.2/tools/libs/light/libxl_save_helper.c:159:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘r’
xen-4.20.2/tools/libs/light/libxl_save_helper.c:151:13: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_save_helper.c:152:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_save_helper.c:158:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_save_helper.c:159:1: danger: ‘r’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  157|   
#  158|       errno = esave;
#  159|-> }
#  160|   
#  161|   static void setup_signals(void (*handler)(int))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def883]
xen-4.20.2/tools/libs/light/libxl_usb.c:848:14: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/bus/usb/devices")’
xen-4.20.2/tools/libs/light/libxl_usb.c:832:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_usb.c:835:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_usb.c:835:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_usb.c:836:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_usb.c:836:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_usb.c:848:14: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_usb.c:848:14: danger: ‘opendir("/sys/bus/usb/devices")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  846|   
#  847|           errno = 0;
#  848|->         de = readdir(dir);
#  849|           if (!de && errno) {
#  850|               LOGE(ERROR, "failed to readdir %s", SYSFS_USB_DEV);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def884]
xen-4.20.2/tools/libs/light/libxl_usb.c:1390:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "/sys/bus/usb/devices/%s/driver/unbind",  intf), 1)’
xen-4.20.2/tools/libs/light/libxl_usb.c:1383:10: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_usb.c:1384:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_usb.c:1390:44: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_usb.c:1390:9: throw: if ‘libxl_write_exactly’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_usb.c:1390:9: danger: ‘open(libxl__sprintf(gc, "/sys/bus/usb/devices/%s/driver/unbind",  intf), 1)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1388|       }
# 1389|   
# 1390|->     if (libxl_write_exactly(CTX, fd, intf, strlen(intf), path, intf)) {
# 1391|           rc = ERROR_FAIL;
# 1392|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def885]
xen-4.20.2/tools/libs/light/libxl_usb.c:1430:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libxl__sprintf(gc, "%s/bind",  drvpath), 1)’
xen-4.20.2/tools/libs/light/libxl_usb.c:1416:8: branch_false: following ‘false’ branch (when ‘r != 0’)...
xen-4.20.2/tools/libs/light/libxl_usb.c:1418:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_usb.c:1423:10: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_usb.c:1424:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_usb.c:1430:44: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_usb.c:1430:9: throw: if ‘libxl_write_exactly’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_usb.c:1430:9: danger: ‘open(libxl__sprintf(gc, "%s/bind",  drvpath), 1)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1428|       }
# 1429|   
# 1430|->     if (libxl_write_exactly(CTX, fd, intf, strlen(intf), bind_path, intf)) {
# 1431|           rc = ERROR_FAIL;
# 1432|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def886]
xen-4.20.2/tools/libs/light/libxl_usb.c:1481:14: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/bus/usb/devices")’
xen-4.20.2/tools/libs/light/libxl_usb.c:1473:11: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_usb.c:1474:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_usb.c:1474:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_usb.c:1481:14: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_usb.c:1481:14: danger: ‘opendir("/sys/bus/usb/devices")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1479|       for (;;) {
# 1480|           errno = 0;
# 1481|->         de = readdir(dir);
# 1482|   
# 1483|           if (!de && errno) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def887]
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:335:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  341|   
#  342|       if (fstat(fileno(f), &stab)) {
#  343|->         LOGE(ERROR, "failed to fstat %s", filename);
#  344|           goto xe;
#  345|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def888]
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:335:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:343:9: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  341|   
#  342|       if (fstat(fileno(f), &stab)) {
#  343|->         LOGE(ERROR, "failed to fstat %s", filename);
#  344|           goto xe;
#  345|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def889]
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:335:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:347:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:348:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:348:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  345|       }
#  346|   
#  347|->     if (!S_ISREG(stab.st_mode)) {
#  348|           LOGE(ERROR, "%s is not a plain file", filename);
#  349|           errno = ENOTTY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def890]
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:335:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:347:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:348:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:348:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  345|       }
#  346|   
#  347|->     if (!S_ISREG(stab.st_mode)) {
#  348|           LOGE(ERROR, "%s is not a plain file", filename);
#  349|           errno = ENOTTY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def891]
xen-4.20.2/tools/libs/light/libxl_utils.c:368:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:347:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:353:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:353:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:359:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:361:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:362:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:363:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_utils.c:365:14: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:366:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:367:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:367:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:368:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:368:17: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:368:17: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/10)
#  366|           if (rs != datalen) {
#  367|               if (ferror(f))
#  368|->                 LOGE(ERROR, "failed to read %s", filename);
#  369|               else if (feof(f))
#  370|                   LOG(ERROR, "%s changed size while we were reading it",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def892]
xen-4.20.2/tools/libs/light/libxl_utils.c:370:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
xen-4.20.2/tools/libs/light/libxl_utils.c:325:5: enter_function: entry to ‘libxl_read_file_contents’
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:347:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:353:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:353:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:359:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:361:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:362:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:363:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_utils.c:365:14: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:366:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:367:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:367:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:369:22: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:369:21: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:370:17: call_function: inlined call to ‘libxl__gc_owner’ from ‘libxl_read_file_contents’
xen-4.20.2/tools/libs/light/libxl_utils.c:370:17: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:370:17: danger: ‘data’ leaks here; was allocated at [(12)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/11)
#  368|                   LOGE(ERROR, "failed to read %s", filename);
#  369|               else if (feof(f))
#  370|->                 LOG(ERROR, "%s changed size while we were reading it",
#  371|   		    filename);
#  372|               else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def893]
xen-4.20.2/tools/libs/light/libxl_utils.c:380:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:347:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:353:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:353:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:359:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:361:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:362:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:363:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_utils.c:365:14: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:366:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:378:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:378:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:380:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:380:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:380:9: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
#  378|       if (fclose(f)) {
#  379|           f = 0;
#  380|->         LOGE(ERROR, "failed to close %s", filename);
#  381|           goto xe;
#  382|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def894]
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
xen-4.20.2/tools/libs/light/libxl_utils.c:335:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: throw: if ‘libxl__free_all’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: danger: ‘f’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  389|   
#  390|    xe:
#  391|->     GC_FREE;
#  392|       e = errno;
#  393|       assert(e != ENOENT);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def895]
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:342:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:347:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:347:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:353:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:353:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:359:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:361:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:362:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:363:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
xen-4.20.2/tools/libs/light/libxl_utils.c:365:14: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:366:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:378:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:378:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:380:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: throw: if ‘libxl__free_all’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
#  389|   
#  390|    xe:
#  391|->     GC_FREE;
#  392|       e = errno;
#  393|       assert(e != ENOENT);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def896]
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xen-4.20.2/tools/libs/light/libxl_utils.c:335:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:336:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: throw: if ‘libxl__free_all’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:391:5: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  389|   
#  390|    xe:
#  391|->     GC_FREE;
#  392|       e = errno;
#  393|       assert(e != ENOENT);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def897]
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:409:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_utils.c:410:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:416:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:416:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
#  415|   
#  416|       if (fstat(fileno(f), &stab)) {
#  417|->         LOGE(ERROR, "failed to fstat %s", filename);
#  418|           goto xe;
#  419|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def898]
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:409:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:410:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:416:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:416:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:417:9: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
#  415|   
#  416|       if (fstat(fileno(f), &stab)) {
#  417|->         LOGE(ERROR, "failed to fstat %s", filename);
#  418|           goto xe;
#  419|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def899]
xen-4.20.2/tools/libs/light/libxl_utils.c:421:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:409:9: acquire_resource: opened here
xen-4.20.2/tools/libs/light/libxl_utils.c:410:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:416:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:416:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:421:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:421:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:422:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:422:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:421:10: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
#  419|       }
#  420|   
#  421|->     if (!S_ISREG(stab.st_mode)) {
#  422|           LOGE(ERROR, "%s is not a plain file", filename);
#  423|           errno = ENOTTY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def900]
xen-4.20.2/tools/libs/light/libxl_utils.c:421:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
xen-4.20.2/tools/libs/light/libxl_utils.c:409:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:410:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:416:9: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:416:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:421:10: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:421:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:422:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:422:9: throw: if ‘libxl__log’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:421:10: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
#  419|       }
#  420|   
#  421|->     if (!S_ISREG(stab.st_mode)) {
#  422|           LOGE(ERROR, "%s is not a plain file", filename);
#  423|           errno = ENOTTY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def901]
xen-4.20.2/tools/libs/light/libxl_utils.c:555:14: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dirpath)’
xen-4.20.2/tools/libs/light/libxl_utils.c:541:9: acquire_memory: allocated here
xen-4.20.2/tools/libs/light/libxl_utils.c:542:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:542:8: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:555:14: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libs/light/libxl_utils.c:555:14: danger: ‘opendir(dirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
#  553|       for (;;) {
#  554|           errno = 0;
#  555|->         de = readdir(d);
#  556|           if (!de && errno) {
#  557|               LOGE(ERROR, "failed to readdir %s for removal", dirpath);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def902]
xen-4.20.2/tools/libs/light/libxl_utils.c:1083:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cmsg’
xen-4.20.2/tools/libs/light/libxl_utils.c:1082:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1083:5: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1083:5: danger: dereference of NULL ‘cmsg’
# 1081|       /* attach open fd */
# 1082|       cmsg = CMSG_FIRSTHDR(&msg);
# 1083|->     cmsg->cmsg_level = SOL_SOCKET;
# 1084|       cmsg->cmsg_type = SCM_RIGHTS;
# 1085|       cmsg->cmsg_len = CMSG_LEN(spaceneeded);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def903]
xen-4.20.2/tools/libs/light/libxl_utils.c:1144:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cmsg’
xen-4.20.2/tools/libs/light/libxl_utils.c:1139:12: branch_false: following ‘false’ branch (when ‘r != 0’)...
xen-4.20.2/tools/libs/light/libxl_utils.c:1143:16: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1143:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1144:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1144:13: danger: dereference of NULL ‘cmsg’
# 1142|           }
# 1143|           cmsg = CMSG_FIRSTHDR(&msg);
# 1144|->         if (cmsg->cmsg_len <= CMSG_LEN(0)) {
# 1145|               LOG(ERROR,"recvmsg got no control msg"
# 1146|                   " when expecting fds (%s)", what);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def904]
xen-4.20.2/tools/libs/light/libxl_utils.c:1170:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’
xen-4.20.2/tools/libs/light/libxl_utils.c:1139:12: branch_false: following ‘false’ branch (when ‘r != 0’)...
xen-4.20.2/tools/libs/light/libxl_utils.c:1143:16: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1143:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1143:9: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1144:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1149:13: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1149:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1167:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1169:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1170:17: release_resource: first ‘close’ here
xen-4.20.2/tools/libs/light/libxl_utils.c:1167:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_utils.c:1169:17: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_utils.c:1170:17: danger: second ‘close’ here; first ‘close’ was at [(11)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/10)
# 1168|                    i++, i+=sizeof(fd)) {
# 1169|                   memcpy(&fd, p, sizeof(fd));
# 1170|->                 close(fd);
# 1171|               }
# 1172|               return ERROR_FAIL;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def905]
xen-4.20.2/tools/libs/light/libxl_x86.c:241:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&e820’
xen-4.20.2/tools/libs/light/libxl_x86.c:565:5: enter_function: entry to ‘libxl__arch_vnuma_build_vmemrange’
xen-4.20.2/tools/libs/light/libxl_x86.c:577:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/light/libxl_x86.c:578:11: branch_false: ...to here
xen-4.20.2/tools/libs/light/libxl_x86.c:577:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_x86.c:582:5: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_x86.c:582:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/libxl_x86.c:584:5: branch_true: ...to here
xen-4.20.2/tools/libs/light/libxl_x86.c:585:10: call_function: calling ‘e820_host_sanitize’ from ‘libxl__arch_vnuma_build_vmemrange’
#  239|       /* Done: copy the sanitized version. */
#  240|       *nr_entries = nr;
#  241|->     memcpy(src, e820, nr * sizeof(struct e820entry));
#  242|       return 0;
#  243|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def906]
xen-4.20.2/tools/libs/light/libxl_xshelp.c:115:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/light/libxl_xshelp.c:126:5: enter_function: entry to ‘libxl__xs_printf’
xen-4.20.2/tools/libs/light/libxl_xshelp.c:132:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/libs/light/libxl_xshelp.c:133:10: call_function: calling ‘libxl__xs_vprintf’ from ‘libxl__xs_printf’
#  113|       bool ok;
#  114|   
#  115|->     s = libxl__vsprintf(gc, fmt, ap);
#  116|   
#  117|       ok = xs_write(ctx->xsh, t, path, s, strlen(s));

Error: CPPCHECK_WARNING (CWE-401): [#def907]
xen-4.20.2/tools/libs/light/test_common.c:41: error[memleakOnRealloc]: Common realloc mistake: 'poll_fds' nulled but not freed upon failure
#   39|   
#   40|           assert(poll_nfds > poll_nfds_allocd);
#   41|->         poll_fds = realloc(poll_fds, poll_nfds * sizeof(poll_fds[0]));
#   42|           assert(poll_fds);
#   43|           poll_nfds_allocd = poll_nfds;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def908]
xen-4.20.2/tools/libs/light/test_fdderegrace.c:17:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/light/test_fdderegrace.c:14:14: acquire_resource: opened here
xen-4.20.2/tools/libs/light/test_fdderegrace.c:15:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/light/test_fdderegrace.c:17:10: branch_true: ...to here
xen-4.20.2/tools/libs/light/test_fdderegrace.c:17:10: throw: if ‘libxl_test_fdevent’ throws an exception...
xen-4.20.2/tools/libs/light/test_fdderegrace.c:17:10: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   15|       assert(fd > 0);
#   16|   
#   17|->     rc = libxl_test_fdevent(ctx, fd, POLLIN, &how);
#   18|       assert(!rc);
#   19|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def909]
xen-4.20.2/tools/libs/stat/xenstat.c:97:17: warning[-Wanalyzer-malloc-leak]: leak of ‘handle’
xen-4.20.2/tools/libs/stat/xenstat.c:86:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:87:12: branch_false: following ‘false’ branch (when ‘handle’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:95:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:96:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:97:17: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:97:17: throw: if ‘perror’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:97:17: danger: ‘handle’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   95|   	handle->page_size = sysconf(_SC_PAGE_SIZE);
#   96|   	if (handle->page_size < 0) {
#   97|-> 		perror("Failed to retrieve page size.");
#   98|   		free(handle);
#   99|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def910]
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: warning[-Wanalyzer-malloc-leak]: leak of ‘handle’
xen-4.20.2/tools/libs/stat/xenstat.c:86:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:87:12: branch_false: following ‘false’ branch (when ‘handle’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:95:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: throw: if ‘xc_interface_open’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: danger: ‘handle’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  101|   #endif
#  102|   
#  103|-> 	handle->xc_handle = xc_interface_open(0,0,0);
#  104|   	if (!handle->xc_handle) {
#  105|   		perror("xc_interface_open");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def911]
xen-4.20.2/tools/libs/stat/xenstat.c:105:17: warning[-Wanalyzer-malloc-leak]: leak of ‘handle’
xen-4.20.2/tools/libs/stat/xenstat.c:86:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:87:12: branch_false: following ‘false’ branch (when ‘handle’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:95:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:104:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:105:17: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:105:17: throw: if ‘perror’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:105:17: danger: ‘handle’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  103|   	handle->xc_handle = xc_interface_open(0,0,0);
#  104|   	if (!handle->xc_handle) {
#  105|-> 		perror("xc_interface_open");
#  106|   		free(handle);
#  107|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def912]
xen-4.20.2/tools/libs/stat/xenstat.c:110:28: warning[-Wanalyzer-malloc-leak]: leak of ‘handle’
xen-4.20.2/tools/libs/stat/xenstat.c:86:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:87:12: branch_false: following ‘false’ branch (when ‘handle’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:95:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:104:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:110:28: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:110:28: throw: if ‘xs_open’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:110:28: danger: ‘handle’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  108|   	}
#  109|   
#  110|-> 	handle->xshandle = xs_open(0); /* open handle to xenstore*/
#  111|   	if (handle->xshandle == NULL) {
#  112|   		perror("unable to open xenstore");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def913]
xen-4.20.2/tools/libs/stat/xenstat.c:112:17: warning[-Wanalyzer-malloc-leak]: leak of ‘handle’
xen-4.20.2/tools/libs/stat/xenstat.c:86:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:87:12: branch_false: following ‘false’ branch (when ‘handle’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:95:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:104:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:110:28: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:111:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:112:17: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:112:17: throw: if ‘perror’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:112:17: danger: ‘handle’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  110|   	handle->xshandle = xs_open(0); /* open handle to xenstore*/
#  111|   	if (handle->xshandle == NULL) {
#  112|-> 		perror("unable to open xenstore");
#  113|   		xc_interface_close(handle->xc_handle);
#  114|   		free(handle);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def914]
xen-4.20.2/tools/libs/stat/xenstat.c:113:17: warning[-Wanalyzer-malloc-leak]: leak of ‘handle’
xen-4.20.2/tools/libs/stat/xenstat.c:86:37: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:87:12: branch_false: following ‘false’ branch (when ‘handle’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:95:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:96:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:103:29: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:104:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:110:28: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:111:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:112:17: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:113:17: throw: if ‘xc_interface_close’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:113:17: danger: ‘handle’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  111|   	if (handle->xshandle == NULL) {
#  112|   		perror("unable to open xenstore");
#  113|-> 		xc_interface_close(handle->xc_handle);
#  114|   		free(handle);
#  115|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def915]
xen-4.20.2/tools/libs/stat/xenstat.c:152:13: warning[-Wanalyzer-malloc-leak]: leak of ‘node’
xen-4.20.2/tools/libs/stat/xenstat.c:144:33: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:13: throw: if ‘xc_physinfo’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:152:13: danger: ‘node’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  150|   
#  151|   	/* Get information about the physical system */
#  152|-> 	if (xc_physinfo(handle->xc_handle, &physinfo) < 0) {
#  153|   		free(node);
#  154|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def916]
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:168:25: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: throw: if ‘xc_domain_getinfolist’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: danger: ‘<unknown>’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  176|   		xenstat_domain *domain, *tmp;
#  177|   
#  178|-> 		new_domains = xc_domain_getinfolist(handle->xc_handle,
#  179|   						    node->num_domains, 
#  180|   						    DOMAIN_CHUNK_SIZE, 

Error: GCC_ANALYZER_WARNING (CWE-401): [#def917]
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:168:25: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:198:29: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: throw: if ‘xc_domain_getinfolist’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: danger: ‘domain’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  176|   		xenstat_domain *domain, *tmp;
#  177|   
#  178|-> 		new_domains = xc_domain_getinfolist(handle->xc_handle,
#  179|   						    node->num_domains, 
#  180|   						    DOMAIN_CHUNK_SIZE, 

Error: GCC_ANALYZER_WARNING (CWE-401): [#def918]
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: warning[-Wanalyzer-malloc-leak]: leak of ‘node’
xen-4.20.2/tools/libs/stat/xenstat.c:144:33: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: throw: if ‘xc_domain_getinfolist’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: danger: ‘node’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  176|   		xenstat_domain *domain, *tmp;
#  177|   
#  178|-> 		new_domains = xc_domain_getinfolist(handle->xc_handle,
#  179|   						    node->num_domains, 
#  180|   						    DOMAIN_CHUNK_SIZE, 

Error: GCC_ANALYZER_WARNING (CWE-401): [#def919]
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:168:25: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:198:29: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: throw: if ‘xc_domain_getinfolist’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:178:31: danger: ‘tmp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  176|   		xenstat_domain *domain, *tmp;
#  177|   
#  178|-> 		new_domains = xc_domain_getinfolist(handle->xc_handle,
#  179|   						    node->num_domains, 
#  180|   						    DOMAIN_CHUNK_SIZE, 

Error: GCC_ANALYZER_WARNING (CWE-401): [#def920]
xen-4.20.2/tools/libs/stat/xenstat.c:245:28: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:198:29: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:242:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
xen-4.20.2/tools/libs/stat/xenstat.c:243:30: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:243:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:244:25: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:245:28: throw: if the called function throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:245:28: danger: ‘domain’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  243|   		if ((flags & collectors[i].flag) == collectors[i].flag) {
#  244|   			node->flags |= collectors[i].flag;
#  245|-> 			if(collectors[i].collect(node) == 0) {
#  246|   				xenstat_free_node(node);
#  247|   				return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def921]
xen-4.20.2/tools/libs/stat/xenstat.c:245:28: warning[-Wanalyzer-malloc-leak]: leak of ‘node’
xen-4.20.2/tools/libs/stat/xenstat.c:144:33: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:198:29: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:237:18: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:242:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
xen-4.20.2/tools/libs/stat/xenstat.c:243:30: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:243:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:244:25: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:245:28: throw: if the called function throws an exception...
xen-4.20.2/tools/libs/stat/xenstat.c:245:28: danger: ‘node’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  243|   		if ((flags & collectors[i].flag) == collectors[i].flag) {
#  244|   			node->flags |= collectors[i].flag;
#  245|-> 			if(collectors[i].collect(node) == 0) {
#  246|   				xenstat_free_node(node);
#  247|   				return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def922]
xen-4.20.2/tools/libs/stat/xenstat.c:271:41: warning[-Wanalyzer-malloc-leak]: leak of ‘node’
xen-4.20.2/tools/libs/stat/xenstat.c:134:15: enter_function: entry to ‘xenstat_get_node’
xen-4.20.2/tools/libs/stat/xenstat.c:144:33: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:203:28: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:204:37: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:206:41: call_function: calling ‘xenstat_free_node’ from ‘xenstat_get_node’
#  269|   				if((node->flags & collectors[i].flag)
#  270|   				   == collectors[i].flag)
#  271|-> 					collectors[i].free(node);
#  272|   			free(node->domains);
#  273|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def923]
xen-4.20.2/tools/libs/stat/xenstat.c:713:16: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
xen-4.20.2/tools/libs/stat/xenstat.c:134:15: enter_function: entry to ‘xenstat_get_node’
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:201:40: call_function: calling ‘xenstat_get_domain_name’ from ‘xenstat_get_node’
#  711|   	snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
#  712|   
#  713|-> 	return xs_read(handle->xshandle, XBT_NULL, path, NULL);
#  714|   }
#  715|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def924]
xen-4.20.2/tools/libs/stat/xenstat.c:713:16: warning[-Wanalyzer-malloc-leak]: leak of ‘node’
xen-4.20.2/tools/libs/stat/xenstat.c:134:15: enter_function: entry to ‘xenstat_get_node’
xen-4.20.2/tools/libs/stat/xenstat.c:144:33: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat.c:145:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:149:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:152:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:158:45: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:169:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:174:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:182:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat.c:186:32: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:188:20: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xen-4.20.2/tools/libs/stat/xenstat.c:191:17: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat.c:201:40: call_function: calling ‘xenstat_get_domain_name’ from ‘xenstat_get_node’
#  711|   	snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
#  712|   
#  713|-> 	return xs_read(handle->xshandle, XBT_NULL, path, NULL);
#  714|   }
#  715|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def925]
xen-4.20.2/tools/libs/stat/xenstat_linux.c:78:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/class/net")’
xen-4.20.2/tools/libs/stat/xenstat_linux.c:77:13: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:78:22: throw: if ‘readdir’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:78:22: danger: ‘opendir("/sys/class/net")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   76|   
#   77|   	d = opendir("/sys/class/net");
#   78|-> 	while ((de = readdir(d)) != NULL) {
#   79|   		if ((strlen(de->d_name) > 0) && (de->d_name[0] != '.')
#   80|   			&& (strstr(de->d_name, excludeName) == NULL)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def926]
xen-4.20.2/tools/libs/stat/xenstat_linux.c:78:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘opendir("/sys/class/net")’ where non-null expected
xen-4.20.2/tools/libs/stat/xenstat_linux.c:77:13: acquire_memory: this call could return NULL
xen-4.20.2/tools/libs/stat/xenstat_linux.c:78:22: danger: argument 1 (‘opendir("/sys/class/net")’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   76|   
#   77|   	d = opendir("/sys/class/net");
#   78|-> 	while ((de = readdir(d)) != NULL) {
#   79|   		if ((strlen(de->d_name) > 0) && (de->d_name[0] != '.')
#   80|   			&& (strstr(de->d_name, excludeName) == NULL)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def927]
xen-4.20.2/tools/libs/stat/xenstat_linux.c:163:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/libs/stat/xenstat_linux.c:157:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:162:23: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:162:23: acquire_memory: allocated here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:163:13: throw: if ‘regexec’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:163:13: danger: ‘tmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  161|   
#  162|   	tmp = (char *)malloc( sizeof(char) );
#  163|-> 	if (regexec (&r, line, num, matches, REG_EXTENDED) == 0){
#  164|   		for (i = 1; i < num; i++) {
#  165|   			/* The expression matches are empty sometimes so we need to check it first */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def928]
xen-4.20.2/tools/libs/stat/xenstat_linux.c:177:69: warning[-Wanalyzer-null-argument]: use of NULL ‘tmp’ where non-null expected
xen-4.20.2/tools/libs/stat/xenstat_linux.c:157:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:162:23: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:163:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:163:12: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:164:29: branch_true: following ‘true’ branch (when ‘i != 19’)...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:166:29: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:166:28: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:164:38: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:164:29: branch_true: following ‘true’ branch (when ‘i != 19’)...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:166:29: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:166:28: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:168:33: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:171:60: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:173:37: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:176:36: branch_true: following ‘true’ branch (when ‘i != 1’)...
xen-4.20.2/tools/libs/stat/xenstat_linux.c:177:69: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_linux.c:177:69: danger: argument 1 (‘tmp’) NULL where non-null expected
#  175|   				/* We populate all the fields from /proc/net/dev line */
#  176|   				if (i > 1) {
#  177|-> 					unsigned long long ullTmp = strtoull(tmp, NULL, 10);
#  178|   
#  179|   					switch (col) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def929]
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:220:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:385:13: enter_function: entry to ‘read_attributes_qdisk_dom’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:396:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:398:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:402:20: call_function: calling ‘qmp_connect’ from ‘read_attributes_qdisk_dom’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:402:20: return_function: returning to ‘read_attributes_qdisk_dom’ from ‘qmp_connect’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:402:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:406:26: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:406:26: call_function: calling ‘qmp_query’ from ‘read_attributes_qdisk_dom’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:406:26: return_function: returning to ‘read_attributes_qdisk_dom’ from ‘qmp_query’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:406:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:407:17: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:409:29: call_function: calling ‘qmp_query’ from ‘read_attributes_qdisk_dom’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:409:29: return_function: returning to ‘read_attributes_qdisk_dom’ from ‘qmp_query’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:410:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:411:25: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:411:25: call_function: calling ‘qmp_parse_stats’ from ‘read_attributes_qdisk_dom’
#  218|   
#  219|   	/* Array of devices */
#  220|-> 	for (i=0; i<YAJL_GET_ARRAY(ret_obj)->len; i++) {
#  221|   		memset(&vbd, 0, sizeof(xenstat_vbd));
#  222|   		qmp_devname = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def930]
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:298:21: warning[-Wanalyzer-malloc-leak]: leak of ‘qstats’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:319:23: enter_function: entry to ‘qmp_query’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:325:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:327:14: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:327:14: call_function: calling ‘qmp_read’ from ‘qmp_query’
#  296|   	pfd[0].fd = qfd;
#  297|   	pfd[0].events = POLLIN;
#  298|-> 	while ((n = poll(pfd, 1, 10)) > 0) {
#  299|   		if (pfd[0].revents & POLLIN) {
#  300|   			if ((n = read(qfd, buf, sizeof(buf))) <= 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def931]
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:340:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:338:18: acquire_resource: stream socket created here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:338:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:340:15: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:340:15: throw: if ‘fcntl’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:340:15: danger: ‘s’ leaks here
#  338|   	if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
#  339|   		return -1;
#  340|-> 	(void)fcntl(s, F_SETFD, 1);
#  341|   
#  342|   	memset(&sun, 0, sizeof(struct sockaddr_un));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def932]
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:352:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:338:18: acquire_resource: stream socket created here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:338:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:340:15: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:345:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:350:9: branch_false: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:351:13: acquire_resource: socket created here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:351:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:352:17: branch_true: ...to here
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:352:17: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/libs/stat/xenstat_qmp.c:352:17: danger: ‘s’ leaks here
#  350|   	strcpy(sun.sun_path, path);
#  351|   	if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {
#  352|-> 		close(s);
#  353|   		return -1;
#  354|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def933]
xen-4.20.2/tools/libs/store/xs.c:169:21: warning[-Wanalyzer-malloc-leak]: leak of ‘msg’
xen-4.20.2/tools/libs/store/xs.c:1436:12: enter_function: entry to ‘read_message’
xen-4.20.2/tools/libs/store/xs.c:1454:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/store/xs.c:1455:12: branch_false: following ‘false’ branch (when ‘msg’ is non-NULL)...
xen-4.20.2/tools/libs/store/xs.c:1458:30: branch_false: ...to here
xen-4.20.2/tools/libs/store/xs.c:1458:14: call_function: calling ‘read_all’ from ‘read_message’
#  167|   static bool setnonblock(int fd, int nonblock)
#  168|   {
#  169|-> 	int flags = fcntl(fd, F_GETFL);
#  170|   
#  171|   	if (flags == -1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def934]
xen-4.20.2/tools/libs/store/xs.c:179:13: warning[-Wanalyzer-malloc-leak]: leak of ‘msg’
xen-4.20.2/tools/libs/store/xs.c:1436:12: enter_function: entry to ‘read_message’
xen-4.20.2/tools/libs/store/xs.c:1454:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/store/xs.c:1455:12: branch_false: following ‘false’ branch (when ‘msg’ is non-NULL)...
xen-4.20.2/tools/libs/store/xs.c:1458:30: branch_false: ...to here
xen-4.20.2/tools/libs/store/xs.c:1458:14: call_function: calling ‘read_all’ from ‘read_message’
#  177|   		flags &= ~O_NONBLOCK;
#  178|   
#  179|-> 	if (fcntl(fd, F_SETFL, flags) == -1)
#  180|   		return false;
#  181|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def935]
xen-4.20.2/tools/libs/store/xs.c:247:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
xen-4.20.2/tools/libs/store/xs.c:1386:5: enter_function: entry to ‘xs_suspend_evtchn_port’
xen-4.20.2/tools/libs/store/xs.c:1394:14: call_function: inlined call to ‘xs_daemon_open’ from ‘xs_suspend_evtchn_port’
#  245|   	strcpy(addr.sun_path, connect_to);
#  246|   
#  247|-> 	if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
#  248|   		goto error;
#  249|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def936]
xen-4.20.2/tools/libs/store/xs.c:254:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
xen-4.20.2/tools/libs/store/xs.c:1386:5: enter_function: entry to ‘xs_suspend_evtchn_port’
xen-4.20.2/tools/libs/store/xs.c:1394:14: call_function: inlined call to ‘xs_daemon_open’ from ‘xs_suspend_evtchn_port’
#  252|   error:
#  253|   	saved_errno = errno;
#  254|-> 	close(sock);
#  255|   	errno = saved_errno;
#  256|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def937]
xen-4.20.2/tools/libs/store/xs.c:264:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(connect_to, 524290)’
xen-4.20.2/tools/libs/store/xs.c:1386:5: enter_function: entry to ‘xs_suspend_evtchn_port’
xen-4.20.2/tools/libs/store/xs.c:1394:14: call_function: inlined call to ‘xs_daemon_open’ from ‘xs_suspend_evtchn_port’
#  262|   
#  263|   	fd = open(connect_to, O_RDWR | O_CLOEXEC);
#  264|-> 	if (fd < 0)
#  265|   		return -1;
#  266|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def938]
xen-4.20.2/tools/libs/store/xs.c:302:9: warning[-Wanalyzer-malloc-leak]: leak of ‘h’
xen-4.20.2/tools/libs/store/xs.c:1386:5: enter_function: entry to ‘xs_suspend_evtchn_port’
xen-4.20.2/tools/libs/store/xs.c:1394:14: call_function: inlined call to ‘xs_daemon_open’ from ‘xs_suspend_evtchn_port’
#  300|   
#  301|   	h->tc_ah.restrict_callback = all_restrict_cb;
#  302|-> 	xentoolcore__register_active_handle(&h->tc_ah);
#  303|   
#  304|   	if (stat(connect_to, &buf) != 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def939]
xen-4.20.2/tools/libs/store/xs.c:304:13: warning[-Wanalyzer-null-argument]: use of NULL ‘connect_to’ where non-null expected
xen-4.20.2/tools/libs/store/xs.c:1386:5: enter_function: entry to ‘xs_suspend_evtchn_port’
xen-4.20.2/tools/libs/store/xs.c:1394:14: call_function: inlined call to ‘xs_daemon_open’ from ‘xs_suspend_evtchn_port’
#  302|   	xentoolcore__register_active_handle(&h->tc_ah);
#  303|   
#  304|-> 	if (stat(connect_to, &buf) != 0)
#  305|   		goto err;
#  306|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def940]
xen-4.20.2/tools/libs/store/xs.c:682:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.iov_len’
xen-4.20.2/tools/libs/store/xs.c:941:6: enter_function: entry to ‘xs_set_permissions’
xen-4.20.2/tools/libs/store/xs.c:956:21: branch_false: following ‘false’ branch (when ‘i >= num_perms’)...
xen-4.20.2/tools/libs/store/xs.c:968:39: branch_false: ...to here
xen-4.20.2/tools/libs/store/xs.c:968:22: call_function: calling ‘xs_talkv’ from ‘xs_set_permissions’
#  680|   	/* Calculate the payload length by summing iovec elements */
#  681|   	for (i = 1, msg_len = 0; i < num_vecs; i++) {
#  682|-> 		if ((iovec[i].iov_len > XENSTORE_PAYLOAD_MAX) ||
#  683|   		    ((msg_len += iovec[i].iov_len) > XENSTORE_PAYLOAD_MAX)) {
#  684|   			errno = E2BIG;

Error: CPPCHECK_WARNING (CWE-401): [#def941]
xen-4.20.2/tools/libs/store/xs.c:825: error[memleakOnRealloc]: Common realloc mistake: 'strings' nulled but not freed upon failure
#  823|   
#  824|   		result_len -= strlen(result) + 1;
#  825|-> 		strings = realloc(strings, off + result_len);
#  826|   		memcpy(strings + off, result + strlen(result) + 1, result_len);
#  827|   		free(result);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def942]
xen-4.20.2/tools/libs/store/xs.c:1488:32: warning[-Wanalyzer-malloc-leak]: leak of ‘msg’
xen-4.20.2/tools/libs/store/xs.c:1163:8: enter_function: entry to ‘xs_read_watch’
xen-4.20.2/tools/libs/store/xs.c:1165:16: call_function: calling ‘read_watch_internal’ from ‘xs_read_watch’
# 1486|   		if (XEN_TAILQ_EMPTY(&h->watch_list) &&
# 1487|   		    (h->watch_pipe[1] != -1))
# 1488|-> 			while (write(h->watch_pipe[1], body, 1) != 1) /* Cancellation point */
# 1489|   				continue;
# 1490|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def943]
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/toolcore/handlereg.c:77:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:81:14: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:81:14: acquire_resource: opened here
xen-4.20.2/tools/libs/toolcore/handlereg.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/toolcore/handlereg.c:84:9: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:85:8: branch_false: following ‘false’ branch (when ‘r >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   85|       if (r < 0) goto err;
#   86|   
#   87|->     close(nullfd);
#   88|       return 0;
#   89|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def944]
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘r’
xen-4.20.2/tools/libs/toolcore/handlereg.c:77:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:81:14: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/toolcore/handlereg.c:84:9: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:84:9: acquire_resource: opened here
xen-4.20.2/tools/libs/toolcore/handlereg.c:85:8: branch_false: following ‘false’ branch (when ‘r >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: throw: if ‘close’ throws an exception...
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: danger: ‘r’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   85|       if (r < 0) goto err;
#   86|   
#   87|->     close(nullfd);
#   88|       return 0;
#   89|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def945]
xen-4.20.2/tools/libs/toolcore/handlereg.c:91:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/libs/toolcore/handlereg.c:77:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:81:14: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:81:14: acquire_resource: opened here
xen-4.20.2/tools/libs/toolcore/handlereg.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/toolcore/handlereg.c:84:9: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:85:8: branch_true: following ‘true’ branch (when ‘r < 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:85:5: branch_true: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:91:22: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   89|   
#   90|   err:
#   91|->     if (nullfd >= 0) close(nullfd);
#   92|       return -1;
#   93|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def946]
xen-4.20.2/tools/libs/toolcore/handlereg.c:93:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘r’
xen-4.20.2/tools/libs/toolcore/handlereg.c:77:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:81:14: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:82:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/toolcore/handlereg.c:84:9: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:84:9: acquire_resource: opened here
xen-4.20.2/tools/libs/toolcore/handlereg.c:85:8: branch_false: following ‘false’ branch (when ‘r >= 0’)...
xen-4.20.2/tools/libs/toolcore/handlereg.c:87:5: branch_false: ...to here
xen-4.20.2/tools/libs/toolcore/handlereg.c:93:1: danger: ‘r’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#   91|       if (nullfd >= 0) close(nullfd);
#   92|       return -1;
#   93|-> }
#   94|   
#   95|   /*

Error: GCC_ANALYZER_WARNING (CWE-404): [#def947]
xen-4.20.2/tools/libs/toollog/xtl_core.c:49:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/toollog/xtl_core.c:53:6: enter_function: entry to ‘xtl_log’
xen-4.20.2/tools/libs/toollog/xtl_core.c:60:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/libs/toollog/xtl_core.c:61:5: call_function: calling ‘xtl_logv’ from ‘xtl_log’
#   47|       int errno_save = errno;
#   48|       assert(level > XTL_NONE && level < XTL_NUM_LEVELS);
#   49|->     logger->vmessage(logger,level,errnoval,context,format,al);
#   50|       errno = errno_save;
#   51|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def948]
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:77:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:88:13: enter_function: entry to ‘stdiostream_message’
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:94:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:95:5: call_function: inlined call to ‘stdiostream_vmessage’ from ‘stdiostream_message’
#   75|           fprintf(lg->f, "%s: ", context);
#   76|   
#   77|->     fprintf(lg->f, "%s: ", xtl_level_to_string(level));
#   78|   
#   79|       vfprintf(lg->f, format, al);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def949]
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:85:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:88:13: enter_function: entry to ‘stdiostream_message’
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:94:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/libs/toollog/xtl_logger_stdio.c:95:5: call_function: inlined call to ‘stdiostream_vmessage’ from ‘stdiostream_message’
#   83|   
#   84|       putc('\n', lg->f);
#   85|->     fflush(lg->f);
#   86|   }
#   87|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def950]
xen-4.20.2/tools/libs/util/libxlu_cfg.c:672:21: warning[-Wanalyzer-malloc-leak]: leak of ‘q’
xen-4.20.2/tools/libs/util/libxlu_cfg.c:598:7: enter_function: entry to ‘xlu__cfgl_dequote’
xen-4.20.2/tools/libs/util/libxlu_cfg.c:604:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:606:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:607:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:609:13: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:610:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:614:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:615:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:617:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:618:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:619:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:619:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:620:18: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:654:17: call_function: calling ‘xlu__cfgl_lexicalerror’ from ‘xlu__cfgl_dequote’
#  670|   void xlu__cfgl_lexicalerror(CfgParseContext *ctx, char const *msg) {
#  671|       YYLTYPE loc;
#  672|->     loc.first_line= xlu__cfg_yyget_lineno(ctx->scanner);
#  673|       xlu__cfg_yyerror(&loc, ctx, msg);
#  674|       ctx->lexerrlineno= loc.first_line;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def951]
xen-4.20.2/tools/libs/util/libxlu_cfg.c:684:11: warning[-Wanalyzer-malloc-leak]: leak of ‘q’
xen-4.20.2/tools/libs/util/libxlu_cfg.c:598:7: enter_function: entry to ‘xlu__cfgl_dequote’
xen-4.20.2/tools/libs/util/libxlu_cfg.c:604:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:606:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:607:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:609:13: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:610:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:614:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:615:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:617:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:618:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:619:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:619:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:620:18: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:654:17: call_function: calling ‘xlu__cfgl_lexicalerror’ from ‘xlu__cfgl_dequote’
#  682|       if (lineno <= ctx->lexerrlineno) return;
#  683|   
#  684|->     text= xlu__cfg_yyget_text(ctx->scanner);
#  685|       len= xlu__cfg_yyget_leng(ctx->scanner);
#  686|       newline= "";

Error: GCC_ANALYZER_WARNING (CWE-401): [#def952]
xen-4.20.2/tools/libs/util/libxlu_cfg.c:685:10: warning[-Wanalyzer-malloc-leak]: leak of ‘q’
xen-4.20.2/tools/libs/util/libxlu_cfg.c:598:7: enter_function: entry to ‘xlu__cfgl_dequote’
xen-4.20.2/tools/libs/util/libxlu_cfg.c:604:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:606:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:607:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:609:13: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:610:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:614:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:615:10: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:617:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:618:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:619:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:619:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg.c:620:18: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg.c:654:17: call_function: calling ‘xlu__cfgl_lexicalerror’ from ‘xlu__cfgl_dequote’
#  683|   
#  684|       text= xlu__cfg_yyget_text(ctx->scanner);
#  685|->     len= xlu__cfg_yyget_leng(ctx->scanner);
#  686|       newline= "";
#  687|       if (len>0 && text[len-1]=='\n') {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def953]
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1720:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1707:21: enter_function: entry to ‘xlu__cfg_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1711:31: call_function: inlined call to ‘xlu__cfg_yyalloc’ from ‘xlu__cfg_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1712:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1715:9: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1720:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1718|   	 * we need to put in 2 end-of-buffer characters.
# 1719|   	 */
# 1720|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1721|   	if ( ! b->yy_ch_buf )
# 1722|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def954]
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1720:54: warning[-Wanalyzer-malloc-leak]: leak of ‘xlu__cfg_yyalloc(64, yyscanner)’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1707:21: enter_function: entry to ‘xlu__cfg_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1711:31: call_function: calling ‘xlu__cfg_yyalloc’ from ‘xlu__cfg_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1711:31: return_function: returning to ‘xlu__cfg_yy_create_buffer’ from ‘xlu__cfg_yyalloc’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1712:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1715:9: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1720:54: danger: ‘xlu__cfg_yyalloc(64, yyscanner)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 1718|   	 * we need to put in 2 end-of-buffer characters.
# 1719|   	 */
# 1720|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1721|   	if ( ! b->yy_ch_buf )
# 1722|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def955]
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1763:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1354:12: enter_function: entry to ‘yy_get_next_buffer’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1362:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1366:14: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1366:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1388:33: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1452:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1454:40: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1454:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1457:25: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1457:25: call_function: calling ‘xlu__cfg_yyrestart’ from ‘yy_get_next_buffer’
# 1761|   	yy_flush_buffer( b , yyscanner);
# 1762|   
# 1763|-> 	b->yy_input_file = file;
# 1764|   	b->yy_fill_buffer = 1;
# 1765|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def956]
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1981:33: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1965:17: enter_function: entry to ‘xlu__cfg_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1974:24: call_function: inlined call to ‘xlu__cfg_yyalloc’ from ‘xlu__cfg_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1975:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1975:12: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1983:13: call_function: calling ‘xlu__cfg_yy_scan_buffer’ from ‘xlu__cfg_yy_scan_bytes’
# 1979|   		buf[i] = yybytes[i];
# 1980|   
# 1981|-> 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1982|   
# 1983|   	b = yy_scan_buffer( buf, n , yyscanner);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def957]
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1981:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xlu__cfg_yyalloc(n,  yyscanner)’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1965:17: enter_function: entry to ‘xlu__cfg_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1974:24: call_function: calling ‘xlu__cfg_yyalloc’ from ‘xlu__cfg_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1974:24: return_function: returning to ‘xlu__cfg_yy_scan_bytes’ from ‘xlu__cfg_yyalloc’
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1975:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1975:12: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_l.c:1983:13: call_function: calling ‘xlu__cfg_yy_scan_buffer’ from ‘xlu__cfg_yy_scan_bytes’
# 1979|   		buf[i] = yybytes[i];
# 1980|   
# 1981|-> 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1982|   
# 1983|   	b = yy_scan_buffer( buf, n , yyscanner);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def958]
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1275:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1231:6: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1237:43: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1263:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1265:7: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1273:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1273:12: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1275:9: danger: use of uninitialized value ‘yyss’ here
# 1273|           if (! yyptr)
# 1274|             goto yyexhaustedlab;
# 1275|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1276|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1277|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def959]
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1394:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.string’
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1231:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1298:6: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1298:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1301:3: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1313:6: branch_true: following ‘true’ branch (when ‘yyn == -18’)...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1314:5: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1374:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1376:3: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_cfg_y.c:1394:3: danger: use of uninitialized value ‘*<unknown>.string’ here
# 1392|        unconditionally makes the parser a bit smaller, and it avoids a
# 1393|        GCC warning that YYVAL may be used uninitialized.  */
# 1394|->   yyval = yyvsp[1-yylen];
# 1395|   
# 1396|     /* Default location. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def960]
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2388:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2375:21: enter_function: entry to ‘xlu__disk_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2379:24: call_function: inlined call to ‘xlu__disk_yyalloc’ from ‘xlu__disk_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2380:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2383:2: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2388:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 2386|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2387|   	 * we need to put in 2 end-of-buffer characters.
# 2388|-> 	 */
# 2389|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2390|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def961]
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2388:54: warning[-Wanalyzer-malloc-leak]: leak of ‘xlu__disk_yyalloc(64, yyscanner)’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2375:21: enter_function: entry to ‘xlu__disk_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2379:24: call_function: calling ‘xlu__disk_yyalloc’ from ‘xlu__disk_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2379:24: return_function: returning to ‘xlu__disk_yy_create_buffer’ from ‘xlu__disk_yyalloc’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2380:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2383:2: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2388:54: danger: ‘xlu__disk_yyalloc(64, yyscanner)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 2386|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2387|   	 * we need to put in 2 end-of-buffer characters.
# 2388|-> 	 */
# 2389|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2390|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def962]
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2431:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2310:10: enter_function: entry to ‘xlu__disk_yyrestart’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2315:16: call_function: calling ‘xlu__disk_yyensure_buffer_stack’ from ‘xlu__disk_yyrestart’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2315:16: return_function: returning to ‘xlu__disk_yyrestart’ from ‘xlu__disk_yyensure_buffer_stack’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2317:27: call_function: calling ‘xlu__disk_yy_create_buffer’ from ‘xlu__disk_yyrestart’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2317:27: return_function: returning to ‘xlu__disk_yyrestart’ from ‘xlu__disk_yy_create_buffer’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2320:2: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2320:2: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2320:2: call_function: calling ‘xlu__disk_yy_init_buffer’ from ‘xlu__disk_yyrestart’
# 2429|   
# 2430|   	yy_flush_buffer( b , yyscanner);
# 2431|-> 
# 2432|   	b->yy_input_file = file;
# 2433|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def963]
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2649:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2633:17: enter_function: entry to ‘xlu__disk_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2642:24: call_function: inlined call to ‘xlu__disk_yyalloc’ from ‘xlu__disk_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2643:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2643:12: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2651:6: call_function: calling ‘xlu__disk_yy_scan_buffer’ from ‘xlu__disk_yy_scan_bytes’
# 2647|   	for ( i = 0; i < _yybytes_len; ++i )
# 2648|   		buf[i] = yybytes[i];
# 2649|-> 
# 2650|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 2651|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def964]
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2649:26: warning[-Wanalyzer-malloc-leak]: leak of ‘xlu__disk_yyalloc(n,  yyscanner)’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2633:17: enter_function: entry to ‘xlu__disk_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2642:24: call_function: calling ‘xlu__disk_yyalloc’ from ‘xlu__disk_yy_scan_bytes’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2642:24: return_function: returning to ‘xlu__disk_yy_scan_bytes’ from ‘xlu__disk_yyalloc’
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2643:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2643:12: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_disk_l.c:2651:6: call_function: calling ‘xlu__disk_yy_scan_buffer’ from ‘xlu__disk_yy_scan_bytes’
# 2647|   	for ( i = 0; i < _yybytes_len; ++i )
# 2648|   		buf[i] = yybytes[i];
# 2649|-> 
# 2650|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 2651|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def965]
xen-4.20.2/tools/libs/util/libxlu_pci.c:211:1: warning[-Wanalyzer-malloc-leak]: leak of ‘key’
xen-4.20.2/tools/libs/util/libxlu_pci.c:142:5: enter_function: entry to ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:151:11: call_function: calling ‘parse_bdf’ from ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:151:11: return_function: returning to ‘xlu_pci_parse_spec_string’ from ‘parse_bdf’
xen-4.20.2/tools/libs/util/libxlu_pci.c:152:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:156:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:156:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:162:13: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:169:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:172:15: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:172:15: call_function: calling ‘parse_key_val’ from ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:172:15: return_function: returning to ‘xlu_pci_parse_spec_string’ from ‘parse_key_val’
xen-4.20.2/tools/libs/util/libxlu_pci.c:173:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:176:14: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:176:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:179:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:179:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:181:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:181:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:183:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:183:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:185:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:185:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:187:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:187:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:189:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:189:19: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:190:19: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:190:19: call_function: calling ‘parse_rdm_policy’ from ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:211:1: danger: ‘key’ leaks here; was allocated at [(23)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/22)
#  209|   
#  210|       return 0;
#  211|-> }
#  212|   
#  213|   int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def966]
xen-4.20.2/tools/libs/util/libxlu_pci.c:211:1: warning[-Wanalyzer-malloc-leak]: leak of ‘val’
xen-4.20.2/tools/libs/util/libxlu_pci.c:142:5: enter_function: entry to ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:151:11: call_function: calling ‘parse_bdf’ from ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:151:11: return_function: returning to ‘xlu_pci_parse_spec_string’ from ‘parse_bdf’
xen-4.20.2/tools/libs/util/libxlu_pci.c:152:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:156:13: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:156:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:162:13: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:169:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:172:15: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:172:15: call_function: calling ‘parse_key_val’ from ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:172:15: return_function: returning to ‘xlu_pci_parse_spec_string’ from ‘parse_key_val’
xen-4.20.2/tools/libs/util/libxlu_pci.c:173:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:176:14: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:176:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:179:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:179:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:181:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:181:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:183:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:183:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:185:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:185:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:187:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:187:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:189:21: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:189:19: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:190:19: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:190:19: call_function: calling ‘parse_rdm_policy’ from ‘xlu_pci_parse_spec_string’
xen-4.20.2/tools/libs/util/libxlu_pci.c:211:1: danger: ‘val’ leaks here; was allocated at [(25)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/24)
#  209|   
#  210|       return 0;
#  211|-> }
#  212|   
#  213|   int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def967]
xen-4.20.2/tools/libs/util/libxlu_pci.c:226:61: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’
xen-4.20.2/tools/libs/util/libxlu_pci.c:213:5: enter_function: entry to ‘xlu_rdm_parse’
xen-4.20.2/tools/libs/util/libxlu_pci.c:223:31: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_pci.c:223:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:226:33: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:226:50: branch_true: following ‘true’ branch (when ‘ptr < end’)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:227:9: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:229:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:230:17: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:233:27: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:239:17: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:226:50: branch_true: following ‘true’ branch (when ‘ptr < end’)...
xen-4.20.2/tools/libs/util/libxlu_pci.c:227:9: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:256:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/util/libxlu_pci.c:257:25: branch_true: ...to here
xen-4.20.2/tools/libs/util/libxlu_pci.c:259:22: call_function: calling ‘parse_rdm_policy’ from ‘xlu_rdm_parse’
#  224|           return ERROR_NOMEM;
#  225|   
#  226|->     for (tok = ptr, end = ptr + strlen(ptr) + 1; ptr < end; ptr++) {
#  227|           switch(state) {
#  228|           case STATE_TYPE:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def968]
xen-4.20.2/tools/libs/util/libxlu_vif.c:22:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tmprate’
xen-4.20.2/tools/libs/util/libxlu_vif.c:94:5: enter_function: entry to ‘xlu_vif_parse_rate’
xen-4.20.2/tools/libs/util/libxlu_vif.c:102:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_vif.c:103:8: branch_false: following ‘false’ branch (when ‘tmprate’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_vif.c:108:9: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:109:8: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/libs/util/libxlu_vif.c:112:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:112:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_vif.c:118:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:118:10: call_function: calling ‘vif_parse_rate_bytes_per_sec’ from ‘xlu_vif_parse_rate’
#   20|       int rc = 0;
#   21|   
#   22|->     regcomp(&rec, vif_bytes_per_sec_re, REG_EXTENDED|REG_NOSUB);
#   23|       if (regexec(&rec, bytes, 0, NULL, 0)) {
#   24|           xlu__vif_err(cfg, "invalid rate", bytes);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def969]
xen-4.20.2/tools/libs/util/libxlu_vif.c:23:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmprate’
xen-4.20.2/tools/libs/util/libxlu_vif.c:94:5: enter_function: entry to ‘xlu_vif_parse_rate’
xen-4.20.2/tools/libs/util/libxlu_vif.c:102:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_vif.c:103:8: branch_false: following ‘false’ branch (when ‘tmprate’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_vif.c:108:9: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:109:8: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/libs/util/libxlu_vif.c:112:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:112:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_vif.c:118:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:118:10: call_function: calling ‘vif_parse_rate_bytes_per_sec’ from ‘xlu_vif_parse_rate’
#   21|   
#   22|       regcomp(&rec, vif_bytes_per_sec_re, REG_EXTENDED|REG_NOSUB);
#   23|->     if (regexec(&rec, bytes, 0, NULL, 0)) {
#   24|           xlu__vif_err(cfg, "invalid rate", bytes);
#   25|           rc = EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def970]
xen-4.20.2/tools/libs/util/libxlu_vif.c:49:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tmprate’
xen-4.20.2/tools/libs/util/libxlu_vif.c:94:5: enter_function: entry to ‘xlu_vif_parse_rate’
xen-4.20.2/tools/libs/util/libxlu_vif.c:102:15: acquire_memory: allocated here
xen-4.20.2/tools/libs/util/libxlu_vif.c:103:8: branch_false: following ‘false’ branch (when ‘tmprate’ is non-NULL)...
xen-4.20.2/tools/libs/util/libxlu_vif.c:108:9: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:109:8: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/libs/util/libxlu_vif.c:112:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:112:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/util/libxlu_vif.c:118:10: branch_false: ...to here
xen-4.20.2/tools/libs/util/libxlu_vif.c:118:10: call_function: calling ‘vif_parse_rate_bytes_per_sec’ from ‘xlu_vif_parse_rate’
#   47|   
#   48|   out:
#   49|->     regfree(&rec);
#   50|       return rc;
#   51|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def971]
xen-4.20.2/tools/libs/vchan/init.c:80:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:371:20: call_function: calling ‘init_gnt_srv’ from ‘libxenvchan_server_init’
#   78|   	void *ring;
#   79|   
#   80|-> 	ring = xengntshr_share_page_notify(ctrl->gntshr, domain,
#   81|   			&ring_ref, 1, offsetof(struct vchan_interface, srv_live),
#   82|   			ctrl->event_port);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def972]
xen-4.20.2/tools/libs/vchan/init.c:106:37: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:371:20: call_function: calling ‘init_gnt_srv’ from ‘libxenvchan_server_init’
#  104|   		break;
#  105|   	default:
#  106|-> 		ctrl->read.buffer = xengntshr_share_pages(ctrl->gntshr, domain,
#  107|   			pages_left, ctrl->ring->grants, 1);
#  108|   		if (!ctrl->read.buffer)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def973]
xen-4.20.2/tools/libs/vchan/init.c:120:38: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:371:20: call_function: calling ‘init_gnt_srv’ from ‘libxenvchan_server_init’
#  118|   		break;
#  119|   	default:
#  120|-> 		ctrl->write.buffer = xengntshr_share_pages(ctrl->gntshr, domain,
#  121|   			pages_right, ctrl->ring->grants + pages_left, 1);
#  122|   		if (!ctrl->write.buffer)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def974]
xen-4.20.2/tools/libs/vchan/init.c:132:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:371:20: call_function: calling ‘init_gnt_srv’ from ‘libxenvchan_server_init’
#  130|   		xengntshr_unshare(ctrl->gntshr, ctrl->read.buffer, pages_left);
#  131|   out_ring:
#  132|-> 	xengntshr_unshare(ctrl->gntshr, ring, 1);
#  133|   	ring_ref = -1;
#  134|   	ctrl->ring = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def975]
xen-4.20.2/tools/libs/vchan/init.c:144:22: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
#  142|   	uint32_t *grants;
#  143|   
#  144|-> 	ctrl->ring = xengnttab_map_grant_ref_notify(ctrl->gnttab,
#  145|   		domain, ring_ref, PROT_READ|PROT_WRITE,
#  146|   		offsetof(struct vchan_interface, cli_live), ctrl->event_port);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def976]
xen-4.20.2/tools/libs/vchan/init.c:174:46: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
#  172|   		{
#  173|   			int pages_left = 1 << (ctrl->write.order - PAGE_SHIFT);
#  174|-> 			ctrl->write.buffer = xengnttab_map_domain_grant_refs(ctrl->gnttab,
#  175|   				pages_left, domain, grants, PROT_READ|PROT_WRITE);
#  176|   			if (!ctrl->write.buffer)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def977]
xen-4.20.2/tools/libs/vchan/init.c:192:45: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
#  190|   		{
#  191|   			int pages_right = 1 << (ctrl->read.order - PAGE_SHIFT);
#  192|-> 			ctrl->read.buffer = xengnttab_map_domain_grant_refs(ctrl->gnttab,
#  193|   				pages_right, domain, grants, PROT_READ);
#  194|   			if (!ctrl->read.buffer)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def978]
xen-4.20.2/tools/libs/vchan/init.c:204:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
#  202|    out_unmap_left:
#  203|   	if (ctrl->write.order >= PAGE_SHIFT)
#  204|-> 		xengnttab_unmap(ctrl->gnttab, ctrl->write.buffer,
#  205|   		                1 << (ctrl->write.order - PAGE_SHIFT));
#  206|    out_unmap_ring:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def979]
xen-4.20.2/tools/libs/vchan/init.c:207:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
#  205|   		                1 << (ctrl->write.order - PAGE_SHIFT));
#  206|    out_unmap_ring:
#  207|-> 	xengnttab_unmap(ctrl->gnttab, ctrl->ring, 1);
#  208|   	ctrl->ring = 0;
#  209|   	ctrl->write.order = ctrl->read.order = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def980]
xen-4.20.2/tools/libs/vchan/init.c:219:23: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
#  217|   	xenevtchn_port_or_error_t port;
#  218|   
#  219|-> 	ctrl->event = xenevtchn_open(logger, 0);
#  220|   	if (!ctrl->event)
#  221|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def981]
xen-4.20.2/tools/libs/vchan/init.c:223:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
#  221|   		return -1;
#  222|   
#  223|-> 	port = xenevtchn_bind_unbound_port(ctrl->event, domain);
#  224|   	if (port < 0)
#  225|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def982]
xen-4.20.2/tools/libs/vchan/init.c:228:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
#  226|   	ctrl->event_port = port;
#  227|   
#  228|-> 	if (xenevtchn_unmask(ctrl->event, ctrl->event_port))
#  229|   		goto fail;
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def983]
xen-4.20.2/tools/libs/vchan/init.c:235:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
#  233|   fail:
#  234|   	if (port >= 0)
#  235|-> 		xenevtchn_unbind(ctrl->event, port);
#  236|   
#  237|   	xenevtchn_close(ctrl->event);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def984]
xen-4.20.2/tools/libs/vchan/init.c:237:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
#  235|   		xenevtchn_unbind(ctrl->event, port);
#  236|   
#  237|-> 	xenevtchn_close(ctrl->event);
#  238|   	ctrl->event = NULL;
#  239|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def985]
xen-4.20.2/tools/libs/vchan/init.c:258:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  256|   		return -1; 
#  257|   
#  258|-> 	xs = xs_open(0);
#  259|   	if (!xs)
#  260|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def986]
xen-4.20.2/tools/libs/vchan/init.c:258:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  256|   		return -1; 
#  257|   
#  258|-> 	xs = xs_open(0);
#  259|   	if (!xs)
#  260|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def987]
xen-4.20.2/tools/libs/vchan/init.c:261:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  259|   	if (!xs)
#  260|   		goto fail;
#  261|-> 	domid_str = xs_read(xs, 0, "domid", NULL);
#  262|   	if (!domid_str)
#  263|   		goto fail_xs_open;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def988]
xen-4.20.2/tools/libs/vchan/init.c:261:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  259|   	if (!xs)
#  260|   		goto fail;
#  261|-> 	domid_str = xs_read(xs, 0, "domid", NULL);
#  262|   	if (!domid_str)
#  263|   		goto fail_xs_open;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def989]
xen-4.20.2/tools/libs/vchan/init.c:274:20: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  272|   
#  273|   retry_transaction:
#  274|-> 	xs_trans = xs_transaction_start(xs);
#  275|   	if (!xs_trans)
#  276|   		goto fail_xs_open;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def990]
xen-4.20.2/tools/libs/vchan/init.c:274:20: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  272|   
#  273|   retry_transaction:
#  274|-> 	xs_trans = xs_transaction_start(xs);
#  275|   	if (!xs_trans)
#  276|   		goto fail_xs_open;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def991]
xen-4.20.2/tools/libs/vchan/init.c:280:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  278|   	snprintf(ref, sizeof ref, "%d", ring_ref);
#  279|   	snprintf(buf, sizeof buf, "%s/ring-ref", xs_base);
#  280|-> 	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  281|   		goto fail_xs_open;
#  282|   	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def992]
xen-4.20.2/tools/libs/vchan/init.c:280:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  278|   	snprintf(ref, sizeof ref, "%d", ring_ref);
#  279|   	snprintf(buf, sizeof buf, "%s/ring-ref", xs_base);
#  280|-> 	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  281|   		goto fail_xs_open;
#  282|   	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def993]
xen-4.20.2/tools/libs/vchan/init.c:282:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  280|   	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  281|   		goto fail_xs_open;
#  282|-> 	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))
#  283|   		goto fail_xs_open;
#  284|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def994]
xen-4.20.2/tools/libs/vchan/init.c:282:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  280|   	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  281|   		goto fail_xs_open;
#  282|-> 	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))
#  283|   		goto fail_xs_open;
#  284|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def995]
xen-4.20.2/tools/libs/vchan/init.c:287:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  285|   	snprintf(ref, sizeof ref, "%d", ctrl->event_port);
#  286|   	snprintf(buf, sizeof buf, "%s/event-channel", xs_base);
#  287|-> 	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  288|   		goto fail_xs_open;
#  289|   	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def996]
xen-4.20.2/tools/libs/vchan/init.c:287:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  285|   	snprintf(ref, sizeof ref, "%d", ctrl->event_port);
#  286|   	snprintf(buf, sizeof buf, "%s/event-channel", xs_base);
#  287|-> 	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  288|   		goto fail_xs_open;
#  289|   	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def997]
xen-4.20.2/tools/libs/vchan/init.c:289:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  287|   	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  288|   		goto fail_xs_open;
#  289|-> 	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))
#  290|   		goto fail_xs_open;
#  291|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def998]
xen-4.20.2/tools/libs/vchan/init.c:289:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  287|   	if (!xs_write(xs, xs_trans, buf, ref, strlen(ref)))
#  288|   		goto fail_xs_open;
#  289|-> 	if (!xs_set_permissions(xs, xs_trans, buf, perms, 2))
#  290|   		goto fail_xs_open;
#  291|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def999]
xen-4.20.2/tools/libs/vchan/init.c:292:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  290|   		goto fail_xs_open;
#  291|   
#  292|-> 	if (!xs_transaction_end(xs, xs_trans, 0)) {
#  293|   		if (errno == EAGAIN)
#  294|   			goto retry_transaction;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1000]
xen-4.20.2/tools/libs/vchan/init.c:292:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:329:21: enter_function: entry to ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:369:13: call_function: calling ‘init_evt_srv’ from ‘libxenvchan_server_init’
xen-4.20.2/tools/libs/vchan/init.c:369:13: return_function: returning to ‘libxenvchan_server_init’ from ‘init_evt_srv’
xen-4.20.2/tools/libs/vchan/init.c:369:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:371:20: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:372:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:374:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:374:13: call_function: calling ‘init_xs_srv’ from ‘libxenvchan_server_init’
#  290|   		goto fail_xs_open;
#  291|   
#  292|-> 	if (!xs_transaction_end(xs, xs_trans, 0)) {
#  293|   		if (errno == EAGAIN)
#  294|   			goto retry_transaction;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1001]
xen-4.20.2/tools/libs/vchan/init.c:363:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:363:24: throw: if ‘xengntshr_open’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:363:24: danger: ‘ctrl’ leaks here; was allocated at [(3)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/2)
#  361|   	}
#  362|   
#  363|-> 	ctrl->gntshr = xengntshr_open(logger, 0);
#  364|   	if (!ctrl->gntshr) {
#  365|   		free(ctrl);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1002]
xen-4.20.2/tools/libs/vchan/init.c:378:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:335:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:338:16: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:338:16: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:339:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:342:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:364:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:369:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:378:9: throw: if ‘libxenvchan_close’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:378:9: danger: ‘ctrl’ leaks here; was allocated at [(3)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/2)
#  376|   	return ctrl;
#  377|   out:
#  378|-> 	libxenvchan_close(ctrl);
#  379|   	return 0;
#  380|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1003]
xen-4.20.2/tools/libs/vchan/init.c:387:23: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
#  385|   	xenevtchn_port_or_error_t port;
#  386|   
#  387|-> 	ctrl->event = xenevtchn_open(logger, 0);
#  388|   	if (!ctrl->event)
#  389|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1004]
xen-4.20.2/tools/libs/vchan/init.c:391:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
#  389|   		return -1;
#  390|   
#  391|-> 	port = xenevtchn_bind_interdomain(ctrl->event,
#  392|   		domain, ctrl->event_port);
#  393|   	if (port < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1005]
xen-4.20.2/tools/libs/vchan/init.c:397:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
#  395|   	ctrl->event_port = port;
#  396|   
#  397|-> 	if (xenevtchn_unmask(ctrl->event, ctrl->event_port))
#  398|   		goto fail;
#  399|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1006]
xen-4.20.2/tools/libs/vchan/init.c:404:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
#  402|   fail:
#  403|   	if (port >= 0)
#  404|-> 		xenevtchn_unbind(ctrl->event, port);
#  405|   
#  406|   	xenevtchn_close(ctrl->event);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1007]
xen-4.20.2/tools/libs/vchan/init.c:406:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
#  404|   		xenevtchn_unbind(ctrl->event, port);
#  405|   
#  406|-> 	xenevtchn_close(ctrl->event);
#  407|   	ctrl->event = NULL;
#  408|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1008]
xen-4.20.2/tools/libs/vchan/init.c:431:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:431:14: throw: if ‘xs_open’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:431:14: danger: ‘ctrl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/0)
#  429|   	ctrl->is_server = 0;
#  430|   
#  431|-> 	xs = xs_open(0);
#  432|   	if (!xs)
#  433|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1009]
xen-4.20.2/tools/libs/vchan/init.c:437:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:437:15: throw: if ‘xs_read’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:437:15: danger: ‘ctrl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0)
#  435|   // find xenstore entry
#  436|   	snprintf(buf, sizeof buf, "%s/ring-ref", xs_path);
#  437|-> 	ref = xs_read(xs, 0, buf, &len);
#  438|   	if (!ref)
#  439|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1010]
xen-4.20.2/tools/libs/vchan/init.c:445:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:445:15: throw: if ‘xs_read’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:445:15: danger: ‘ctrl’ leaks here; was allocated at [(2)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/1)
#  443|   		goto fail;
#  444|   	snprintf(buf, sizeof buf, "%s/event-channel", xs_path);
#  445|-> 	ref = xs_read(xs, 0, buf, &len);
#  446|   	if (!ref)
#  447|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1011]
xen-4.20.2/tools/libs/vchan/init.c:453:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:453:24: throw: if ‘xengnttab_open’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:453:24: danger: ‘ctrl’ leaks here; was allocated at [(2)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/1)
#  451|   		goto fail;
#  452|   
#  453|-> 	ctrl->gnttab = xengnttab_open(logger, 0);
#  454|   	if (!ctrl->gnttab)
#  455|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1012]
xen-4.20.2/tools/libs/vchan/init.c:469:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:462:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_gnt_cli’
xen-4.20.2/tools/libs/vchan/init.c:462:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:465:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:469:9: throw: if ‘xenevtchn_notify’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:469:9: danger: ‘ctrl’ leaks here; was allocated at [(2)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/1)
#  467|   
#  468|   	/* wake up the server */
#  469|-> 	xenevtchn_notify(ctrl->event, ctrl->event_port);
#  470|   
#  471|    out:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1013]
xen-4.20.2/tools/libs/vchan/init.c:473:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:413:21: enter_function: entry to ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:432:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:436:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:440:20: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:442:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:444:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:446:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:448:28: call_function: inlined call to ‘atoi’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:450:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:453:24: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:458:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:458:13: call_function: calling ‘init_evt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:458:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_evt_cli’
xen-4.20.2/tools/libs/vchan/init.c:458:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:462:13: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:462:13: call_function: calling ‘init_gnt_cli’ from ‘libxenvchan_client_init’
xen-4.20.2/tools/libs/vchan/init.c:462:13: return_function: returning to ‘libxenvchan_client_init’ from ‘init_gnt_cli’
xen-4.20.2/tools/libs/vchan/init.c:462:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/libs/vchan/init.c:465:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:472:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/libs/vchan/init.c:473:17: branch_true: ...to here
xen-4.20.2/tools/libs/vchan/init.c:473:17: throw: if ‘xs_close’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:473:17: danger: ‘ctrl’ leaks here; was allocated at [(2)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/1)
#  471|    out:
#  472|   	if (xs)
#  473|-> 		xs_close(xs);
#  474|   	return ctrl;
#  475|    fail:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1014]
xen-4.20.2/tools/libs/vchan/init.c:476:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctrl’
xen-4.20.2/tools/libs/vchan/init.c:416:36: acquire_memory: allocated here
xen-4.20.2/tools/libs/vchan/init.c:423:12: branch_false: following ‘false’ branch (when ‘ctrl’ is non-NULL)...
xen-4.20.2/tools/libs/vchan/init.c:425:9: branch_false: ...to here
xen-4.20.2/tools/libs/vchan/init.c:476:9: throw: if ‘libxenvchan_close’ throws an exception...
xen-4.20.2/tools/libs/vchan/init.c:476:9: danger: ‘ctrl’ leaks here; was allocated at [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
#  474|   	return ctrl;
#  475|    fail:
#  476|-> 	libxenvchan_close(ctrl);
#  477|   	ctrl = NULL;
#  478|   	goto out;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1015]
xen-4.20.2/tools/misc/xen-access.c:209:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xenaccess’
xen-4.20.2/tools/misc/xen-access.c:198:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-access.c:201:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-access.c:205:17: acquire_memory: this call could return NULL
xen-4.20.2/tools/misc/xen-access.c:209:5: danger: ‘xenaccess’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  207|   
#  208|       /* Open connection to xen */
#  209|->     xenaccess->xc_handle = xch;
#  210|   
#  211|       /* Set domain id */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1016]
xen-4.20.2/tools/misc/xen-access.c:216:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xenaccess’
xen-4.20.2/tools/misc/xen-access.c:198:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-access.c:201:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-access.c:205:17: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-access.c:216:13: throw: if ‘xc_monitor_enable’ throws an exception...
xen-4.20.2/tools/misc/xen-access.c:216:13: danger: ‘xenaccess’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  214|       /* Enable mem_access */
#  215|       xenaccess->vm_event.ring_page =
#  216|->             xc_monitor_enable(xenaccess->xc_handle,
#  217|                                 xenaccess->vm_event.domain_id,
#  218|                                 &xenaccess->vm_event.evtchn_port);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1017]
xen-4.20.2/tools/misc/xen-cpuid.c:314:13: warning[-Wanalyzer-malloc-leak]: leak of ‘leaves’
xen-4.20.2/tools/misc/xen-cpuid.c:240:16: branch_false: following ‘false’ branch (when ‘tmp_optarg’ is NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:420:1: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_true: following ‘true’ branch (when ‘domid == -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:306:13: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:309:18: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_true: following ‘true’ branch (when ‘msrs’ is NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:314:13: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:314:13: throw: if ‘err’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:314:13: danger: ‘leaves’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#  312|           msrs = calloc(max_msrs, sizeof(xen_msr_entry_t));
#  313|           if ( !msrs )
#  314|->             err(1, "calloc(max_msrs)");
#  315|   
#  316|           if ( domid != -1 )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1018]
xen-4.20.2/tools/misc/xen-cpuid.c:322:18: warning[-Wanalyzer-malloc-leak]: leak of ‘leaves’
xen-4.20.2/tools/misc/xen-cpuid.c:213:12: branch_false: following ‘false’ branch (when ‘c != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:216:9: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:246:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:309:18: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_true: following ‘true’ branch (when ‘domid != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:319:22: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:322:18: throw: if ‘xc_cpu_policy_get_domain’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:322:18: danger: ‘leaves’ leaks here; was allocated at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
#  320|               uint32_t nr_msrs = max_msrs;
#  321|   
#  322|->             if ( xc_cpu_policy_get_domain(xch, domid, policy) )
#  323|                   err(1, "xc_cpu_policy_get_domain(, %d, )", domid);
#  324|               if ( xc_cpu_policy_serialise(xch, policy, leaves, &nr_leaves,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1019]
xen-4.20.2/tools/misc/xen-cpuid.c:322:18: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs’
xen-4.20.2/tools/misc/xen-cpuid.c:213:12: branch_false: following ‘false’ branch (when ‘c != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:216:9: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:246:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_true: following ‘true’ branch (when ‘domid != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:319:22: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:322:18: throw: if ‘xc_cpu_policy_get_domain’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:322:18: danger: ‘msrs’ leaks here; was allocated at [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16)
#  320|               uint32_t nr_msrs = max_msrs;
#  321|   
#  322|->             if ( xc_cpu_policy_get_domain(xch, domid, policy) )
#  323|                   err(1, "xc_cpu_policy_get_domain(, %d, )", domid);
#  324|               if ( xc_cpu_policy_serialise(xch, policy, leaves, &nr_leaves,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1020]
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: warning[-Wanalyzer-malloc-leak]: leak of ‘leaves’
xen-4.20.2/tools/misc/xen-cpuid.c:213:12: branch_false: following ‘false’ branch (when ‘c != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:216:9: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:246:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:309:18: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_true: following ‘true’ branch (when ‘domid != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:319:22: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:322:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: throw: if ‘err’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: danger: ‘leaves’ leaks here; was allocated at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  321|   
#  322|               if ( xc_cpu_policy_get_domain(xch, domid, policy) )
#  323|->                 err(1, "xc_cpu_policy_get_domain(, %d, )", domid);
#  324|               if ( xc_cpu_policy_serialise(xch, policy, leaves, &nr_leaves,
#  325|                                            msrs, &nr_msrs) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1021]
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs’
xen-4.20.2/tools/misc/xen-cpuid.c:213:12: branch_false: following ‘false’ branch (when ‘c != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:216:9: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:246:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_true: following ‘true’ branch (when ‘domid != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:319:22: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:322:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: throw: if ‘err’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:323:17: danger: ‘msrs’ leaks here; was allocated at [(17)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/16)
#  321|   
#  322|               if ( xc_cpu_policy_get_domain(xch, domid, policy) )
#  323|->                 err(1, "xc_cpu_policy_get_domain(, %d, )", domid);
#  324|               if ( xc_cpu_policy_serialise(xch, policy, leaves, &nr_leaves,
#  325|                                            msrs, &nr_msrs) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1022]
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: warning[-Wanalyzer-malloc-leak]: leak of ‘leaves’
xen-4.20.2/tools/misc/xen-cpuid.c:213:12: branch_false: following ‘false’ branch (when ‘c != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:216:9: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:246:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:309:18: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_true: following ‘true’ branch (when ‘domid != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:319:22: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:322:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: throw: if ‘xc_cpu_policy_serialise’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: danger: ‘leaves’ leaks here; was allocated at [(15)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/14)
#  322|               if ( xc_cpu_policy_get_domain(xch, domid, policy) )
#  323|                   err(1, "xc_cpu_policy_get_domain(, %d, )", domid);
#  324|->             if ( xc_cpu_policy_serialise(xch, policy, leaves, &nr_leaves,
#  325|                                            msrs, &nr_msrs) )
#  326|                   err(1, "xc_cpu_policy_serialise");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1023]
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs’
xen-4.20.2/tools/misc/xen-cpuid.c:213:12: branch_false: following ‘false’ branch (when ‘c != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:216:9: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:246:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:258:8: branch_false: following ‘false’ branch (when ‘mode != 0’)...
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:281:8: branch_true: following ‘true’ branch (when ‘mode == 4’)...
xen-4.20.2/tools/misc/xen-cpuid.c:295:29: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:298:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:300:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:303:14: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:303:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:305:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:310:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:312:16: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-cpuid.c:313:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:316:12: branch_true: following ‘true’ branch (when ‘domid != -1’)...
xen-4.20.2/tools/misc/xen-cpuid.c:319:22: branch_true: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:322:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: throw: if ‘xc_cpu_policy_serialise’ throws an exception...
xen-4.20.2/tools/misc/xen-cpuid.c:324:18: danger: ‘msrs’ leaks here; was allocated at [(17)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/16)
#  322|               if ( xc_cpu_policy_get_domain(xch, domid, policy) )
#  323|                   err(1, "xc_cpu_policy_get_domain(, %d, )", domid);
#  324|->             if ( xc_cpu_policy_serialise(xch, policy, leaves, &nr_leaves,
#  325|                                            msrs, &nr_msrs) )
#  326|                   err(1, "xc_cpu_policy_serialise");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1024]
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/misc/xen-livepatch.c:82:8: branch_false: following ‘false’ branch (when ‘argc == 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:87:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:90:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:99:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:105:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:105:12: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:106:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:109:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:110:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:113:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:114:8: branch_false: following ‘false’ branch (when ‘len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:117:23: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:118:8: branch_false: following ‘false’ branch (when ‘metadata’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:121:20: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:122:8: branch_false: following ‘false’ branch (when ‘metadata_len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:125:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: throw: if ‘xc_livepatch_list’ throws an exception...
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: danger: ‘info’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  130|       name_off = metadata_off = 0;
#  131|   
#  132|->     rc = xc_livepatch_list(xch, nr, 0, info, name, len, name_total_size,
#  133|                              metadata, metadata_len, metadata_total_size, &done, &left);
#  134|       if ( rc || done != nr || left > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1025]
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: warning[-Wanalyzer-malloc-leak]: leak of ‘len’
xen-4.20.2/tools/misc/xen-livepatch.c:82:8: branch_false: following ‘false’ branch (when ‘argc == 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:87:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:90:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:99:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:105:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:106:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:109:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:110:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:113:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:113:11: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:114:8: branch_false: following ‘false’ branch (when ‘len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:117:23: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:118:8: branch_false: following ‘false’ branch (when ‘metadata’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:121:20: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:122:8: branch_false: following ‘false’ branch (when ‘metadata_len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:125:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: throw: if ‘xc_livepatch_list’ throws an exception...
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: danger: ‘len’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  130|       name_off = metadata_off = 0;
#  131|   
#  132|->     rc = xc_livepatch_list(xch, nr, 0, info, name, len, name_total_size,
#  133|                              metadata, metadata_len, metadata_total_size, &done, &left);
#  134|       if ( rc || done != nr || left > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1026]
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_len’
xen-4.20.2/tools/misc/xen-livepatch.c:82:8: branch_false: following ‘false’ branch (when ‘argc == 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:87:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:90:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:99:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:105:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:106:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:109:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:110:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:113:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:114:8: branch_false: following ‘false’ branch (when ‘len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:117:23: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:118:8: branch_false: following ‘false’ branch (when ‘metadata’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:121:20: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:121:20: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:122:8: branch_false: following ‘false’ branch (when ‘metadata_len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:125:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: throw: if ‘xc_livepatch_list’ throws an exception...
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: danger: ‘metadata_len’ leaks here; was allocated at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  130|       name_off = metadata_off = 0;
#  131|   
#  132|->     rc = xc_livepatch_list(xch, nr, 0, info, name, len, name_total_size,
#  133|                              metadata, metadata_len, metadata_total_size, &done, &left);
#  134|       if ( rc || done != nr || left > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1027]
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata’
xen-4.20.2/tools/misc/xen-livepatch.c:82:8: branch_false: following ‘false’ branch (when ‘argc == 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:87:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:90:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:99:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:105:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:106:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:109:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:110:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:113:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:114:8: branch_false: following ‘false’ branch (when ‘len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:117:23: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:117:16: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:118:8: branch_false: following ‘false’ branch (when ‘metadata’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:121:20: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:122:8: branch_false: following ‘false’ branch (when ‘metadata_len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:125:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: throw: if ‘xc_livepatch_list’ throws an exception...
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: danger: ‘metadata’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  130|       name_off = metadata_off = 0;
#  131|   
#  132|->     rc = xc_livepatch_list(xch, nr, 0, info, name, len, name_total_size,
#  133|                              metadata, metadata_len, metadata_total_size, &done, &left);
#  134|       if ( rc || done != nr || left > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1028]
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
xen-4.20.2/tools/misc/xen-livepatch.c:82:8: branch_false: following ‘false’ branch (when ‘argc == 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:87:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:90:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:99:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:105:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:106:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:109:12: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:109:12: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:110:8: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:113:18: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:114:8: branch_false: following ‘false’ branch (when ‘len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:117:23: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:118:8: branch_false: following ‘false’ branch (when ‘metadata’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:121:20: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:122:8: branch_false: following ‘false’ branch (when ‘metadata_len’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:125:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: throw: if ‘xc_livepatch_list’ throws an exception...
xen-4.20.2/tools/misc/xen-livepatch.c:132:10: danger: ‘name’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  130|       name_off = metadata_off = 0;
#  131|   
#  132|->     rc = xc_livepatch_list(xch, nr, 0, info, name, len, name_total_size,
#  133|                              metadata, metadata_len, metadata_total_size, &done, &left);
#  134|       if ( rc || done != nr || left > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1029]
xen-4.20.2/tools/misc/xen-livepatch.c:216:10: warning[-Wanalyzer-malloc-leak]: leak of ‘apply_argv’
xen-4.20.2/tools/misc/xen-livepatch.c:501:12: enter_function: entry to ‘load_func’
xen-4.20.2/tools/misc/xen-livepatch.c:507:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:515:8: branch_false: following ‘false’ branch (when ‘apply_argv’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:519:22: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:526:8: branch_true: following ‘true’ branch (when ‘lastdot’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:527:9: branch_true: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:535:10: call_function: calling ‘upload_func’ from ‘load_func’
#  214|   
#  215|       filename = argv[1];
#  216|->     fd = open(filename, O_RDONLY);
#  217|       if ( fd < 0 )
#  218|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1030]
xen-4.20.2/tools/misc/xen-livepatch.c:228:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 0)’
xen-4.20.2/tools/misc/xen-livepatch.c:197:12: enter_function: entry to ‘upload_func’
xen-4.20.2/tools/misc/xen-livepatch.c:206:8: branch_false: following ‘false’ branch (when ‘argc == 2’)...
xen-4.20.2/tools/misc/xen-livepatch.c:212:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:212:10: call_function: calling ‘get_name’ from ‘upload_func’
xen-4.20.2/tools/misc/xen-livepatch.c:212:10: return_function: returning to ‘upload_func’ from ‘get_name’
xen-4.20.2/tools/misc/xen-livepatch.c:212:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:215:5: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:216:10: acquire_resource: opened here
xen-4.20.2/tools/misc/xen-livepatch.c:217:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:225:10: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:225:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xen-livepatch.c:227:27: branch_true: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:228:9: danger: ‘open(filename, 0)’ leaks here; was opened at [(10)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/9)
#  226|       {
#  227|           int saved_errno = errno;
#  228|->         fprintf(stderr, "Could not get size of %s.\n"
#  229|                           "Error %d: %s\n",
#  230|                   filename, saved_errno, strerror(saved_errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1031]
xen-4.20.2/tools/misc/xen-livepatch.c:231:9: warning[-Wanalyzer-malloc-leak]: leak of ‘apply_argv’
xen-4.20.2/tools/misc/xen-livepatch.c:501:12: enter_function: entry to ‘load_func’
xen-4.20.2/tools/misc/xen-livepatch.c:507:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:515:8: branch_false: following ‘false’ branch (when ‘apply_argv’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:519:22: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:526:8: branch_true: following ‘true’ branch (when ‘lastdot’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:527:9: branch_true: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:535:10: call_function: calling ‘upload_func’ from ‘load_func’
#  229|                           "Error %d: %s\n",
#  230|                   filename, saved_errno, strerror(saved_errno));
#  231|->         close(fd);
#  232|           return saved_errno;
#  233|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1032]
xen-4.20.2/tools/misc/xen-livepatch.c:243:9: warning[-Wanalyzer-malloc-leak]: leak of ‘apply_argv’
xen-4.20.2/tools/misc/xen-livepatch.c:501:12: enter_function: entry to ‘load_func’
xen-4.20.2/tools/misc/xen-livepatch.c:507:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:515:8: branch_false: following ‘false’ branch (when ‘apply_argv’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:519:22: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:526:8: branch_true: following ‘true’ branch (when ‘lastdot’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:527:9: branch_true: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:535:10: call_function: calling ‘upload_func’ from ‘load_func’
#  241|                           "Error %d: %s\n",
#  242|                   filename, saved_errno, strerror(saved_errno));
#  243|->         close (fd);
#  244|           return saved_errno;
#  245|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1033]
xen-4.20.2/tools/misc/xen-livepatch.c:247:10: warning[-Wanalyzer-malloc-leak]: leak of ‘apply_argv’
xen-4.20.2/tools/misc/xen-livepatch.c:501:12: enter_function: entry to ‘load_func’
xen-4.20.2/tools/misc/xen-livepatch.c:507:8: branch_false: following ‘false’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:514:28: acquire_memory: allocated here
xen-4.20.2/tools/misc/xen-livepatch.c:515:8: branch_false: following ‘false’ branch (when ‘apply_argv’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:519:22: branch_false: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:526:8: branch_true: following ‘true’ branch (when ‘lastdot’ is non-NULL)...
xen-4.20.2/tools/misc/xen-livepatch.c:527:9: branch_true: ...to here
xen-4.20.2/tools/misc/xen-livepatch.c:535:10: call_function: calling ‘upload_func’ from ‘load_func’
#  245|       }
#  246|       printf("Uploading %s... ", filename);
#  247|->     rc = xc_livepatch_upload(xch, name, fbuf, len, force);
#  248|       if ( rc )
#  249|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1034]
xen-4.20.2/tools/misc/xencov.c:77:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
xen-4.20.2/tools/misc/xencov.c:44:13: enter_function: entry to ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: call_function: calling ‘cov_sysctl’ from ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: return_function: returning to ‘cov_read’ from ‘cov_sysctl’
xen-4.20.2/tools/misc/xencov.c:51:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:53:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:56:8: branch_false: following ‘false’ branch (when ‘total_len <= 8388608’)...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:60:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:63:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:68:10: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:68:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/misc/xencov.c:71:13: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:71:13: acquire_resource: opened here
xen-4.20.2/tools/misc/xencov.c:73:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/misc/xencov.c:76:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:76:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xencov.c:77:9: branch_true: ...to here
xen-4.20.2/tools/misc/xencov.c:77:9: throw: if ‘err’ throws an exception...
xen-4.20.2/tools/misc/xencov.c:77:9: danger: ‘f’ leaks here; was opened at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#   75|   
#   76|       if (fwrite(p, 1, total_len, f) != total_len)
#   77|->         err(1, "writing gcov data to file");
#   78|   
#   79|       if (f != stdout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1035]
xen-4.20.2/tools/misc/xencov.c:77:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xen-4.20.2/tools/misc/xencov.c:44:13: enter_function: entry to ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: call_function: calling ‘cov_sysctl’ from ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: return_function: returning to ‘cov_read’ from ‘cov_sysctl’
xen-4.20.2/tools/misc/xencov.c:51:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:53:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:56:8: branch_false: following ‘false’ branch (when ‘total_len <= 8388608’)...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:60:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:63:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:68:10: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:68:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/misc/xencov.c:71:13: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:71:13: acquire_memory: allocated here
xen-4.20.2/tools/misc/xencov.c:73:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/misc/xencov.c:76:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:76:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xencov.c:77:9: branch_true: ...to here
xen-4.20.2/tools/misc/xencov.c:77:9: throw: if ‘err’ throws an exception...
xen-4.20.2/tools/misc/xencov.c:77:9: danger: ‘f’ leaks here; was allocated at [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
#   75|   
#   76|       if (fwrite(p, 1, total_len, f) != total_len)
#   77|->         err(1, "writing gcov data to file");
#   78|   
#   79|       if (f != stdout)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1036]
xen-4.20.2/tools/misc/xencov.c:82:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
xen-4.20.2/tools/misc/xencov.c:44:13: enter_function: entry to ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: call_function: calling ‘cov_sysctl’ from ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: return_function: returning to ‘cov_read’ from ‘cov_sysctl’
xen-4.20.2/tools/misc/xencov.c:51:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:53:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:56:8: branch_false: following ‘false’ branch (when ‘total_len <= 8388608’)...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:60:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:63:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:68:10: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:68:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/misc/xencov.c:71:13: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:71:13: acquire_resource: opened here
xen-4.20.2/tools/misc/xencov.c:73:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/misc/xencov.c:76:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:76:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:79:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:79:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:82:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:82:5: throw: if ‘xc__hypercall_buffer_free’ throws an exception...
xen-4.20.2/tools/misc/xencov.c:82:5: danger: ‘f’ leaks here; was opened at [(19)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/18)
#   80|           fclose(f);
#   81|   
#   82|->     xc_hypercall_buffer_free(xch, p);
#   83|   }
#   84|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1037]
xen-4.20.2/tools/misc/xencov.c:82:5: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xen-4.20.2/tools/misc/xencov.c:44:13: enter_function: entry to ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: call_function: calling ‘cov_sysctl’ from ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: return_function: returning to ‘cov_read’ from ‘cov_sysctl’
xen-4.20.2/tools/misc/xencov.c:51:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:53:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:56:8: branch_false: following ‘false’ branch (when ‘total_len <= 8388608’)...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:60:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:63:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:68:10: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:68:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/misc/xencov.c:71:13: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:71:13: acquire_memory: allocated here
xen-4.20.2/tools/misc/xencov.c:73:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/misc/xencov.c:76:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:76:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:79:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:79:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:82:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:82:5: throw: if ‘xc__hypercall_buffer_free’ throws an exception...
xen-4.20.2/tools/misc/xencov.c:82:5: danger: ‘f’ leaks here; was allocated at [(19)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/18)
#   80|           fclose(f);
#   81|   
#   82|->     xc_hypercall_buffer_free(xch, p);
#   83|   }
#   84|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1038]
xen-4.20.2/tools/misc/xencov.c:83:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
xen-4.20.2/tools/misc/xencov.c:44:13: enter_function: entry to ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: call_function: calling ‘cov_sysctl’ from ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: return_function: returning to ‘cov_read’ from ‘cov_sysctl’
xen-4.20.2/tools/misc/xencov.c:51:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:53:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:56:8: branch_false: following ‘false’ branch (when ‘total_len <= 8388608’)...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:60:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:63:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:68:10: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:68:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/misc/xencov.c:71:13: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:71:13: acquire_resource: opened here
xen-4.20.2/tools/misc/xencov.c:73:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/misc/xencov.c:76:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:76:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:79:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:79:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:82:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:83:1: danger: ‘f’ leaks here; was opened at [(19)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/18)
#   81|   
#   82|       xc_hypercall_buffer_free(xch, p);
#   83|-> }
#   84|   
#   85|   static void cov_reset(void)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1039]
xen-4.20.2/tools/misc/xencov.c:83:1: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xen-4.20.2/tools/misc/xencov.c:44:13: enter_function: entry to ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: call_function: calling ‘cov_sysctl’ from ‘cov_read’
xen-4.20.2/tools/misc/xencov.c:51:9: return_function: returning to ‘cov_read’ from ‘cov_sysctl’
xen-4.20.2/tools/misc/xencov.c:51:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:53:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:56:8: branch_false: following ‘false’ branch (when ‘total_len <= 8388608’)...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:59:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:60:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:63:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:68:10: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:68:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/misc/xencov.c:71:13: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:71:13: acquire_memory: allocated here
xen-4.20.2/tools/misc/xencov.c:73:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xen-4.20.2/tools/misc/xencov.c:76:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:76:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:79:9: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:79:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xencov.c:82:5: branch_false: ...to here
xen-4.20.2/tools/misc/xencov.c:83:1: danger: ‘f’ leaks here; was allocated at [(19)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/18)
#   81|   
#   82|       xc_hypercall_buffer_free(xch, p);
#   83|-> }
#   84|   
#   85|   static void cov_reset(void)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1040]
xen-4.20.2/tools/misc/xenpm.c:150:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cxstatinfo.triggers’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: return_function: returning to ‘show_cxstat_by_cpuid’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:247:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:255:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:255:5: call_function: calling ‘print_cxstat’ from ‘show_cxstat_by_cpuid’
#  148|       for ( i = 0; i < cxstat->nr; i++ )
#  149|       {
#  150|->         printf("C%-20d: transition [%20"PRIu64"]\n",
#  151|                  i, cxstat->triggers[i]);
#  152|           printf("                       residency  [%20"PRIu64" ms]\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1041]
xen-4.20.2/tools/misc/xenpm.c:156:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cxstatinfo.triggers’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: return_function: returning to ‘show_cxstat_by_cpuid’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:247:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:255:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:255:5: call_function: calling ‘print_cxstat’ from ‘show_cxstat_by_cpuid’
#  154|       }
#  155|       for ( i = 0; i < MAX_PKG_RESIDENCIES && i < cxstat->nr_pc; ++i )
#  156|->         if ( cxstat->pc[i] )
#  157|              printf("pc%d                  : [%20"PRIu64" ms]\n", i + 1,
#  158|                     cxstat->pc[i] / 1000000UL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1042]
xen-4.20.2/tools/misc/xenpm.c:160:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cxstatinfo.triggers’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: return_function: returning to ‘show_cxstat_by_cpuid’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:247:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:255:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:255:5: call_function: calling ‘print_cxstat’ from ‘show_cxstat_by_cpuid’
#  158|                     cxstat->pc[i] / 1000000UL);
#  159|       for ( i = 0; i < MAX_CORE_RESIDENCIES && i < cxstat->nr_cc; ++i )
#  160|->         if ( cxstat->cc[i] )
#  161|              printf("cc%d                  : [%20"PRIu64" ms]\n", i + 1,
#  162|                     cxstat->cc[i] / 1000000UL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1043]
xen-4.20.2/tools/misc/xenpm.c:172:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:474:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  170|       int max_cx_num = 0;
#  171|   
#  172|->     ret = xc_pm_get_max_cx(xc_handle, cpuid, &max_cx_num);
#  173|       if ( ret )
#  174|           return -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1044]
xen-4.20.2/tools/misc/xenpm.c:186:10: warning[-Wanalyzer-malloc-leak]: leak of ‘*cxstat.cc’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:492:19: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:492:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:491:38: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  184|       cxstat->pc = calloc(MAX_PKG_RESIDENCIES, sizeof(*cxstat->pc));
#  185|       cxstat->cc = calloc(MAX_CORE_RESIDENCIES, sizeof(*cxstat->cc));
#  186|->     if ( !cxstat->triggers || !cxstat->residencies ||
#  187|            !cxstat->pc || !cxstat->cc )
#  188|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1045]
xen-4.20.2/tools/misc/xenpm.c:186:10: warning[-Wanalyzer-malloc-leak]: leak of ‘*cxstat.pc’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:492:19: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:492:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:491:38: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  184|       cxstat->pc = calloc(MAX_PKG_RESIDENCIES, sizeof(*cxstat->pc));
#  185|       cxstat->cc = calloc(MAX_CORE_RESIDENCIES, sizeof(*cxstat->cc));
#  186|->     if ( !cxstat->triggers || !cxstat->residencies ||
#  187|            !cxstat->pc || !cxstat->cc )
#  188|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1046]
xen-4.20.2/tools/misc/xenpm.c:186:10: warning[-Wanalyzer-malloc-leak]: leak of ‘*cxstat.residencies’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:492:19: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:492:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:491:38: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  184|       cxstat->pc = calloc(MAX_PKG_RESIDENCIES, sizeof(*cxstat->pc));
#  185|       cxstat->cc = calloc(MAX_CORE_RESIDENCIES, sizeof(*cxstat->cc));
#  186|->     if ( !cxstat->triggers || !cxstat->residencies ||
#  187|            !cxstat->pc || !cxstat->cc )
#  188|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1047]
xen-4.20.2/tools/misc/xenpm.c:186:10: warning[-Wanalyzer-malloc-leak]: leak of ‘*cxstat.triggers’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:492:19: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:492:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:491:38: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  184|       cxstat->pc = calloc(MAX_PKG_RESIDENCIES, sizeof(*cxstat->pc));
#  185|       cxstat->cc = calloc(MAX_CORE_RESIDENCIES, sizeof(*cxstat->cc));
#  186|->     if ( !cxstat->triggers || !cxstat->residencies ||
#  187|            !cxstat->pc || !cxstat->cc )
#  188|       {

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1048]
xen-4.20.2/tools/misc/xenpm.c:189:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  187|            !cxstat->pc || !cxstat->cc )
#  188|       {
#  189|->         free(cxstat->cc);
#  190|           free(cxstat->pc);
#  191|           free(cxstat->residencies);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1049]
xen-4.20.2/tools/misc/xenpm.c:190:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  188|       {
#  189|           free(cxstat->cc);
#  190|->         free(cxstat->pc);
#  191|           free(cxstat->residencies);
#  192|           free(cxstat->triggers);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1050]
xen-4.20.2/tools/misc/xenpm.c:191:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  189|           free(cxstat->cc);
#  190|           free(cxstat->pc);
#  191|->         free(cxstat->residencies);
#  192|           free(cxstat->triggers);
#  193|           return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1051]
xen-4.20.2/tools/misc/xenpm.c:192:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  190|           free(cxstat->pc);
#  191|           free(cxstat->residencies);
#  192|->         free(cxstat->triggers);
#  193|           return -ENOMEM;
#  194|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1052]
xen-4.20.2/tools/misc/xenpm.c:200:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:474:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  198|       cxstat->nr_cc = MAX_CORE_RESIDENCIES;
#  199|   
#  200|->     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
#  201|       if( ret )
#  202|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1053]
xen-4.20.2/tools/misc/xenpm.c:200:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cxstatinfo.cc’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
#  198|       cxstat->nr_cc = MAX_CORE_RESIDENCIES;
#  199|   
#  200|->     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
#  201|       if( ret )
#  202|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1054]
xen-4.20.2/tools/misc/xenpm.c:200:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cxstatinfo.pc’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
#  198|       cxstat->nr_cc = MAX_CORE_RESIDENCIES;
#  199|   
#  200|->     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
#  201|       if( ret )
#  202|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1055]
xen-4.20.2/tools/misc/xenpm.c:200:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cxstatinfo.residencies’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
#  198|       cxstat->nr_cc = MAX_CORE_RESIDENCIES;
#  199|   
#  200|->     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
#  201|       if( ret )
#  202|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1056]
xen-4.20.2/tools/misc/xenpm.c:200:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cxstatinfo.triggers’
xen-4.20.2/tools/misc/xenpm.c:241:12: enter_function: entry to ‘show_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:246:11: call_function: calling ‘get_cxstat_by_cpuid’ from ‘show_cxstat_by_cpuid’
#  198|       cxstat->nr_cc = MAX_CORE_RESIDENCIES;
#  199|   
#  200|->     ret = xc_pm_get_cxstat(xc_handle, cpuid, cxstat);
#  201|       if( ret )
#  202|       {

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1057]
xen-4.20.2/tools/misc/xenpm.c:204:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  202|       {
#  203|           ret = -errno;
#  204|->         free(cxstat->triggers);
#  205|           free(cxstat->residencies);
#  206|           free(cxstat->pc);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1058]
xen-4.20.2/tools/misc/xenpm.c:205:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  203|           ret = -errno;
#  204|           free(cxstat->triggers);
#  205|->         free(cxstat->residencies);
#  206|           free(cxstat->pc);
#  207|           free(cxstat->cc);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1059]
xen-4.20.2/tools/misc/xenpm.c:206:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  204|           free(cxstat->triggers);
#  205|           free(cxstat->residencies);
#  206|->         free(cxstat->pc);
#  207|           free(cxstat->cc);
#  208|           cxstat->triggers = NULL;

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1060]
xen-4.20.2/tools/misc/xenpm.c:207:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
#  205|           free(cxstat->residencies);
#  206|           free(cxstat->pc);
#  207|->         free(cxstat->cc);
#  208|           cxstat->triggers = NULL;
#  209|           cxstat->residencies = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1061]
xen-4.20.2/tools/misc/xenpm.c:320:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:474:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:507:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:507:19: call_function: calling ‘get_pxstat_by_cpuid’ from ‘signal_int_handler’
#  318|       for ( ; ; )
#  319|       {
#  320|->         ret = xc_pm_get_max_px(xc_handle, cpuid, &max_px_num);
#  321|           if ( ret )
#  322|               return -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1062]
xen-4.20.2/tools/misc/xenpm.c:336:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:474:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:507:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:507:19: call_function: calling ‘get_pxstat_by_cpuid’ from ‘signal_int_handler’
#  334|           }
#  335|   
#  336|->         ret = xc_pm_get_pxstat(xc_handle, cpuid, pxstat);
#  337|           if ( ret )
#  338|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1063]
xen-4.20.2/tools/misc/xenpm.c:336:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pxstatinfo.pt’
xen-4.20.2/tools/misc/xenpm.c:372:12: enter_function: entry to ‘show_pxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:377:11: call_function: calling ‘get_pxstat_by_cpuid’ from ‘show_pxstat_by_cpuid’
#  334|           }
#  335|   
#  336|->         ret = xc_pm_get_pxstat(xc_handle, cpuid, pxstat);
#  337|           if ( ret )
#  338|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1064]
xen-4.20.2/tools/misc/xenpm.c:336:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pxstatinfo.trans_pt’
xen-4.20.2/tools/misc/xenpm.c:372:12: enter_function: entry to ‘show_pxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:377:11: call_function: calling ‘get_pxstat_by_cpuid’ from ‘show_pxstat_by_cpuid’
#  334|           }
#  335|   
#  336|->         ret = xc_pm_get_pxstat(xc_handle, cpuid, pxstat);
#  337|           if ( ret )
#  338|           {

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1065]
xen-4.20.2/tools/misc/xenpm.c:469:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘fprintf’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:470:26: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:469:9: danger: call to ‘fprintf’ from within signal handler
#  467|       if ( xc_cputopoinfo(xc_handle, &max_cpus, NULL) != 0 )
#  468|       {
#  469|->         fprintf(stderr, "failed to discover number of CPUs: %s\n",
#  470|                   strerror(errno));
#  471|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1066]
xen-4.20.2/tools/misc/xenpm.c:495:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:488:8: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:491:22: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:19: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:492:19: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:492:19: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:492:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:492:16: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:493:30: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:495:45: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:495:45: danger: dereference of NULL ‘*<unknown>.residencies + (long unsigned int)j * 8’
#  493|                   for ( j = 0; j < cxstat_end[i].nr; j++ )
#  494|                   {
#  495|->                     int64_t diff = (int64_t)cxstat_end[i].residencies[j] -
#  496|                           (int64_t)cxstat_start[i].residencies[j];
#  497|                       if ( diff >=0 )

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1067]
xen-4.20.2/tools/misc/xenpm.c:516:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:516:5: danger: call to ‘printf’ from within signal handler
#  514|           get_avgfreq_by_cpuid(xc_handle, i, &avgfreq[i]);
#  515|   
#  516|->     printf("Elapsed time (ms): %"PRIu64"\n", (usec_end - usec_start) / 1000UL);
#  517|       for ( i = 0; i < max_cpu_nr; i++ )
#  518|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1068]
xen-4.20.2/tools/misc/xenpm.c:560:21: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/misc/xenpm.c:459:13: enter_function: entry to ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:474:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:488:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘signal_int_handler’
xen-4.20.2/tools/misc/xenpm.c:488:10: return_function: returning to ‘signal_int_handler’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_true: following ‘true’ branch (when ‘cx_cap != 0’)...
xen-4.20.2/tools/misc/xenpm.c:560:21: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:21: throw: if ‘xc_cputopoinfo’ throws an exception...
xen-4.20.2/tools/misc/xenpm.c:560:21: danger: ‘cputopo’ leaks here; was allocated at [(4)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/3)
#  558|       }
#  559|   
#  560|->     if ( cx_cap && !xc_cputopoinfo(xc_handle, &max_cpus, cputopo) )
#  561|       {
#  562|           uint32_t socket_ids[MAX_NR_CPU];

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1069]
xen-4.20.2/tools/misc/xenpm.c:651:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:651:20: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:651:9: danger: call to ‘free’ from within signal handler
#  649|       for ( i = 0; i < 2 * max_cpu_nr; i++ )
#  650|       {
#  651|->         free(cxstat[i].triggers);
#  652|           free(cxstat[i].residencies);
#  653|           free(cxstat[i].pc);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1070]
xen-4.20.2/tools/misc/xenpm.c:652:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:651:20: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:652:9: danger: call to ‘free’ from within signal handler
#  650|       {
#  651|           free(cxstat[i].triggers);
#  652|->         free(cxstat[i].residencies);
#  653|           free(cxstat[i].pc);
#  654|           free(cxstat[i].cc);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1071]
xen-4.20.2/tools/misc/xenpm.c:653:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:651:20: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:653:9: danger: call to ‘free’ from within signal handler
#  651|           free(cxstat[i].triggers);
#  652|           free(cxstat[i].residencies);
#  653|->         free(cxstat[i].pc);
#  654|           free(cxstat[i].cc);
#  655|           free(pxstat[i].trans_pt);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1072]
xen-4.20.2/tools/misc/xenpm.c:654:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:651:20: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:654:9: danger: call to ‘free’ from within signal handler
#  652|           free(cxstat[i].residencies);
#  653|           free(cxstat[i].pc);
#  654|->         free(cxstat[i].cc);
#  655|           free(pxstat[i].trans_pt);
#  656|           free(pxstat[i].pt);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1073]
xen-4.20.2/tools/misc/xenpm.c:655:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:651:20: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:655:9: danger: call to ‘free’ from within signal handler
#  653|           free(cxstat[i].pc);
#  654|           free(cxstat[i].cc);
#  655|->         free(pxstat[i].trans_pt);
#  656|           free(pxstat[i].pt);
#  657|       }

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1074]
xen-4.20.2/tools/misc/xenpm.c:656:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:651:20: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:656:9: danger: call to ‘free’ from within signal handler
#  654|           free(cxstat[i].cc);
#  655|           free(pxstat[i].trans_pt);
#  656|->         free(pxstat[i].pt);
#  657|       }
#  658|       free(cxstat);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1075]
xen-4.20.2/tools/misc/xenpm.c:658:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:658:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:658:5: danger: call to ‘free’ from within signal handler
#  656|           free(pxstat[i].pt);
#  657|       }
#  658|->     free(cxstat);
#  659|       free(pxstat);
#  660|       free(sum);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1076]
xen-4.20.2/tools/misc/xenpm.c:659:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:658:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:659:5: danger: call to ‘free’ from within signal handler
#  657|       }
#  658|       free(cxstat);
#  659|->     free(pxstat);
#  660|       free(sum);
#  661|       free(avgfreq);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1077]
xen-4.20.2/tools/misc/xenpm.c:660:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:658:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:660:5: danger: call to ‘free’ from within signal handler
#  658|       free(cxstat);
#  659|       free(pxstat);
#  660|->     free(sum);
#  661|       free(avgfreq);
#  662|   out:

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1078]
xen-4.20.2/tools/misc/xenpm.c:661:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:467:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:474:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:475:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:481:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:481:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:486:16: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:506:22: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:513:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:516:46: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:517:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:560:8: branch_false: following ‘false’ branch (when ‘cx_cap == 0’)...
xen-4.20.2/tools/misc/xenpm.c:649:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:649:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:658:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:661:5: danger: call to ‘free’ from within signal handler
#  659|       free(pxstat);
#  660|       free(sum);
#  661|->     free(avgfreq);
#  662|   out:
#  663|       free(cputopo);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1079]
xen-4.20.2/tools/misc/xenpm.c:663:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘free’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:663:5: danger: call to ‘free’ from within signal handler
#  661|       free(avgfreq);
#  662|   out:
#  663|->     free(cputopo);
#  664|       xc_interface_close(xc_handle);
#  665|       exit(0);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1080]
xen-4.20.2/tools/misc/xenpm.c:665:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
xen-4.20.2/tools/misc/xenpm.c:668:6: enter_function: entry to ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:683:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:688:18: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:691:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:693:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:694:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:699:14: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:706:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:707:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:714:5: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:721:10: call_function: calling ‘get_cxstat_by_cpuid’ from ‘start_gather_func’
xen-4.20.2/tools/misc/xenpm.c:721:10: return_function: returning to ‘start_gather_func’ from ‘get_cxstat_by_cpuid’
xen-4.20.2/tools/misc/xenpm.c:728:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:735:9: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:665:5: danger: call to ‘exit’ from within signal handler
#  663|       free(cputopo);
#  664|       xc_interface_close(xc_handle);
#  665|->     exit(0);
#  666|   }
#  667|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1081]
xen-4.20.2/tools/misc/xenpm.c:956:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cpufreq_para.affected_cpus’
xen-4.20.2/tools/misc/xenpm.c:925:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:956:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:957:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:925:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:927:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:927:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:925:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:937:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:947:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:956:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:956:15: throw: if ‘xc_get_cpufreq_para’ throws an exception...
xen-4.20.2/tools/misc/xenpm.c:956:15: danger: ‘cpufreq_para.affected_cpus’ leaks here; was allocated at [(11)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/10)
#  954|           }
#  955|   
#  956|->         ret = xc_get_cpufreq_para(xc_handle, cpuid, p_cpufreq);
#  957|       } while ( ret && errno == EAGAIN );
#  958|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1082]
xen-4.20.2/tools/misc/xenpm.c:956:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cpufreq_para.scaling_available_frequencies’
xen-4.20.2/tools/misc/xenpm.c:925:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:956:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:957:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:925:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:927:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:925:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:937:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:937:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:947:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:956:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:956:15: throw: if ‘xc_get_cpufreq_para’ throws an exception...
xen-4.20.2/tools/misc/xenpm.c:956:15: danger: ‘cpufreq_para.scaling_available_frequencies’ leaks here; was allocated at [(15)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/14)
#  954|           }
#  955|   
#  956|->         ret = xc_get_cpufreq_para(xc_handle, cpuid, p_cpufreq);
#  957|       } while ( ret && errno == EAGAIN );
#  958|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1083]
xen-4.20.2/tools/misc/xenpm.c:956:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cpufreq_para.scaling_available_governors’
xen-4.20.2/tools/misc/xenpm.c:925:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:956:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:957:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:925:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:927:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:925:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:937:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:935:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:945:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/misc/xenpm.c:947:22: branch_true: ...to here
xen-4.20.2/tools/misc/xenpm.c:947:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:945:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:956:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:956:15: throw: if ‘xc_get_cpufreq_para’ throws an exception...
xen-4.20.2/tools/misc/xenpm.c:956:15: danger: ‘cpufreq_para.scaling_available_governors’ leaks here; was allocated at [(19)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/18)
#  954|           }
#  955|   
#  956|->         ret = xc_get_cpufreq_para(xc_handle, cpuid, p_cpufreq);
#  957|       } while ( ret && errno == EAGAIN );
#  958|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1084]
xen-4.20.2/tools/misc/xenpm.c:1169:10: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/misc/xenpm.c:1153:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/misc/xenpm.c:1161:15: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:1161:15: acquire_memory: allocated here
xen-4.20.2/tools/misc/xenpm.c:1162:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/misc/xenpm.c:1169:10: branch_false: ...to here
xen-4.20.2/tools/misc/xenpm.c:1169:10: throw: if ‘xc_cputopoinfo’ throws an exception...
xen-4.20.2/tools/misc/xenpm.c:1169:10: danger: ‘cputopo’ leaks here; was allocated at [(3)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/2)
# 1167|       }
# 1168|   
# 1169|->     if ( xc_cputopoinfo(xc_handle, &max_cpus, cputopo) )
# 1170|       {
# 1171|           rc = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1085]
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:759:15: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:760:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: throw: if ‘caml_enter_blocking_section’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: danger: ‘str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  762|   
#  763|   	/* Hopefully our conring_size guess is sufficient */
#  764|-> 	caml_enter_blocking_section();
#  765|   	ret = xc_readconsolering(xch, str, &count, 0, 0, &index);
#  766|   	caml_leave_blocking_section();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1086]
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:765:15: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:759:15: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:760:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:765:15: throw: if ‘xc_readconsolering’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:765:15: danger: ‘str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  763|   	/* Hopefully our conring_size guess is sufficient */
#  764|   	caml_enter_blocking_section();
#  765|-> 	ret = xc_readconsolering(xch, str, &count, 0, 0, &index);
#  766|   	caml_leave_blocking_section();
#  767|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1087]
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:785:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:760:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:768:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:768:12: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:773:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:775:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:778:23: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:779:20: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:782:23: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:785:17: throw: if ‘caml_enter_blocking_section’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:785:17: danger: ‘ptr’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  783|   		count = size - count;
#  784|   
#  785|-> 		caml_enter_blocking_section();
#  786|   		ret = xc_readconsolering(xch, str, &count, 0, 1, &index);
#  787|   		caml_leave_blocking_section();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1088]
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:786:23: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:755:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:760:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:764:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:768:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:768:12: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:773:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:775:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:778:23: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:779:20: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:782:23: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:786:23: throw: if ‘xc_readconsolering’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:786:23: danger: ‘ptr’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  784|   
#  785|   		caml_enter_blocking_section();
#  786|-> 		ret = xc_readconsolering(xch, str, &count, 0, 1, &index);
#  787|   		caml_leave_blocking_section();
#  788|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1089]
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:907:9: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:894:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:894:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:900:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:903:23: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:903:16: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:904:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:907:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:907:9: throw: if ‘caml_enter_blocking_section’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:907:9: danger: ‘info’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  905|   		caml_raise_out_of_memory();
#  906|   
#  907|-> 	caml_enter_blocking_section();
#  908|   	r = xc_getcpuinfo(xch, Int_val(nr_cpus), info, &size);
#  909|   	caml_leave_blocking_section();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1090]
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:908:13: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:894:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:894:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:900:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:903:23: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:903:16: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:904:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:907:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:908:13: throw: if ‘xc_getcpuinfo’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xc/xenctrl_stubs.c:908:13: danger: ‘info’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  906|   
#  907|   	caml_enter_blocking_section();
#  908|-> 	r = xc_getcpuinfo(xch, Int_val(nr_cpus), info, &size);
#  909|   	caml_leave_blocking_section();
#  910|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1091]
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:145:9: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:134:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:134:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:141:16: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:142:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:145:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:145:9: throw: if ‘caml_enter_blocking_section’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:145:9: danger: ‘info’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  143|   		caml_raise_out_of_memory();
#  144|   
#  145|-> 	caml_enter_blocking_section();
#  146|   	retval = xc_domain_getinfolist(xch, 0, DOMID_FIRST_RESERVED, info);
#  147|   	caml_leave_blocking_section();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1092]
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:146:18: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:134:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:134:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:141:16: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:142:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:145:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:146:18: throw: if ‘xc_domain_getinfolist’ throws an exception...
xen-4.20.2/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c:146:18: danger: ‘info’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  144|   
#  145|   	caml_enter_blocking_section();
#  146|-> 	retval = xc_domain_getinfolist(xch, 0, DOMID_FIRST_RESERVED, info);
#  147|   	caml_leave_blocking_section();
#  148|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1093]
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:31:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 524290, 0)’
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:35:19: enter_function: entry to ‘xen_sd_notify’
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:48:6: branch_false: following ‘false’ branch (when ‘message’ is non-NULL)...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:51:20: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:52:6: branch_false: following ‘false’ branch (when ‘message_length != 0’)...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:56:17: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:57:6: branch_false: following ‘false’ branch (when ‘socket_path’ is non-NULL)...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:61:7: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:61:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:64:17: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:66:6: branch_false: following ‘false’ branch (when ‘path_length <= 107’)...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:69:3: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:72:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:75:8: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:75:8: acquire_resource: socket created here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:76:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:79:7: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:79:6: branch_true: following ‘true’ branch...
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:80:13: branch_true: ...to here
xen-4.20.2/tools/ocaml/xenstored/../../../tools/include/xen-sd-notify.h:45:47: call_function: inlined call to ‘xen_sd_closep’ from ‘xen_sd_notify’
#   29|       return;
#   30|   
#   31|->   close(*fd);
#   32|     *fd = -1;
#   33|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1094]
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:62:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:38:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:38:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:39:23: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:44:12: branch_false: following ‘false’ branch (when ‘c_msg’ is non-NULL)...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:44:12: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:57:20: branch_true: following ‘true’ branch (when ‘ss’ is non-NULL)...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:58:25: branch_true: ...to here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:62:17: throw: if ‘caml_enter_blocking_section’ throws an exception...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:62:17: danger: ‘s’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   60|   			break;
#   61|   
#   62|-> 		caml_enter_blocking_section();
#   63|   		syslog(c_facility, "%s", s);
#   64|   		caml_leave_blocking_section();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1095]
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:63:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:38:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:38:9: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:39:23: acquire_memory: allocated here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:44:12: branch_false: following ‘false’ branch (when ‘c_msg’ is non-NULL)...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:44:12: branch_false: ...to here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:57:20: branch_true: following ‘true’ branch (when ‘ss’ is non-NULL)...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:58:25: branch_true: ...to here
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:63:17: throw: if ‘syslog’ throws an exception...
xen-4.20.2/tools/ocaml/xenstored/syslog_stubs.c:63:17: danger: ‘s’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   61|   
#   62|   		caml_enter_blocking_section();
#   63|-> 		syslog(c_facility, "%s", s);
#   64|   		caml_leave_blocking_section();
#   65|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1096]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:360:15: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:352:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:356:12: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:356:12: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:357:8: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:360:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:360:15: throw: if ‘xc_domain_getinfolist’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:360:15: danger: ‘info’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  358|           return PyErr_NoMemory();
#  359|   
#  360|->     nr_doms = xc_domain_getinfolist(self->xc_handle, first_dom, max_doms, info);
#  361|   
#  362|       if (nr_doms < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1097]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:664:10: warning[-Wanalyzer-malloc-leak]: leak of ‘sdev_array’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:655:18: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:655:18: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:656:8: branch_false: following ‘false’ branch (when ‘sdev_array’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:659:12: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:664:10: throw: if ‘xc_get_device_group’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:664:10: danger: ‘sdev_array’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  662|       sbdf |= (func & 0x7);
#  663|   
#  664|->     rc = xc_get_device_group(self->xc_handle,
#  665|           domid, sbdf, max_sdevs, &num_sdevs, sdev_array);
#  666|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1098]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:695:13: warning[-Wanalyzer-malloc-leak]: leak of ‘group_str’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:649:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:655:18: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:656:8: branch_false: following ‘false’ branch (when ‘sdev_array’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:659:12: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:667:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:673:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:673:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:679:17: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:679:17: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:680:8: branch_false: following ‘false’ branch (when ‘group_str’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:680:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:686:18: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:695:13: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:695:13: throw: if ‘Py_BuildValue’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:695:13: danger: ‘group_str’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  693|       }
#  694|   
#  695|->     Pystr = Py_BuildValue("s", group_str);
#  696|   
#  697|       free(sdev_array);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1099]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:822:11: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:817:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:819:18: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:819:18: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:817:10: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:822:11: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:822:11: throw: if ‘xc_readconsolering’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:822:11: danger: ‘str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  820|           return NULL;
#  821|   
#  822|->     ret = xc_readconsolering(self->xc_handle, str, &count, clear,
#  823|                                incremental, &index);
#  824|       if ( ret < 0 ) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1100]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:841:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:817:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:819:18: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:817:10: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:822:11: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:824:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:824:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:829:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:832:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:835:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:836:12: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:839:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:841:15: throw: if ‘xc_readconsolering’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:841:15: danger: ‘ptr’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
#  839|           str = ptr + count;
#  840|           count = size - count;
#  841|->         ret = xc_readconsolering(self->xc_handle, str, &count, clear,
#  842|                                    1, &index);
#  843|           count += str - ptr;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1101]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:955:11: warning[-Wanalyzer-malloc-leak]: leak of ‘cpuinfo’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:948:7: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:951:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:951:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:952:8: branch_false: following ‘false’ branch (when ‘cpuinfo’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:955:11: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:955:11: throw: if ‘xc_getcpuinfo’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:955:11: danger: ‘cpuinfo’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  953|           return NULL;
#  954|   
#  955|->     ret = xc_getcpuinfo(self->xc_handle, max_cpus, cpuinfo, &nr_cpus);
#  956|       if (ret != 0) {
#  957|           free(cpuinfo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1102]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:989:10: warning[-Wanalyzer-malloc-leak]: leak of ‘cputopo’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:982:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:985:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:985:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:986:8: branch_false: following ‘false’ branch (when ‘cputopo’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:989:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:989:10: throw: if ‘xc_cputopoinfo’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:989:10: danger: ‘cputopo’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  987|       	goto out;
#  988|   
#  989|->     if ( xc_cputopoinfo(self->xc_handle, &num_cpus, cputopo) != 0 )
#  990|           goto out;
#  991|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1103]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: warning[-Wanalyzer-malloc-leak]: leak of ‘distance’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1058:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1061:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1062:16: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1063:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: throw: if ‘xc_numainfo’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: danger: ‘distance’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 1064|           goto out;
# 1065|   
# 1066|->     if ( xc_numainfo(self->xc_handle, &num_nodes, meminfo, distance) != 0 )
# 1067|           goto out;
# 1068|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1104]
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: warning[-Wanalyzer-malloc-leak]: leak of ‘meminfo’
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1058:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1061:15: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1061:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1063:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: throw: if ‘xc_numainfo’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xc/xc.c:1066:10: danger: ‘meminfo’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1064|           goto out;
# 1065|   
# 1066|->     if ( xc_numainfo(self->xc_handle, &num_nodes, meminfo, distance) != 0 )
# 1067|           goto out;
# 1068|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1105]
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: warning[-Wanalyzer-malloc-leak]: leak of ‘xsperms’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:326:18: enter_function: entry to ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:333:28: call_function: inlined call to ‘xshandle’ from ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:348:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:350:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:355:17: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:357:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:358:8: branch_false: following ‘false’ branch (when ‘xsperms’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: throw: if ‘PyTuple_New’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: danger: ‘xsperms’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  361|       }
#  362|   
#  363|->     tuple0 = PyTuple_New(0);
#  364|       if (!tuple0)
#  365|           goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1106]
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:370:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xsperms’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:326:18: enter_function: entry to ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:333:28: call_function: inlined call to ‘xshandle’ from ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:348:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:350:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:355:17: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:357:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:358:8: branch_false: following ‘false’ branch (when ‘xsperms’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:367:17: branch_true: following ‘true’ branch (when ‘i < xsperms_n’)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:369:13: branch_true: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:370:23: throw: if ‘PyList_GetItem’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:370:23: danger: ‘xsperms’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  368|           /* Read/write perms. Set these. */
#  369|           int p_read = 0, p_write = 0;
#  370|->         PyObject *p = PyList_GetItem(perms, i);
#  371|           if (!PyArg_ParseTupleAndKeywords(tuple0, p, perm_spec, perm_names,
#  372|                                            &xsperms[i].id, &p_read, &p_write))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1107]
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:371:14: warning[-Wanalyzer-malloc-leak]: leak of ‘xsperms’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:326:18: enter_function: entry to ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:333:28: call_function: inlined call to ‘xshandle’ from ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:348:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:350:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:355:17: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:357:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:358:8: branch_false: following ‘false’ branch (when ‘xsperms’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:367:17: branch_true: following ‘true’ branch (when ‘i < xsperms_n’)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:369:13: branch_true: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:371:14: throw: if ‘PyArg_ParseTupleAndKeywords’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:371:14: danger: ‘xsperms’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  369|           int p_read = 0, p_write = 0;
#  370|           PyObject *p = PyList_GetItem(perms, i);
#  371|->         if (!PyArg_ParseTupleAndKeywords(tuple0, p, perm_spec, perm_names,
#  372|                                            &xsperms[i].id, &p_read, &p_write))
#  373|               goto exit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1108]
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:390:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xsperms’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:326:18: enter_function: entry to ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:333:28: call_function: inlined call to ‘xshandle’ from ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:348:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:350:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:355:17: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:357:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:358:8: branch_false: following ‘false’ branch (when ‘xsperms’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:367:17: branch_false: following ‘false’ branch (when ‘i >= xsperms_n’)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:384:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:384:8: branch_false: following ‘false’ branch (when ‘xsperms_n == 0’)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:390:5: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:390:5: throw: if ‘PyEval_SaveThread’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:390:5: danger: ‘xsperms’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  388|       }
#  389|   
#  390|->     Py_BEGIN_ALLOW_THREADS
#  391|       result = xs_set_permissions(xh, th, path, xsperms, xsperms_n);
#  392|       Py_END_ALLOW_THREADS

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1109]
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:391:14: warning[-Wanalyzer-malloc-leak]: leak of ‘xsperms’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:326:18: enter_function: entry to ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:333:28: call_function: inlined call to ‘xshandle’ from ‘xspy_set_permissions’
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:345:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:348:10: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:350:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:355:17: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:357:15: acquire_memory: allocated here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:358:8: branch_false: following ‘false’ branch (when ‘xsperms’ is non-NULL)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:363:14: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:364:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:367:17: branch_false: following ‘false’ branch (when ‘i >= xsperms_n’)...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:384:8: branch_false: ...to here
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:391:14: throw: if ‘xs_set_permissions’ throws an exception...
xen-4.20.2/tools/python/xen/lowlevel/xs/xs.c:391:14: danger: ‘xsperms’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  389|   
#  390|       Py_BEGIN_ALLOW_THREADS
#  391|->     result = xs_set_permissions(xh, th, path, xsperms, xsperms_n);
#  392|       Py_END_ALLOW_THREADS
#  393|       if (!result) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1110]
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:214:14: warning[-Wanalyzer-malloc-leak]: leak of ‘leaves’
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:204:25: branch_true: following ‘true’ branch (when ‘i != 9’)...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:207:27: branch_true: ...to here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:208:36: acquire_memory: allocated here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:211:12: branch_false: following ‘false’ branch (when ‘leaves’ is non-NULL)...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:214:14: branch_false: ...to here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:214:14: throw: if ‘x86_cpuid_copy_to_buffer’ throws an exception...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:214:14: danger: ‘leaves’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  212|               err(1, "%s() malloc failure", __func__);
#  213|   
#  214|->         rc = x86_cpuid_copy_to_buffer(&t->p, leaves, &nr);
#  215|   
#  216|           if ( rc != 0 )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1111]
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:267:14: warning[-Wanalyzer-malloc-leak]: leak of ‘msrs’
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:257:25: branch_true: following ‘true’ branch (when ‘i == 0’)...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:260:22: branch_true: ...to here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:261:33: acquire_memory: allocated here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:264:12: branch_false: following ‘false’ branch (when ‘msrs’ is non-NULL)...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:267:14: branch_false: ...to here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:267:14: throw: if ‘x86_msr_copy_to_buffer’ throws an exception...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:267:14: danger: ‘msrs’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  265|               err(1, "%s() malloc failure", __func__);
#  266|   
#  267|->         rc = x86_msr_copy_to_buffer(&t->p, msrs, &nr);
#  268|   
#  269|           if ( rc != 0 )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1112]
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:552:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n_’
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:545:25: branch_true: following ‘true’ branch (when ‘i != 8’)...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:548:32: branch_true: ...to here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:548:32: acquire_memory: allocated here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:548:32: branch_false: following ‘false’ branch (when ‘n_’ is non-NULL)...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:548:32: branch_false: ...to here
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:552:9: throw: if ‘x86_cpu_policy_clear_out_of_range_leaves’ throws an exception...
xen-4.20.2/tools/tests/cpu-policy/test-cpu-policy.c:552:9: danger: ‘n_’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  550|           unsigned int nr_markers;
#  551|   
#  552|->         x86_cpu_policy_clear_out_of_range_leaves(p);
#  553|   
#  554|           /* Count the number of 0xc2's still remaining. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1113]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:131:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_true: following ‘true’ branch (when ‘is_server != 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:437:22: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: following ‘false’ branch (when ‘state_path’ is NULL)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_true: following ‘true’ branch (when ‘is_server != 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:478:16: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:482:52: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:482:52: call_function: calling ‘connect_socket’ from ‘main’
#  129|   
#  130|   static int set_nonblocking(int fd, int nonblocking) {
#  131|->     int flags = fcntl(fd, F_GETFL);
#  132|       if (flags == -1)
#  133|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1114]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:172:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_true: following ‘true’ branch (when ‘is_server != 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:437:22: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: following ‘false’ branch (when ‘state_path’ is NULL)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_true: following ‘true’ branch (when ‘is_server != 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:478:16: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:482:52: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:482:52: call_function: calling ‘connect_socket’ from ‘main’
#  170|       strcpy(addr.sun_path, path_or_fd);
#  171|       if (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == -1) {
#  172|->         perror("connect");
#  173|           close(fd);
#  174|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1115]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:173:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_true: following ‘true’ branch (when ‘is_server != 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:437:22: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:438:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: following ‘false’ branch (when ‘state_path’ is NULL)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_true: following ‘true’ branch (when ‘is_server != 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:478:16: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:482:52: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:482:52: call_function: calling ‘connect_socket’ from ‘main’
#  171|       if (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == -1) {
#  172|           perror("connect");
#  173|->         close(fd);
#  174|           return -1;
#  175|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1116]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:208:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:13: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: call_function: calling ‘listen_socket’ from ‘main’
#  206|       strcpy(addr.sun_path, path_or_fd);
#  207|       if (bind(fd, (const struct sockaddr *)&addr, sizeof(addr)) == -1) {
#  208|->         perror("bind");
#  209|           close(fd);
#  210|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1117]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:209:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:13: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: call_function: calling ‘listen_socket’ from ‘main’
#  207|       if (bind(fd, (const struct sockaddr *)&addr, sizeof(addr)) == -1) {
#  208|           perror("bind");
#  209|->         close(fd);
#  210|           return -1;
#  211|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1118]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:213:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:13: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: call_function: calling ‘listen_socket’ from ‘main’
#  211|       }
#  212|       if (listen(fd, 5) != 0) {
#  213|->         perror("listen");
#  214|           close(fd);
#  215|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1119]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:214:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:391:5: enter_function: entry to ‘main’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:13: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:447:25: call_function: calling ‘listen_socket’ from ‘main’
#  212|       if (listen(fd, 5) != 0) {
#  213|           perror("listen");
#  214|->         close(fd);
#  215|           return -1;
#  216|       }

Error: GCC_ANALYZER_WARNING: [#def1120]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:497:52: warning[-Wanalyzer-fd-type-mismatch]: ‘accept’ on non-stream-socket file descriptor ‘socket_fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:13: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:12: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:444:13: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: following ‘false’ branch (when ‘state_path’ is NULL)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:496:17: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:496:16: branch_true: following ‘true’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:497:52: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:497:52: danger: ‘accept’ expects a socket file descriptor but ‘socket_fd’ is not a socket
#  495|               /* wait for local socket connection */
#  496|               if (strcmp(socket_path, "-") != 0)
#  497|->                 state.input_fd = state.output_fd = accept(socket_fd,
#  498|                                                             NULL, NULL);
#  499|               if (state.input_fd == -1) {

Error: GCC_ANALYZER_WARNING: [#def1121]
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:497:52: warning[-Wanalyzer-fd-use-without-check]: ‘accept’ on possibly invalid file descriptor ‘socket_fd’
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:429:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:432:22: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:436:8: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:13: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:443:12: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:444:13: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: following ‘false’ branch (when ‘state_path’ is NULL)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:455:8: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:473:12: branch_false: following ‘false’ branch (when ‘is_server == 0’)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:496:17: branch_false: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:496:16: branch_true: following ‘true’ branch (when the strings are non-equal)...
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:497:52: branch_true: ...to here
xen-4.20.2/tools/vchan/vchan-socket-proxy.c:497:52: danger: ‘socket_fd’ could be invalid
#  495|               /* wait for local socket connection */
#  496|               if (strcmp(socket_path, "-") != 0)
#  497|->                 state.input_fd = state.output_fd = accept(socket_fd,
#  498|                                                             NULL, NULL);
#  499|               if (state.input_fd == -1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1122]
xen-4.20.2/tools/xcutils/readnotes.c:255:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xen-4.20.2/tools/xcutils/readnotes.c:189:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
xen-4.20.2/tools/xcutils/readnotes.c:194:9: branch_false: ...to here
xen-4.20.2/tools/xcutils/readnotes.c:199:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xcutils/readnotes.c:204:13: branch_false: ...to here
xen-4.20.2/tools/xcutils/readnotes.c:204:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xcutils/readnotes.c:211:25: branch_false: ...to here
xen-4.20.2/tools/xcutils/readnotes.c:212:12: branch_false: following ‘false’ branch (when ‘image != 18446744073709551615’)...
xen-4.20.2/tools/xcutils/readnotes.c:220:21: branch_false: ...to here
xen-4.20.2/tools/xcutils/readnotes.c:252:12: branch_true: following ‘true’ branch (when ‘usize != 0’)...
xen-4.20.2/tools/xcutils/readnotes.c:254:23: branch_true: ...to here
xen-4.20.2/tools/xcutils/readnotes.c:254:23: acquire_memory: allocated here
xen-4.20.2/tools/xcutils/readnotes.c:255:17: throw: if ‘xc_dom_do_gunzip’ throws an exception...
xen-4.20.2/tools/xcutils/readnotes.c:255:17: danger: ‘tmp’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  253|   	{
#  254|   		tmp = malloc(usize);
#  255|-> 		xc_dom_do_gunzip(xch, image, size, tmp, usize);
#  256|   		image = tmp;
#  257|   		size = usize;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1123]
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: throw: if ‘xtl_createlogger_stdiostream’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  291|           goto err;
#  292|   
#  293|->     paging->logger = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr,
#  294|                            paging->debug ? XTL_DEBUG : XTL_PROGRESS, 0);
#  295|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1124]
xen-4.20.2/tools/xenpaging/xenpaging.c:297:31: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:297:31: throw: if ‘xc_interface_open’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:297:31: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  295|   
#  296|       /* Open connection to xen */
#  297|->     paging->xc_handle = xch = xc_interface_open(paging->logger, NULL, 0);
#  298|       if ( !xch )
#  299|           goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1125]
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
#  299|           goto err;
#  300|   
#  301|->     DPRINTF("xenpaging init\n");
#  302|   
#  303|       /* Open connection to xenstore */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1126]
xen-4.20.2/tools/xenpaging/xenpaging.c:304:25: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:304:25: throw: if ‘xs_open’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:304:25: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
#  302|   
#  303|       /* Open connection to xenstore */
#  304|->     paging->xs_handle = xs_open(0);
#  305|       if ( paging->xs_handle == NULL )
#  306|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1127]
xen-4.20.2/tools/xenpaging/xenpaging.c:307:9: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:307:9: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:307:9: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:307:9: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/1)
#  305|       if ( paging->xs_handle == NULL )
#  306|       {
#  307|->         PERROR("Error initialising xenstore connection");
#  308|           goto err;
#  309|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1128]
xen-4.20.2/tools/xenpaging/xenpaging.c:313:10: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:10: throw: if ‘xs_watch’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:313:10: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/1)
#  311|       /* write domain ID to watch so we can ignore other domain shutdowns */
#  312|       snprintf(watch_token, sizeof(watch_token), "%u", paging->vm_event.domain_id);
#  313|->     if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
#  314|       {
#  315|           PERROR("Could not bind to shutdown watch\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1129]
xen-4.20.2/tools/xenpaging/xenpaging.c:315:9: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:315:9: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:315:9: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:315:9: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
#  313|       if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
#  314|       {
#  315|->         PERROR("Could not bind to shutdown watch\n");
#  316|           goto err;
#  317|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1130]
xen-4.20.2/tools/xenpaging/xenpaging.c:320:16: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:320:16: throw: if ‘xs_get_domain_path’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:16: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/1)
#  318|   
#  319|       /* Watch xenpagings working target */
#  320|->     dom_path = xs_get_domain_path(paging->xs_handle, paging->vm_event.domain_id);
#  321|       if ( !dom_path )
#  322|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1131]
xen-4.20.2/tools/xenpaging/xenpaging.c:323:9: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:323:9: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:323:9: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:323:9: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
#  321|       if ( !dom_path )
#  322|       {
#  323|->         PERROR("Could not find domain path\n");
#  324|           goto err;
#  325|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1132]
xen-4.20.2/tools/xenpaging/xenpaging.c:328:9: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:328:9: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:328:9: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:328:9: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/1)
#  326|       if ( asprintf(&watch_target_tot_pages, "%s/%s", dom_path, WATCH_TARGETPAGES) < 0 )
#  327|       {
#  328|->         PERROR("Could not alloc watch path\n");
#  329|           goto err;
#  330|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1133]
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/1)
#  329|           goto err;
#  330|       }
#  331|->     DPRINTF("watching '%s'\n", watch_target_tot_pages);
#  332|       if ( xs_watch(paging->xs_handle, watch_target_tot_pages, "") == false )
#  333|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1134]
xen-4.20.2/tools/xenpaging/xenpaging.c:332:10: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:10: throw: if ‘xs_watch’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:332:10: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/1)
#  330|       }
#  331|       DPRINTF("watching '%s'\n", watch_target_tot_pages);
#  332|->     if ( xs_watch(paging->xs_handle, watch_target_tot_pages, "") == false )
#  333|       {
#  334|           PERROR("Could not bind to xenpaging watch\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1135]
xen-4.20.2/tools/xenpaging/xenpaging.c:334:9: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:334:9: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:334:9: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:334:9: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/1)
#  332|       if ( xs_watch(paging->xs_handle, watch_target_tot_pages, "") == false )
#  333|       {
#  334|->         PERROR("Could not bind to xenpaging watch\n");
#  335|           goto err;
#  336|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1136]
xen-4.20.2/tools/xenpaging/xenpaging.c:339:5: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:339:5: throw: if ‘xc_get_hvm_param’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:5: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/1)
#  337|   
#  338|       /* Map the ring page */
#  339|->     xc_get_hvm_param(xch, paging->vm_event.domain_id, 
#  340|                           HVM_PARAM_PAGING_RING_PFN, &ring_pfn);
#  341|       mmap_pfn = ring_pfn;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1137]
xen-4.20.2/tools/xenpaging/xenpaging.c:343:9: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:343:9: throw: if ‘xc_map_foreign_pages’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:343:9: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/1)
#  341|       mmap_pfn = ring_pfn;
#  342|       paging->vm_event.ring_page = 
#  343|->         xc_map_foreign_pages(xch, paging->vm_event.domain_id,
#  344|                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
#  345|       if ( !paging->vm_event.ring_page )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1138]
xen-4.20.2/tools/xenpaging/xenpaging.c:348:14: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:345:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:349:47: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:348:14: throw: if ‘xc_domain_populate_physmap_exact’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:348:14: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/1)
#  346|       {
#  347|           /* Map failed, populate ring page */
#  348|->         rc = xc_domain_populate_physmap_exact(paging->xc_handle, 
#  349|                                                 paging->vm_event.domain_id,
#  350|                                                 1, 0, 0, &ring_pfn);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1139]
xen-4.20.2/tools/xenpaging/xenpaging.c:353:13: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:345:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:349:47: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:351:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:353:13: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:353:13: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:353:13: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/1)
#  351|           if ( rc != 0 )
#  352|           {
#  353|->             PERROR("Failed to populate ring gfn\n");
#  354|               goto err;
#  355|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1140]
xen-4.20.2/tools/xenpaging/xenpaging.c:358:13: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:345:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:349:47: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:358:39: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:358:13: throw: if ‘xc_map_foreign_pages’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:358:13: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/1)
#  356|   
#  357|           paging->vm_event.ring_page = 
#  358|->             xc_map_foreign_pages(xch, paging->vm_event.domain_id,
#  359|                                    PROT_READ | PROT_WRITE,
#  360|                                    &mmap_pfn, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1141]
xen-4.20.2/tools/xenpaging/xenpaging.c:363:13: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:345:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:349:47: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:351:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:358:39: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:361:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:363:13: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:363:13: throw: if ‘xtl_log’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:363:13: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/1)
#  361|           if ( !paging->vm_event.ring_page )
#  362|           {
#  363|->             PERROR("Could not map the ring page\n");
#  364|               goto err;
#  365|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1142]
xen-4.20.2/tools/xenpaging/xenpaging.c:369:10: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:305:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:312:54: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:313:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:320:54: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:321:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:326:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:326:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:331:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:339:27: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:369:10: throw: if ‘xc_mem_paging_enable’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:369:10: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/1)
#  367|       
#  368|       /* Initialise Xen */
#  369|->     rc = xc_mem_paging_enable(xch, paging->vm_event.domain_id,
#  370|                                &paging->vm_event.evtchn_port);
#  371|       if ( rc != 0 )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1143]
xen-4.20.2/tools/xenpaging/xenpaging.c:488:13: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:487:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:488:13: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:488:13: throw: if ‘xs_close’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:488:13: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/1)
#  486|       {
#  487|           if ( paging->xs_handle )
#  488|->             xs_close(paging->xs_handle);
#  489|           if ( xch )
#  490|               xc_interface_close(xch);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1144]
xen-4.20.2/tools/xenpaging/xenpaging.c:490:13: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:301:5: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:489:12: branch_true: following ‘true’ branch (when ‘xch’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:490:13: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:490:13: throw: if ‘xc_interface_close’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:490:13: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/1)
#  488|               xs_close(paging->xs_handle);
#  489|           if ( xch )
#  490|->             xc_interface_close(xch);
#  491|           if ( paging->logger )
#  492|               xtl_logger_destroy(paging->logger);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1145]
xen-4.20.2/tools/xenpaging/xenpaging.c:492:13: warning[-Wanalyzer-malloc-leak]: leak of ‘paging’
xen-4.20.2/tools/xenpaging/xenpaging.c:275:26: enter_function: entry to ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:285:14: acquire_memory: allocated here
xen-4.20.2/tools/xenpaging/xenpaging.c:286:8: branch_false: following ‘false’ branch (when ‘paging’ is non-NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: call_function: calling ‘xenpaging_getopts’ from ‘xenpaging_init’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:10: return_function: returning to ‘xenpaging_init’ from ‘xenpaging_getopts’
xen-4.20.2/tools/xenpaging/xenpaging.c:290:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:294:26: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:293:43: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:298:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:299:9: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:487:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:489:12: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:489:12: branch_false: following ‘false’ branch (when ‘xch’ is NULL)...
xen-4.20.2/tools/xenpaging/xenpaging.c:491:14: branch_false: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:491:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenpaging/xenpaging.c:492:13: branch_true: ...to here
xen-4.20.2/tools/xenpaging/xenpaging.c:492:13: throw: if ‘xtl_logger_destroy’ throws an exception...
xen-4.20.2/tools/xenpaging/xenpaging.c:492:13: danger: ‘paging’ leaks here; was allocated at [(2)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/1)
#  490|               xc_interface_close(xch);
#  491|           if ( paging->logger )
#  492|->             xtl_logger_destroy(paging->logger);
#  493|           if ( paging->paging_buffer )
#  494|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1146]
xen-4.20.2/tools/xenpmd/xenpmd.c:110:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/tmp/battery")’
xen-4.20.2/tools/xenpmd/xenpmd.c:441:5: enter_function: entry to ‘wait_for_and_update_battery_status_request’
xen-4.20.2/tools/xenpmd/xenpmd.c:453:15: acquire_memory: allocated here
xen-4.20.2/tools/xenpmd/xenpmd.c:454:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenpmd/xenpmd.c:454:12: branch_false: ...to here
xen-4.20.2/tools/xenpmd/xenpmd.c:457:17: call_function: calling ‘get_next_battery_info_or_status’ from ‘wait_for_and_update_battery_status_request’
#  108|       do 
#  109|       {
#  110|->         dir_entries = readdir(battery_dir);
#  111|           if ( !dir_entries ) 
#  112|               return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1147]
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:31:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 524290, 0)’
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:35:19: enter_function: entry to ‘xen_sd_notify’
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:48:6: branch_false: following ‘false’ branch (when ‘message’ is non-NULL)...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:51:20: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:52:6: branch_false: following ‘false’ branch (when ‘message_length != 0’)...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:56:17: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:57:6: branch_false: following ‘false’ branch (when ‘socket_path’ is non-NULL)...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:61:7: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:61:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:64:17: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:66:6: branch_false: following ‘false’ branch (when ‘path_length <= 107’)...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:69:3: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:72:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:75:8: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:75:8: acquire_resource: socket created here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:76:6: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:79:7: branch_false: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:79:6: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:80:13: branch_true: ...to here
xen-4.20.2/tools/xenstored/../../tools/include/xen-sd-notify.h:45:47: call_function: inlined call to ‘xen_sd_closep’ from ‘xen_sd_notify’
#   29|       return;
#   30|   
#   31|->   close(*fd);
#   32|     *fd = -1;
#   33|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1148]
xen-4.20.2/tools/xenstored/control.c:256:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
xen-4.20.2/tools/xenstored/control.c:226:12: branch_false: following ‘false’ branch (when ‘num <= 1’)...
xen-4.20.2/tools/xenstored/control.c:229:12: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:229:12: branch_false: following ‘false’ branch (when ‘num != 0’)...
xen-4.20.2/tools/xenstored/control.c:247:28: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:248:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/control.c:250:22: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:250:22: acquire_resource: opened here
xen-4.20.2/tools/xenstored/control.c:253:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
xen-4.20.2/tools/xenstored/control.c:256:9: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:256:9: throw: if ‘talloc_report_full’ throws an exception...
xen-4.20.2/tools/xenstored/control.c:256:9: danger: ‘fp’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  254|   		return EBADF;
#  255|   
#  256|-> 	talloc_report_full(NULL, fp);
#  257|   	fclose(fp);
#  258|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1149]
xen-4.20.2/tools/xenstored/control.c:256:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
xen-4.20.2/tools/xenstored/control.c:226:12: branch_false: following ‘false’ branch (when ‘num <= 1’)...
xen-4.20.2/tools/xenstored/control.c:229:12: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:229:12: branch_true: following ‘true’ branch (when ‘num == 0’)...
xen-4.20.2/tools/xenstored/control.c:230:21: branch_true: ...to here
xen-4.20.2/tools/xenstored/control.c:230:20: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/control.c:239:30: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:240:28: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
xen-4.20.2/tools/xenstored/control.c:242:30: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:242:30: acquire_memory: allocated here
xen-4.20.2/tools/xenstored/control.c:243:28: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
xen-4.20.2/tools/xenstored/control.c:256:9: branch_false: ...to here
xen-4.20.2/tools/xenstored/control.c:256:9: throw: if ‘talloc_report_full’ throws an exception...
xen-4.20.2/tools/xenstored/control.c:256:9: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  254|   		return EBADF;
#  255|   
#  256|-> 	talloc_report_full(NULL, fp);
#  257|   	fclose(fp);
#  258|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1150]
xen-4.20.2/tools/xenstored/core.c:96:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/xenstored/core.c:134:6: enter_function: entry to ‘trace_destroy’
xen-4.20.2/tools/xenstored/core.c:137:17: call_function: calling ‘trace’ from ‘trace_destroy’
#   94|   	/* fail back to dynamic allocation */
#   95|   	va_start(arglist, fmt);
#   96|-> 	str = talloc_vasprintf(NULL, fmt, arglist);
#   97|   	va_end(arglist);
#   98|   	if (str) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1151]
xen-4.20.2/tools/xenstored/core.c:2480:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/xenstored/core.c:2479:9: acquire_resource: ‘va_start’ called here
xen-4.20.2/tools/xenstored/core.c:2480:15: throw: if ‘talloc_vasprintf’ throws an exception...
xen-4.20.2/tools/xenstored/core.c:2480:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 2478|   
# 2479|   	va_start(arglist, fmt);
# 2480|-> 	str = talloc_vasprintf(NULL, fmt, arglist);
# 2481|   	va_end(arglist);
# 2482|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1152]
xen-4.20.2/tools/xenstored/lu.c:292:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lu_dump_open(ctx)’
xen-4.20.2/tools/xenstored/lu.c:273:20: enter_function: entry to ‘lu_dump_state’
xen-4.20.2/tools/xenstored/lu.c:280:14: call_function: calling ‘lu_dump_open’ from ‘lu_dump_state’
xen-4.20.2/tools/xenstored/lu.c:280:14: return_function: returning to ‘lu_dump_state’ from ‘lu_dump_open’
xen-4.20.2/tools/xenstored/lu.c:281:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/lu.c:284:9: branch_false: ...to here
xen-4.20.2/tools/xenstored/lu.c:287:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/lu.c:292:15: branch_false: ...to here
xen-4.20.2/tools/xenstored/lu.c:292:15: throw: if ‘dump_state_global’ throws an exception...
xen-4.20.2/tools/xenstored/lu.c:292:15: danger: ‘lu_dump_open(ctx)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  290|   	}
#  291|   
#  292|-> 	ret = dump_state_global(fp);
#  293|   	if (ret)
#  294|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1153]
xen-4.20.2/tools/xenstored/posix.c:115:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
xen-4.20.2/tools/xenstored/posix.c:109:23: acquire_resource: opened here
xen-4.20.2/tools/xenstored/posix.c:110:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/posix.c:112:9: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:115:9: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  113|   	dup2(devnull, STDOUT_FILENO);
#  114|   	dup2(devnull, STDERR_FILENO);
#  115|-> 	close(devnull);
#  116|   }
#  117|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1154]
xen-4.20.2/tools/xenstored/posix.c:157:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/xen/xsd_port", 0)’
xen-4.20.2/tools/xenstored/posix.c:149:14: acquire_resource: opened here
xen-4.20.2/tools/xenstored/posix.c:150:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/posix.c:153:14: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:154:12: branch_true: following ‘true’ branch (when ‘rc == -1’)...
xen-4.20.2/tools/xenstored/posix.c:156:27: branch_true: ...to here
xen-4.20.2/tools/xenstored/posix.c:157:17: danger: ‘open("/proc/xen/xsd_port", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  155|   	{
#  156|   		int err = errno;
#  157|-> 		close(fd);
#  158|   		errno = err;
#  159|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1155]
xen-4.20.2/tools/xenstored/posix.c:165:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/xen/xsd_port", 0)’
xen-4.20.2/tools/xenstored/posix.c:149:14: acquire_resource: opened here
xen-4.20.2/tools/xenstored/posix.c:150:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/posix.c:153:14: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:154:12: branch_false: following ‘false’ branch (when ‘rc != -1’)...
xen-4.20.2/tools/xenstored/posix.c:162:9: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:165:9: danger: ‘open("/proc/xen/xsd_port", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  163|   	port = strtoul(str, NULL, 0);
#  164|   
#  165|-> 	close(fd);
#  166|   	return port;
#  167|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1156]
xen-4.20.2/tools/xenstored/posix.c:266:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘accept(sock, 0, 0)’
xen-4.20.2/tools/xenstored/posix.c:263:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/posix.c:266:16: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:266:16: throw: if ‘new_connection’ throws an exception...
xen-4.20.2/tools/xenstored/posix.c:266:16: danger: ‘accept(sock, 0, 0)’ leaks here
#  264|   		return;
#  265|   
#  266|-> 	conn = new_connection(&socket_funcs);
#  267|   	if (conn) {
#  268|   		conn->fd = fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1157]
xen-4.20.2/tools/xenstored/posix.c:271:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘accept(sock, 0, 0)’
xen-4.20.2/tools/xenstored/posix.c:263:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/posix.c:266:16: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:267:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xenstored/posix.c:271:17: branch_false: ...to here
xen-4.20.2/tools/xenstored/posix.c:271:17: danger: ‘accept(sock, 0, 0)’ leaks here
#  269|   		conn->id = dom0_domid;
#  270|   	} else
#  271|-> 		close(fd);
#  272|   }
#  273|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1158]
xen-4.20.2/tools/xentop/xentop.c:306:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/tools/xentop/xentop.c:588:13: enter_function: entry to ‘print_max_pct’
xen-4.20.2/tools/xentop/xentop.c:591:17: call_function: calling ‘print’ from ‘print_max_pct’
#  304|   		if((current_row() < lines()-1)) {
#  305|   			va_start(args, fmt);
#  306|-> 			vw_printw(stdscr, (curses_str_t)fmt, args);
#  307|   			va_end(args);
#  308|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1159]
xen-4.20.2/tools/xentop/xentop.c:1203:30: warning[-Wanalyzer-malloc-leak]: leak of ‘domains’
xen-4.20.2/tools/xentop/xentop.c:1261:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentop/xentop.c:1282:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1282:12: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1330:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1333:13: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1333:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1360:34: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1370:25: call_function: calling ‘top’ from ‘main’
# 1201|   
# 1202|   	for (i=0; i < num_domains; i++) {
# 1203|-> 		domains[i] = xenstat_node_domain_by_index(cur_node, i);
# 1204|   		if ( strcmp(xenstat_domain_name(domains[i]), "Domain-0") == 0 )
# 1205|   			dom0_index = i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1160]
xen-4.20.2/tools/xentop/xentop.c:1204:29: warning[-Wanalyzer-malloc-leak]: leak of ‘domains’
xen-4.20.2/tools/xentop/xentop.c:1261:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentop/xentop.c:1282:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1282:12: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1330:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1333:13: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1333:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1360:34: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1370:25: call_function: calling ‘top’ from ‘main’
# 1202|   	for (i=0; i < num_domains; i++) {
# 1203|   		domains[i] = xenstat_node_domain_by_index(cur_node, i);
# 1204|-> 		if ( strcmp(xenstat_domain_name(domains[i]), "Domain-0") == 0 )
# 1205|   			dom0_index = i;
# 1206|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1161]
xen-4.20.2/tools/xentop/xentop.c:1222:9: warning[-Wanalyzer-malloc-leak]: leak of ‘domains’
xen-4.20.2/tools/xentop/xentop.c:1261:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentop/xentop.c:1282:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1282:12: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1330:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1333:13: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1333:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentop/xentop.c:1360:34: branch_false: ...to here
xen-4.20.2/tools/xentop/xentop.c:1370:25: call_function: calling ‘top’ from ‘main’
# 1220|   
# 1221|   	/* Sort */
# 1222|-> 	qsort((domains+sort_start), (num_domains-sort_count), sizeof(xenstat_domain *),
# 1223|   	      (int(*)(const void *, const void *))compare_domains);
# 1224|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1162]
xen-4.20.2/tools/xentrace/xenalyze.c:312:12: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen(fn, "rb")’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:10923:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10929:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10932:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10934:9: call_function: inlined call to ‘error’ from ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10941:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10944:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: call_function: calling ‘parse_symbol_file’ from ‘main’
#  310|           error(ERR_SYSTEM, NULL);
#  311|       }
#  312|->     while(!feof(symbol_file)) {
#  313|           /* Allocate a new struct if we need it */
#  314|           if(!*p) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1163]
xen-4.20.2/tools/xentrace/xenalyze.c:314:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "rb")’
xen-4.20.2/tools/xentrace/xenalyze.c:10923:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10929:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10932:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10934:9: call_function: inlined call to ‘error’ from ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10941:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10941:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10944:9: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10944:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: call_function: calling ‘parse_symbol_file’ from ‘main’
#  312|       while(!feof(symbol_file)) {
#  313|           /* Allocate a new struct if we need it */
#  314|->         if(!*p) {
#  315|               *p = malloc(sizeof(**p));
#  316|               if(!*p) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1164]
xen-4.20.2/tools/xentrace/xenalyze.c:314:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "rb")’
xen-4.20.2/tools/xentrace/xenalyze.c:10923:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10929:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10932:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10934:9: call_function: inlined call to ‘error’ from ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10941:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10941:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10944:9: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10944:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: call_function: calling ‘parse_symbol_file’ from ‘main’
#  312|       while(!feof(symbol_file)) {
#  313|           /* Allocate a new struct if we need it */
#  314|->         if(!*p) {
#  315|               *p = malloc(sizeof(**p));
#  316|               if(!*p) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1165]
xen-4.20.2/tools/xentrace/xenalyze.c:320:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘G.symbols’
xen-4.20.2/tools/xentrace/xenalyze.c:10923:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10929:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10932:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10934:9: call_function: inlined call to ‘error’ from ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10941:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10941:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10944:9: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10944:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: call_function: calling ‘parse_symbol_file’ from ‘main’
#  318|                   error(ERR_SYSTEM, NULL);
#  319|               }
#  320|->             (*p)->count=0;
#  321|               (*p)->next=NULL;
#  322|           }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1166]
xen-4.20.2/tools/xentrace/xenalyze.c:326:14: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen(fn, "rb")’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:10923:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10929:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10932:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10934:9: call_function: inlined call to ‘error’ from ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10941:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10944:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10945:9: call_function: calling ‘parse_symbol_file’ from ‘main’
#  324|           /* FIXME -- use regexp.  This won't work for symbols with spaces (yes they exist) */
#  325|           (*p)->symbols[(*p)->count].addr = 0xDEADBEEF;
#  326|->         if ( fscanf(symbol_file, "%llx %" STR(SYMBOL_NAME_SIZE) "s",
#  327|                       &(*p)->symbols[(*p)->count].addr,
#  328|                       (*p)->symbols[(*p)->count].name) == 0 )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1167]
xen-4.20.2/tools/xentrace/xenalyze.c:2473:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
xen-4.20.2/tools/xentrace/xenalyze.c:10923:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10929:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10932:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10934:9: call_function: inlined call to ‘error’ from ‘main’
xen-4.20.2/tools/xentrace/xenalyze.c:10941:18: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10941:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:10944:9: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:10950:5: call_function: calling ‘init_pcpus’ from ‘main’
# 2471|       bzero(p, sizeof(*p));
# 2472|   
# 2473|->     p->elem = e;
# 2474|       strncpy(p->desc, desc, INTERVAL_DESC_MAX);
# 2475|   

Error: CPPCHECK_WARNING (CWE-476): [#def1168]
xen-4.20.2/tools/xentrace/xenalyze.c:2560: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 2558|   
# 2559|       for(i=0, p=P.cr3.head; p; p=p->gnext, i++)
# 2560|->         qsort_array[i]=p;
# 2561|   
# 2562|       qsort(qsort_array, N, sizeof(struct eip_list_struct *),

Error: CPPCHECK_WARNING (CWE-476): [#def1169]
xen-4.20.2/tools/xentrace/xenalyze.c:2562: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 2560|           qsort_array[i]=p;
# 2561|   
# 2562|->     qsort(qsort_array, N, sizeof(struct eip_list_struct *),
# 2563|             cr3_time_compare);
# 2564|   

Error: CPPCHECK_WARNING (CWE-476): [#def1170]
xen-4.20.2/tools/xentrace/xenalyze.c:2568: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 2566|   
# 2567|       for(i=0; i<N; i++) {
# 2568|->         p = qsort_array[i];
# 2569|           /* Rounding down means this will get ..1]% */
# 2570|           if(p->total_time.interval.cycles > 0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1171]
xen-4.20.2/tools/xentrace/xenalyze.c:2827:9: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:3289:6: enter_function: entry to ‘hvm_pf_xen_postprocess’
xen-4.20.2/tools/xentrace/xenalyze.c:3301:13: call_function: calling ‘update_eip’ from ‘hvm_pf_xen_postprocess’
#argument 1 of ‘__builtin_memset’ must be non-null
# 2825|           }
# 2826|   
# 2827|->         bzero(p, sizeof(*p));
# 2828|   
# 2829|           p->eip=eip;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1172]
xen-4.20.2/tools/xentrace/xenalyze.c:2833:13: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
xen-4.20.2/tools/xentrace/xenalyze.c:3289:6: enter_function: entry to ‘hvm_pf_xen_postprocess’
xen-4.20.2/tools/xentrace/xenalyze.c:3301:13: call_function: calling ‘update_eip’ from ‘hvm_pf_xen_postprocess’
# 2831|   
# 2832|           if(eip_list_type[type].new) {
# 2833|->             eip_list_type[type].new(p, extra);
# 2834|           }
# 2835|           p->next = *last;

Error: CPPCHECK_WARNING (CWE-476): [#def1173]
xen-4.20.2/tools/xentrace/xenalyze.c:2883: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 2881|   
# 2882|       for(i=0, p=head; p; p=p->next, i++)
# 2883|->         qsort_array[i]=p;
# 2884|   
# 2885|       qsort(qsort_array, N, sizeof(struct eip_list_struct *),

Error: CPPCHECK_WARNING (CWE-476): [#def1174]
xen-4.20.2/tools/xentrace/xenalyze.c:2885: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 2883|           qsort_array[i]=p;
# 2884|   
# 2885|->     qsort(qsort_array, N, sizeof(struct eip_list_struct *),
# 2886|             eip_compare);
# 2887|   

Error: CPPCHECK_WARNING (CWE-476): [#def1175]
xen-4.20.2/tools/xentrace/xenalyze.c:2897: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 2895|   
# 2896|       for(i=0; i<N; i++) {
# 2897|->         p = qsort_array[i];
# 2898|           if ( p->summary.cycles )
# 2899|               PRINT_SUMMARY(p->summary, "   %12llx%-45s: ",

Error: CPPCHECK_WARNING (CWE-476): [#def1176]
xen-4.20.2/tools/xentrace/xenalyze.c:3003: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
# 3001|               error(ERR_SYSTEM, NULL);
# 3002|           }
# 3003|->         p->handler=s;
# 3004|           p->data = d;
# 3005|           p->next=*q;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1177]
xen-4.20.2/tools/xentrace/xenalyze.c:3003:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
xen-4.20.2/tools/xentrace/xenalyze.c:4320:6: enter_function: entry to ‘hvm_vmcall_postprocess’
xen-4.20.2/tools/xentrace/xenalyze.c:4332:9: call_function: calling ‘__hvm_set_summary_handler’ from ‘hvm_vmcall_postprocess’
# 3001|               error(ERR_SYSTEM, NULL);
# 3002|           }
# 3003|->         p->handler=s;
# 3004|           p->data = d;
# 3005|           p->next=*q;

Error: CPPCHECK_WARNING (CWE-476): [#def1178]
xen-4.20.2/tools/xentrace/xenalyze.c:3004: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
# 3002|           }
# 3003|           p->handler=s;
# 3004|->         p->data = d;
# 3005|           p->next=*q;
# 3006|           *q=p;

Error: CPPCHECK_WARNING (CWE-476): [#def1179]
xen-4.20.2/tools/xentrace/xenalyze.c:3005: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p
# 3003|           p->handler=s;
# 3004|           p->data = d;
# 3005|->         p->next=*q;
# 3006|           *q=p;
# 3007|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1180]
xen-4.20.2/tools/xentrace/xenalyze.c:3792:9: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:3830:6: enter_function: entry to ‘hvm_io_write_postprocess’
xen-4.20.2/tools/xentrace/xenalyze.c:3833:9: call_function: calling ‘update_io_address’ from ‘hvm_io_write_postprocess’
#argument 1 of ‘__builtin_memset’ must be non-null
# 3790|           }
# 3791|   
# 3792|->         bzero(p, sizeof(*p));
# 3793|   
# 3794|           p->pa=pa;

Error: CPPCHECK_WARNING (CWE-476): [#def1181]
xen-4.20.2/tools/xentrace/xenalyze.c:4033: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 4031|       /* Point the array into it */
# 4032|       for(i=0, p=head; p; p=p->next, i++)
# 4033|->         qsort_array[i]=p;
# 4034|   
# 4035|       /* Sort the array by time */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1182]
xen-4.20.2/tools/xentrace/xenalyze.c:4033:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘qsort_array’
xen-4.20.2/tools/xentrace/xenalyze.c:4029:19: acquire_memory: this call could return NULL
xen-4.20.2/tools/xentrace/xenalyze.c:4032:22: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xentrace/xenalyze.c:4033:20: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:4033:9: danger: ‘qsort_array + (long unsigned int)i * 8’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 4031|       /* Point the array into it */
# 4032|       for(i=0, p=head; p; p=p->next, i++)
# 4033|->         qsort_array[i]=p;
# 4034|   
# 4035|       /* Sort the array by time */

Error: CPPCHECK_WARNING (CWE-476): [#def1183]
xen-4.20.2/tools/xentrace/xenalyze.c:4036: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 4034|   
# 4035|       /* Sort the array by time */
# 4036|->     qsort(qsort_array, N, sizeof(struct eip_list_struct *),
# 4037|             cr3_compare_start);
# 4038|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1184]
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: warning[-Wanalyzer-malloc-leak]: leak of ‘qsort_array’
xen-4.20.2/tools/xentrace/xenalyze.c:4029:19: acquire_memory: allocated here
xen-4.20.2/tools/xentrace/xenalyze.c:4032:22: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: throw: if ‘qsort’ throws an exception...
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: danger: ‘qsort_array’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 4034|   
# 4035|       /* Sort the array by time */
# 4036|->     qsort(qsort_array, N, sizeof(struct eip_list_struct *),
# 4037|             cr3_compare_start);
# 4038|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1185]
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘qsort_array’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:4029:19: acquire_memory: this call could return NULL
xen-4.20.2/tools/xentrace/xenalyze.c:4032:22: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:4036:5: danger: argument 1 (‘qsort_array’) from [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
# 4034|   
# 4035|       /* Sort the array by time */
# 4036|->     qsort(qsort_array, N, sizeof(struct eip_list_struct *),
# 4037|             cr3_compare_start);
# 4038|   

Error: CPPCHECK_WARNING (CWE-476): [#def1186]
xen-4.20.2/tools/xentrace/xenalyze.c:4051: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: qsort_array
# 4049|           struct time_struct first, last;
# 4050|   
# 4051|->         p = qsort_array[i];
# 4052|   
# 4053|           abs_cycles_to_time(p->first_time, &first);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1187]
xen-4.20.2/tools/xentrace/xenalyze.c:6704:5: warning[-Wanalyzer-null-argument]: use of NULL ‘v’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:8971:6: enter_function: entry to ‘process_lost_records_end’
xen-4.20.2/tools/xentrace/xenalyze.c:8991:9: call_function: calling ‘update_cycles’ from ‘process_lost_records_end’
xen-4.20.2/tools/xentrace/xenalyze.c:8991:9: return_function: returning to ‘process_lost_records_end’ from ‘update_cycles’
xen-4.20.2/tools/xentrace/xenalyze.c:8993:11: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:8994:23: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:8997:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:9001:16: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:9001:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:9010:16: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:9010:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:9013:13: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:9013:13: call_function: calling ‘vcpu_find’ from ‘process_lost_records_end’
#argument 1 of ‘__builtin_memset’ must be non-null
# 6702|       }
# 6703|   
# 6704|->     bzero(v, sizeof(*v));
# 6705|   
# 6706|       v->vid = vid;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1188]
xen-4.20.2/tools/xentrace/xenalyze.c:6725:5: warning[-Wanalyzer-null-argument]: use of NULL ‘d’ where non-null expected
xen-4.20.2/tools/xentrace/xenalyze.c:8971:6: enter_function: entry to ‘process_lost_records_end’
xen-4.20.2/tools/xentrace/xenalyze.c:8991:9: call_function: calling ‘update_cycles’ from ‘process_lost_records_end’
xen-4.20.2/tools/xentrace/xenalyze.c:8991:9: return_function: returning to ‘process_lost_records_end’ from ‘update_cycles’
xen-4.20.2/tools/xentrace/xenalyze.c:8993:11: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:8994:23: branch_true: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:8997:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:9001:16: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:9001:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:9010:16: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:9010:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xentrace/xenalyze.c:9013:13: branch_false: ...to here
xen-4.20.2/tools/xentrace/xenalyze.c:9013:13: call_function: calling ‘vcpu_find’ from ‘process_lost_records_end’
#argument 1 of ‘__builtin_memset’ must be non-null
# 6723|   void domain_init(struct domain_data *d, int did)
# 6724|   {
# 6725|->     bzero(d, sizeof(*d));
# 6726|   
# 6727|       d->did = did;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1189]
xen-4.20.2/tools/xl/xl_cpupool.c:130:10: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
xen-4.20.2/tools/xl/xl_cpupool.c:80:8: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
xen-4.20.2/tools/xl/xl_cpupool.c:93:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:93:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:110:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:111:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:116:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:117:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:122:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:122:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: branch_true: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_cpupool.c:130:10: throw: if ‘libxl_name_to_cpupoolid’ throws an exception...
xen-4.20.2/tools/xl/xl_cpupool.c:130:10: danger: ‘name’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  128|           goto out_cfg;
#  129|       }
#  130|->     if (!libxl_name_to_cpupoolid(ctx, name, &poolid)) {
#  131|           fprintf(stderr, "Pool name \"%s\" already exists\n", name);
#  132|           goto out_cfg;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1190]
xen-4.20.2/tools/xl/xl_cpupool.c:135:10: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
xen-4.20.2/tools/xl/xl_cpupool.c:80:8: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
xen-4.20.2/tools/xl/xl_cpupool.c:93:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:93:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:110:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:111:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:116:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:117:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:122:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:122:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: branch_true: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_cpupool.c:130:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:135:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:135:10: throw: if ‘xlu_cfg_get_string’ throws an exception...
xen-4.20.2/tools/xl/xl_cpupool.c:135:10: danger: ‘name’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  133|       }
#  134|   
#  135|->     if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
#  136|           if ((libxl_scheduler_from_string(buf, &sched)) < 0) {
#  137|               fprintf(stderr, "Unknown scheduler\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1191]
xen-4.20.2/tools/xl/xl_cpupool.c:136:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
xen-4.20.2/tools/xl/xl_cpupool.c:80:8: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
xen-4.20.2/tools/xl/xl_cpupool.c:93:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:93:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:110:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:111:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:116:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:117:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:122:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:122:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: branch_true: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_cpupool.c:130:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:135:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:135:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:136:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:136:13: throw: if ‘libxl_scheduler_from_string’ throws an exception...
xen-4.20.2/tools/xl/xl_cpupool.c:136:13: danger: ‘name’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  134|   
#  135|       if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
#  136|->         if ((libxl_scheduler_from_string(buf, &sched)) < 0) {
#  137|               fprintf(stderr, "Unknown scheduler\n");
#  138|               goto out_cfg;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1192]
xen-4.20.2/tools/xl/xl_cpupool.c:141:14: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
xen-4.20.2/tools/xl/xl_cpupool.c:80:8: branch_false: following ‘false’ branch (when ‘filename’ is NULL)...
xen-4.20.2/tools/xl/xl_cpupool.c:93:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:93:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:110:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:111:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:116:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:117:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:122:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:122:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: branch_true: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:123:16: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_cpupool.c:130:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:135:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:135:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_cpupool.c:141:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_cpupool.c:141:14: throw: if ‘libxl_get_scheduler’ throws an exception...
xen-4.20.2/tools/xl/xl_cpupool.c:141:14: danger: ‘name’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  139|           }
#  140|       } else {
#  141|->         rc = libxl_get_scheduler(ctx);
#  142|           if (rc < 0) {
#  143|               fprintf(stderr, "get_scheduler sysctl failed.\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1193]
xen-4.20.2/tools/xl/xl_flask.c:108:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(polFName, 0)’
xen-4.20.2/tools/xl/xl_flask.c:92:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_flask.c:97:20: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:98:13: acquire_resource: opened here
xen-4.20.2/tools/xl/xl_flask.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_flask.c:106:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:139:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_flask.c:140:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_flask.c:108:9: danger: ‘open(polFName, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  106|       ret = stat(polFName, &info);
#  107|       if (ret < 0) {
#  108|->         fprintf(stderr, "Error occurred retrieving information about"
#  109|                   "policy file '%s': %s\n", polFName, strerror(errno));
#  110|           goto done;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1194]
xen-4.20.2/tools/xl/xl_flask.c:113:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(polFName, 0)’
xen-4.20.2/tools/xl/xl_flask.c:92:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_flask.c:97:20: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:98:13: acquire_resource: opened here
xen-4.20.2/tools/xl/xl_flask.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_flask.c:106:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:107:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/xl/xl_flask.c:113:23: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:116:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/xl/xl_flask.c:122:49: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:122:11: throw: if ‘libxl_flask_loadpolicy’ throws an exception...
xen-4.20.2/tools/xl/xl_flask.c:113:23: danger: ‘open(polFName, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  111|       }
#  112|   
#  113|->     polMemCp = malloc(info.st_size);
#  114|   
#  115|       ret = read(polFd, polMemCp, info.st_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1195]
xen-4.20.2/tools/xl/xl_flask.c:122:11: warning[-Wanalyzer-malloc-leak]: leak of ‘polMemCp’
xen-4.20.2/tools/xl/xl_flask.c:92:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_flask.c:97:20: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:99:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_flask.c:106:11: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:107:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/xl/xl_flask.c:113:23: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:113:16: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_flask.c:116:8: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xen-4.20.2/tools/xl/xl_flask.c:122:49: branch_false: ...to here
xen-4.20.2/tools/xl/xl_flask.c:122:11: throw: if ‘libxl_flask_loadpolicy’ throws an exception...
xen-4.20.2/tools/xl/xl_flask.c:122:11: danger: ‘polMemCp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  120|       }
#  121|   
#  122|->     ret = libxl_flask_loadpolicy(ctx, polMemCp, info.st_size);
#  123|   
#  124|       if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1196]
xen-4.20.2/tools/xl/xl_info.c:775:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/uptime", 0)’
xen-4.20.2/tools/xl/xl_info.c:769:10: acquire_resource: opened here
xen-4.20.2/tools/xl/xl_info.c:770:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_info.c:773:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_info.c:774:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_info.c:775:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_info.c:775:9: danger: ‘open("/proc/uptime", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  773|       nr = read(fd, buf, sizeof(buf) - 1);
#  774|       if (nr == -1) {
#  775|->         close(fd);
#  776|           goto err;
#  777|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1197]
xen-4.20.2/tools/xl/xl_info.c:778:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/uptime", 0)’
xen-4.20.2/tools/xl/xl_info.c:769:10: acquire_resource: opened here
xen-4.20.2/tools/xl/xl_info.c:770:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_info.c:773:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_info.c:774:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_info.c:778:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_info.c:778:5: danger: ‘open("/proc/uptime", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  776|           goto err;
#  777|       }
#  778|->     close(fd);
#  779|   
#  780|       buf[nr] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1198]
xen-4.20.2/tools/xl/xl_info.c:789:22: warning[-Wanalyzer-malloc-leak]: leak of ‘current_time_to_string(now)’
xen-4.20.2/tools/xl/xl_info.c:759:13: enter_function: entry to ‘print_dom0_uptime’
xen-4.20.2/tools/xl/xl_info.c:770:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_info.c:773:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_info.c:774:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_info.c:778:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_info.c:786:8: branch_true: following ‘true’ branch (when ‘short_mode != 0’)...
xen-4.20.2/tools/xl/xl_info.c:788:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_info.c:788:19: call_function: calling ‘current_time_to_string’ from ‘print_dom0_uptime’
xen-4.20.2/tools/xl/xl_info.c:788:19: return_function: returning to ‘print_dom0_uptime’ from ‘current_time_to_string’
xen-4.20.2/tools/xl/xl_info.c:789:22: call_function: calling ‘uptime_to_string’ from ‘print_dom0_uptime’
#  787|       {
#  788|           now_str = current_time_to_string(now);
#  789|->         uptime_str = uptime_to_string(uptime, 1);
#  790|           printf(" %s up %s, %s (%d)\n", now_str, uptime_str,
#  791|                  domname, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1199]
xen-4.20.2/tools/xl/xl_info.c:826:22: warning[-Wanalyzer-malloc-leak]: leak of ‘current_time_to_string(now)’
xen-4.20.2/tools/xl/xl_info.c:810:13: enter_function: entry to ‘print_domU_uptime’
xen-4.20.2/tools/xl/xl_info.c:819:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_info.c:821:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_info.c:823:8: branch_true: following ‘true’ branch (when ‘short_mode != 0’)...
xen-4.20.2/tools/xl/xl_info.c:825:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_info.c:825:19: call_function: calling ‘current_time_to_string’ from ‘print_domU_uptime’
xen-4.20.2/tools/xl/xl_info.c:825:19: return_function: returning to ‘print_domU_uptime’ from ‘current_time_to_string’
xen-4.20.2/tools/xl/xl_info.c:826:22: call_function: calling ‘uptime_to_string’ from ‘print_domU_uptime’
#  824|       {
#  825|           now_str = current_time_to_string(now);
#  826|->         uptime_str = uptime_to_string(uptime, 1);
#  827|           printf(" %s up %s, %s (%d)\n", now_str, uptime_str,
#  828|                  domname, domuid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1200]
xen-4.20.2/tools/xl/xl_misc.c:342:5: warning[-Wanalyzer-malloc-leak]: leak of ‘config_data’
xen-4.20.2/tools/xl/xl_misc.c:277:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xl/xl_misc.c:283:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_misc.c:289:9: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_misc.c:291:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_misc.c:303:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_misc.c:304:24: branch_true: ...to here
xen-4.20.2/tools/xl/xl_misc.c:304:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_misc.c:305:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_misc.c:315:8: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
xen-4.20.2/tools/xl/xl_misc.c:316:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_misc.c:319:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_misc.c:322:13: branch_false: ...to here
xen-4.20.2/tools/xl/xl_misc.c:322:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_misc.c:323:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_misc.c:328:48: branch_false: ...to here
xen-4.20.2/tools/xl/xl_misc.c:330:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_misc.c:334:27: branch_false: ...to here
xen-4.20.2/tools/xl/xl_misc.c:342:5: throw: if ‘libxl_domain_config_init’ throws an exception...
xen-4.20.2/tools/xl/xl_misc.c:342:5: danger: ‘config_data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  340|       }
#  341|   
#  342|->     libxl_domain_config_init(&d_config);
#  343|   
#  344|       parse_config_data(filename, config_data, config_len, &d_config);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1201]
xen-4.20.2/tools/xl/xl_nic.c:73:13: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.bridge’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_true: following ‘true’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/xl/xl_nic.c:73:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_nic.c:73:13: throw: if ‘parse_nic_config’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:73:13: danger: ‘nic.bridge’ leaks here; was allocated at [(10)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/9)
#   71|   
#   72|       for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
#   73|->         if (parse_nic_config(&nic, &config, *argv))
#   74|               return 1;
#   75|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1202]
xen-4.20.2/tools/xl/xl_nic.c:73:13: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.gatewaydev’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_true: following ‘true’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/xl/xl_nic.c:73:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_nic.c:73:13: throw: if ‘parse_nic_config’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:73:13: danger: ‘nic.gatewaydev’ leaks here; was allocated at [(12)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/11)
#   71|   
#   72|       for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
#   73|->         if (parse_nic_config(&nic, &config, *argv))
#   74|               return 1;
#   75|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1203]
xen-4.20.2/tools/xl/xl_nic.c:73:13: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.script’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_true: following ‘true’ branch (when ‘argc > 0’)...
xen-4.20.2/tools/xl/xl_nic.c:73:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_nic.c:73:13: throw: if ‘parse_nic_config’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:73:13: danger: ‘nic.script’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   71|   
#   72|       for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
#   73|->         if (parse_nic_config(&nic, &config, *argv))
#   74|               return 1;
#   75|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1204]
xen-4.20.2/tools/xl/xl_nic.c:78:22: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.bridge’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_false: following ‘false’ branch (when ‘argc <= 0’)...
xen-4.20.2/tools/xl/xl_nic.c:77:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:77:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_nic.c:78:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_nic.c:78:22: throw: if ‘libxl_device_nic_to_json’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:78:22: danger: ‘nic.bridge’ leaks here; was allocated at [(10)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/9)
#   76|   
#   77|       if (dryrun_only) {
#   78|->         char *json = libxl_device_nic_to_json(ctx, &nic);
#   79|           printf("vif: %s\n", json);
#   80|           free(json);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1205]
xen-4.20.2/tools/xl/xl_nic.c:78:22: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.gatewaydev’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_false: following ‘false’ branch (when ‘argc <= 0’)...
xen-4.20.2/tools/xl/xl_nic.c:77:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:77:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_nic.c:78:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_nic.c:78:22: throw: if ‘libxl_device_nic_to_json’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:78:22: danger: ‘nic.gatewaydev’ leaks here; was allocated at [(12)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/11)
#   76|   
#   77|       if (dryrun_only) {
#   78|->         char *json = libxl_device_nic_to_json(ctx, &nic);
#   79|           printf("vif: %s\n", json);
#   80|           free(json);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1206]
xen-4.20.2/tools/xl/xl_nic.c:78:22: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.script’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_false: following ‘false’ branch (when ‘argc <= 0’)...
xen-4.20.2/tools/xl/xl_nic.c:77:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:77:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_nic.c:78:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_nic.c:78:22: throw: if ‘libxl_device_nic_to_json’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:78:22: danger: ‘nic.script’ leaks here; was allocated at [(8)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/7)
#   76|   
#   77|       if (dryrun_only) {
#   78|->         char *json = libxl_device_nic_to_json(ctx, &nic);
#   79|           printf("vif: %s\n", json);
#   80|           free(json);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1207]
xen-4.20.2/tools/xl/xl_nic.c:86:9: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.bridge’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_false: following ‘false’ branch (when ‘argc <= 0’)...
xen-4.20.2/tools/xl/xl_nic.c:77:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:77:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:86:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:86:9: throw: if ‘libxl_device_nic_add’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:86:9: danger: ‘nic.bridge’ leaks here; was allocated at [(10)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/9)
#   84|       }
#   85|   
#   86|->     if (libxl_device_nic_add(ctx, domid, &nic, 0)) {
#   87|           fprintf(stderr, "libxl_device_nic_add failed.\n");
#   88|           return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1208]
xen-4.20.2/tools/xl/xl_nic.c:86:9: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.gatewaydev’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_false: following ‘false’ branch (when ‘argc <= 0’)...
xen-4.20.2/tools/xl/xl_nic.c:77:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:77:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:86:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:86:9: throw: if ‘libxl_device_nic_add’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:86:9: danger: ‘nic.gatewaydev’ leaks here; was allocated at [(12)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/11)
#   84|       }
#   85|   
#   86|->     if (libxl_device_nic_add(ctx, domid, &nic, 0)) {
#   87|           fprintf(stderr, "libxl_device_nic_add failed.\n");
#   88|           return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1209]
xen-4.20.2/tools/xl/xl_nic.c:86:9: warning[-Wanalyzer-malloc-leak]: leak of ‘nic.script’
xen-4.20.2/tools/xl/xl_nic.c:50:5: enter_function: entry to ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:64:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:69:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:70:5: call_function: calling ‘set_default_nic_values’ from ‘main_networkattach’
xen-4.20.2/tools/xl/xl_nic.c:70:5: return_function: returning to ‘main_networkattach’ from ‘set_default_nic_values’
xen-4.20.2/tools/xl/xl_nic.c:72:46: branch_false: following ‘false’ branch (when ‘argc <= 0’)...
xen-4.20.2/tools/xl/xl_nic.c:77:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:77:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_nic.c:86:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_nic.c:86:9: throw: if ‘libxl_device_nic_add’ throws an exception...
xen-4.20.2/tools/xl/xl_nic.c:86:9: danger: ‘nic.script’ leaks here; was allocated at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7)
#   84|       }
#   85|   
#   86|->     if (libxl_device_nic_add(ctx, domid, &nic, 0)) {
#   87|           fprintf(stderr, "libxl_device_nic_add failed.\n");
#   88|           return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1210]
xen-4.20.2/tools/xl/xl_parse.c:828:34: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/xl/xl_parse.c:814:5: enter_function: entry to ‘parse_vdispl_config’
xen-4.20.2/tools/xl/xl_parse.c:821:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:823:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:823:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:825:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:825:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:826:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:826:9: call_function: calling ‘split_string_into_string_list’ from ‘parse_vdispl_config’
xen-4.20.2/tools/xl/xl_parse.c:826:9: return_function: returning to ‘parse_vdispl_config’ from ‘split_string_into_string_list’
xen-4.20.2/tools/xl/xl_parse.c:828:34: throw: if ‘libxl_string_list_length’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:828:34: danger: ‘<unknown>’ leaks here; was allocated at [(16)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/15)
#  826|           split_string_into_string_list(oparg, ";", &connectors);
#  827|   
#  828|->         vdispl->num_connectors = libxl_string_list_length(&connectors);
#  829|           vdispl->connectors = xcalloc(vdispl->num_connectors,
#  830|                                        sizeof(*vdispl->connectors));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1211]
xen-4.20.2/tools/xl/xl_parse.c:828:34: warning[-Wanalyzer-malloc-leak]: leak of ‘connectors’
xen-4.20.2/tools/xl/xl_parse.c:814:5: enter_function: entry to ‘parse_vdispl_config’
xen-4.20.2/tools/xl/xl_parse.c:821:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:823:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:823:15: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:825:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:825:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:826:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:826:9: call_function: calling ‘split_string_into_string_list’ from ‘parse_vdispl_config’
xen-4.20.2/tools/xl/xl_parse.c:826:9: return_function: returning to ‘parse_vdispl_config’ from ‘split_string_into_string_list’
xen-4.20.2/tools/xl/xl_parse.c:828:34: throw: if ‘libxl_string_list_length’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:828:34: danger: ‘connectors’ leaks here; was allocated at [(12)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/11)
#  826|           split_string_into_string_list(oparg, ";", &connectors);
#  827|   
#  828|->         vdispl->num_connectors = libxl_string_list_length(&connectors);
#  829|           vdispl->connectors = xcalloc(vdispl->num_connectors,
#  830|                                        sizeof(*vdispl->connectors));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1212]
xen-4.20.2/tools/xl/xl_parse.c:871:36: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/xl/xl_parse.c:861:12: enter_function: entry to ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:866:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:867:27: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:869:9: call_function: calling ‘split_string_into_string_list’ from ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:869:9: return_function: returning to ‘parse_vsnd_params’ from ‘split_string_into_string_list’
xen-4.20.2/tools/xl/xl_parse.c:871:36: throw: if ‘libxl_string_list_length’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:871:36: danger: ‘<unknown>’ leaks here; was allocated at [(12)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/11)
#  869|           split_string_into_string_list(oparg, ";", &rates);
#  870|   
#  871|->         params->num_sample_rates = libxl_string_list_length(&rates);
#  872|           params->sample_rates = xcalloc(params->num_sample_rates,
#  873|                                          sizeof(*params->sample_rates));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1213]
xen-4.20.2/tools/xl/xl_parse.c:871:36: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1017:5: enter_function: entry to ‘parse_vsnd_item’
xen-4.20.2/tools/xl/xl_parse.c:1019:17: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1025:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_true: following ‘true’ branch (when ‘key’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1029:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1030:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1043:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: following ‘false’ branch (when ‘key’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1032:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1033:23: call_function: calling ‘parse_vsnd_card_param’ from ‘parse_vsnd_item’
#  869|           split_string_into_string_list(oparg, ";", &rates);
#  870|   
#  871|->         params->num_sample_rates = libxl_string_list_length(&rates);
#  872|           params->sample_rates = xcalloc(params->num_sample_rates,
#  873|                                          sizeof(*params->sample_rates));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1214]
xen-4.20.2/tools/xl/xl_parse.c:871:36: warning[-Wanalyzer-malloc-leak]: leak of ‘rates’
xen-4.20.2/tools/xl/xl_parse.c:861:12: enter_function: entry to ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:866:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:867:27: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:869:9: call_function: calling ‘split_string_into_string_list’ from ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:869:9: return_function: returning to ‘parse_vsnd_params’ from ‘split_string_into_string_list’
xen-4.20.2/tools/xl/xl_parse.c:871:36: throw: if ‘libxl_string_list_length’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:871:36: danger: ‘rates’ leaks here; was allocated at [(8)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/7)
#  869|           split_string_into_string_list(oparg, ";", &rates);
#  870|   
#  871|->         params->num_sample_rates = libxl_string_list_length(&rates);
#  872|           params->sample_rates = xcalloc(params->num_sample_rates,
#  873|                                          sizeof(*params->sample_rates));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1215]
xen-4.20.2/tools/xl/xl_parse.c:885:38: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/tools/xl/xl_parse.c:861:12: enter_function: entry to ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:866:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:880:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:880:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:881:27: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:883:9: call_function: calling ‘split_string_into_string_list’ from ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:883:9: return_function: returning to ‘parse_vsnd_params’ from ‘split_string_into_string_list’
xen-4.20.2/tools/xl/xl_parse.c:885:38: throw: if ‘libxl_string_list_length’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:885:38: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/13)
#  883|           split_string_into_string_list(oparg, ";", &formats);
#  884|   
#  885|->         params->num_sample_formats = libxl_string_list_length(&formats);
#  886|           params->sample_formats = xcalloc(params->num_sample_formats,
#  887|                                            sizeof(*params->sample_formats));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1216]
xen-4.20.2/tools/xl/xl_parse.c:885:38: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1017:5: enter_function: entry to ‘parse_vsnd_item’
xen-4.20.2/tools/xl/xl_parse.c:1019:17: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1025:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_true: following ‘true’ branch (when ‘key’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1029:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1030:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1043:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: following ‘false’ branch (when ‘key’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1032:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1033:23: call_function: calling ‘parse_vsnd_card_param’ from ‘parse_vsnd_item’
#  883|           split_string_into_string_list(oparg, ";", &formats);
#  884|   
#  885|->         params->num_sample_formats = libxl_string_list_length(&formats);
#  886|           params->sample_formats = xcalloc(params->num_sample_formats,
#  887|                                            sizeof(*params->sample_formats));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1217]
xen-4.20.2/tools/xl/xl_parse.c:885:38: warning[-Wanalyzer-malloc-leak]: leak of ‘formats’
xen-4.20.2/tools/xl/xl_parse.c:861:12: enter_function: entry to ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:866:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:880:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:880:15: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:881:27: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:883:9: call_function: calling ‘split_string_into_string_list’ from ‘parse_vsnd_params’
xen-4.20.2/tools/xl/xl_parse.c:883:9: return_function: returning to ‘parse_vsnd_params’ from ‘split_string_into_string_list’
xen-4.20.2/tools/xl/xl_parse.c:885:38: throw: if ‘libxl_string_list_length’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:885:38: danger: ‘formats’ leaks here; was allocated at [(10)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/9)
#  883|           split_string_into_string_list(oparg, ";", &formats);
#  884|   
#  885|->         params->num_sample_formats = libxl_string_list_length(&formats);
#  886|           params->sample_formats = xcalloc(params->num_sample_formats,
#  887|                                            sizeof(*params->sample_formats));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1218]
xen-4.20.2/tools/xl/xl_parse.c:997:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1017:5: enter_function: entry to ‘parse_vsnd_item’
xen-4.20.2/tools/xl/xl_parse.c:1019:17: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1025:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_true: following ‘true’ branch (when ‘key’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1029:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1029:19: call_function: calling ‘parse_vsnd_create_item’ from ‘parse_vsnd_item’
#  995|   
#  996|       } else if (strcasecmp(key, "pcm") == 0) {
#  997|->         ARRAY_EXTEND_INIT_NODEVID(vsnd->pcms, vsnd->num_vsnd_pcms,
#  998|                                     libxl_vsnd_pcm_init);
#  999|       } else if (strcasecmp(key, "stream") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1219]
xen-4.20.2/tools/xl/xl_parse.c:1001:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1017:5: enter_function: entry to ‘parse_vsnd_item’
xen-4.20.2/tools/xl/xl_parse.c:1019:17: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1025:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_true: following ‘true’ branch (when ‘key’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1029:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1029:19: call_function: calling ‘parse_vsnd_create_item’ from ‘parse_vsnd_item’
#  999|       } else if (strcasecmp(key, "stream") == 0) {
# 1000|           if (vsnd->num_vsnd_pcms == 0) {
# 1001|->             ARRAY_EXTEND_INIT_NODEVID(vsnd->pcms, vsnd->num_vsnd_pcms,
# 1002|                                         libxl_vsnd_pcm_init);
# 1003|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1220]
xen-4.20.2/tools/xl/xl_parse.c:1007:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1017:5: enter_function: entry to ‘parse_vsnd_item’
xen-4.20.2/tools/xl/xl_parse.c:1019:17: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1024:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1025:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1027:12: branch_true: following ‘true’ branch (when ‘key’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1029:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1029:19: call_function: calling ‘parse_vsnd_create_item’ from ‘parse_vsnd_item’
# 1005|           libxl_vsnd_pcm *pcm =  &vsnd->pcms[vsnd->num_vsnd_pcms - 1];
# 1006|   
# 1007|->         ARRAY_EXTEND_INIT_NODEVID(pcm->streams, pcm->num_vsnd_streams,
# 1008|                                     libxl_vsnd_stream_init);
# 1009|       } else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1221]
xen-4.20.2/tools/xl/xl_parse.c:1112:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1148:13: enter_function: entry to ‘parse_vkb_list’
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1166:19: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1169:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1169:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1171:24: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1173:22: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1173:22: call_function: calling ‘parse_vkb_config’ from ‘parse_vkb_list’
# 1110|       } else if (MATCH_OPTION("backend-type", token, oparg)) {
# 1111|           libxl_vkb_backend backend_type;
# 1112|->         if (libxl_vkb_backend_from_string(oparg, &backend_type)) {
# 1113|               fprintf(stderr, "Unknown backend_type \"%s\" in vkb spec\n",
# 1114|                               oparg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1222]
xen-4.20.2/tools/xl/xl_parse.c:1158:24: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1166:19: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1169:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1179:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1179:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1184:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:24: throw: if ‘xlu_cfg_get_listitem’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:1158:24: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 1156|       if (!xlu_cfg_get_list (config, "vkb", &vkbs, 0, 0)) {
# 1157|           int entry = 0;
# 1158|->         while ((item = xlu_cfg_get_listitem(vkbs, entry)) != NULL) {
# 1159|               libxl_device_vkb *vkb;
# 1160|               char *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1223]
xen-4.20.2/tools/xl/xl_parse.c:1162:19: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1166:19: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1169:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1179:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1179:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1184:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1162:19: throw: if ‘xrealloc’ throws an exception...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 1160|               char *p;
# 1161|   
# 1162|->             vkb = ARRAY_EXTEND_INIT(d_config->vkbs,
# 1163|                                       d_config->num_vkbs,
# 1164|                                       libxl_device_vkb_init);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1224]
xen-4.20.2/tools/xl/xl_parse.c:1197:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1156:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1166:19: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1169:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1179:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1179:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1184:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1158:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1162:19: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1169:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1179:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1179:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1184:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1184:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1197:13: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
# 1195|               }
# 1196|   
# 1197|->             entry++;
# 1198|           }
# 1199|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1225]
xen-4.20.2/tools/xl/xl_parse.c:1218:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1230:13: enter_function: entry to ‘parse_virtio_list’
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1240:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1244:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1247:19: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1255:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1256:26: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1256:24: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1257:36: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1267:22: call_function: calling ‘parse_virtio_config’ from ‘parse_virtio_list’
# 1216|           virtio->type = strdup(oparg);
# 1217|       } else if (MATCH_OPTION("transport", token, oparg)) {
# 1218|->         rc = libxl_virtio_transport_from_string(oparg, &virtio->transport);
# 1219|           if (rc) return rc;
# 1220|       } else if (MATCH_OPTION("grant_usage", token, oparg)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1226]
xen-4.20.2/tools/xl/xl_parse.c:1218:14: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
xen-4.20.2/tools/xl/xl_parse.c:1230:13: enter_function: entry to ‘parse_virtio_list’
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1240:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1244:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1255:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1256:26: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1256:24: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1257:36: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1258:31: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1267:22: call_function: calling ‘parse_virtio_config’ from ‘parse_virtio_list’
# 1216|           virtio->type = strdup(oparg);
# 1217|       } else if (MATCH_OPTION("transport", token, oparg)) {
# 1218|->         rc = libxl_virtio_transport_from_string(oparg, &virtio->transport);
# 1219|           if (rc) return rc;
# 1220|       } else if (MATCH_OPTION("grant_usage", token, oparg)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1227]
xen-4.20.2/tools/xl/xl_parse.c:1221:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xl/xl_parse.c:1230:13: enter_function: entry to ‘parse_virtio_list’
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1240:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1244:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1247:19: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1255:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1256:26: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1256:24: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1257:36: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1267:22: call_function: calling ‘parse_virtio_config’ from ‘parse_virtio_list’
# 1219|           if (rc) return rc;
# 1220|       } else if (MATCH_OPTION("grant_usage", token, oparg)) {
# 1221|->         libxl_defbool_set(&virtio->grant_usage, strtoul(oparg, NULL, 0));
# 1222|       } else {
# 1223|           fprintf(stderr, "Unknown string \"%s\" in virtio spec\n", token);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1228]
xen-4.20.2/tools/xl/xl_parse.c:1221:9: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
xen-4.20.2/tools/xl/xl_parse.c:1230:13: enter_function: entry to ‘parse_virtio_list’
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1240:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1244:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1255:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1256:26: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1256:24: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1257:36: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1258:31: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_parse.c:1267:22: call_function: calling ‘parse_virtio_config’ from ‘parse_virtio_list’
# 1219|           if (rc) return rc;
# 1220|       } else if (MATCH_OPTION("grant_usage", token, oparg)) {
# 1221|->         libxl_defbool_set(&virtio->grant_usage, strtoul(oparg, NULL, 0));
# 1222|       } else {
# 1223|           fprintf(stderr, "Unknown string \"%s\" in virtio spec\n", token);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1229]
xen-4.20.2/tools/xl/xl_parse.c:1258:50: warning[-Wanalyzer-null-argument]: use of NULL ‘p2’ where non-null expected
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1240:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1244:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1252:24: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1255:21: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1255:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1256:26: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1256:24: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1257:36: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1258:50: danger: argument 1 (‘p2’) NULL where non-null expected
# 1256|                       if (!strncmp(oparg, "virtio", strlen("virtio"))) {
# 1257|                           char *p2 = strtok(NULL, ",");
# 1258|->                         str = malloc(strlen(p) + strlen(p2) + 2);
# 1259|   
# 1260|                           strcpy(str, p);

Error: CPPCHECK_WARNING (CWE-476): [#def1230]
xen-4.20.2/tools/xl/xl_parse.c:1260: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: str
# 1258|                           str = malloc(strlen(p) + strlen(p2) + 2);
# 1259|   
# 1260|->                         strcpy(str, p);
# 1261|                           strcat(str, ",");
# 1262|                           strcat(str, p2);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1231]
xen-4.20.2/tools/xl/xl_parse.c:1260:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘str’ where non-null expected
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1238:8: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1240:16: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1244:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
xen-4.20.2/tools/xl/xl_parse.c:1250:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1252:24: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1255:21: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1255:20: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1256:26: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1256:24: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1257:36: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1258:31: acquire_memory: this call could return NULL
xen-4.20.2/tools/xl/xl_parse.c:1260:25: danger: argument 1 (‘str’) from [(15)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/14) could be NULL where non-null expected
# 1258|                           str = malloc(strlen(p) + strlen(p2) + 2);
# 1259|   
# 1260|->                         strcpy(str, p);
# 1261|                           strcat(str, ",");
# 1262|                           strcat(str, p2);

Error: CPPCHECK_WARNING (CWE-476): [#def1232]
xen-4.20.2/tools/xl/xl_parse.c:1261: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: str
# 1259|   
# 1260|                           strcpy(str, p);
# 1261|->                         strcat(str, ",");
# 1262|                           strcat(str, p2);
# 1263|                           p = str;

Error: CPPCHECK_WARNING (CWE-476): [#def1233]
xen-4.20.2/tools/xl/xl_parse.c:1262: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: str
# 1260|                           strcpy(str, p);
# 1261|                           strcat(str, ",");
# 1262|->                         strcat(str, p2);
# 1263|                           p = str;
# 1264|                       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1234]
xen-4.20.2/tools/xl/xl_parse.c:1482:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/tools/xl/xl_parse.c:1314:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1320:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1323:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1328:8: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1329:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1334:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1393:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1398:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1451:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1454:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1455:21: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1456:22: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1459:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1465:17: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1465:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1471:24: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1471:23: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1477:13: branch_false: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1481:29: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_parse.c:1482:17: branch_true: ...to here
xen-4.20.2/tools/xl/xl_parse.c:1482:17: danger: dereference of NULL ‘*(libxl_domain_build_info *)((char *)d_config + 104).llc_colors + (long unsigned int)cur_index * 4’
# 1480|   
# 1481|               for (k = start; k <= end; k++)
# 1482|->                 b_info->llc_colors[cur_index++] = k;
# 1483|           }
# 1484|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1235]
xen-4.20.2/tools/xl/xl_pci.c:217:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pci.name’
xen-4.20.2/tools/xl/xl_pci.c:202:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_pci.c:204:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_pci.c:204:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_pci.c:209:8: branch_false: ...to here
xen-4.20.2/tools/xl/xl_pci.c:209:8: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
xen-4.20.2/tools/xl/xl_pci.c:210:20: branch_true: ...to here
xen-4.20.2/tools/xl/xl_pci.c:210:20: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_pci.c:211:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_pci.c:217:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_pci.c:217:9: throw: if ‘libxl_device_pci_assignable_add’ throws an exception...
xen-4.20.2/tools/xl/xl_pci.c:217:9: danger: ‘pci.name’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  215|       }
#  216|   
#  217|->     r = libxl_device_pci_assignable_add(ctx, &pci, rebind);
#  218|   
#  219|       libxl_device_pci_dispose(&pci);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1236]
xen-4.20.2/tools/xl/xl_pci.c:267:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pci.name’
xen-4.20.2/tools/xl/xl_pci.c:258:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_pci.c:261:16: branch_false: ...to here
xen-4.20.2/tools/xl/xl_pci.c:261:16: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_pci.c:262:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_pci.c:267:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_pci.c:267:9: throw: if ‘libxl_device_pci_assignable_remove’ throws an exception...
xen-4.20.2/tools/xl/xl_pci.c:267:9: danger: ‘pci.name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  265|       }
#  266|   
#  267|->     r = libxl_device_pci_assignable_remove(ctx, &pci, rebind);
#  268|       if (!r || r != ERROR_NOTFOUND)
#  269|           goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1237]
xen-4.20.2/tools/xl/xl_utils.c:285:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
xen-4.20.2/tools/xl/xl_utils.c:262:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_utils.c:269:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_utils.c:272:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_utils.c:277:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_utils.c:277:5: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_utils.c:278:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_utils.c:279:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_utils.c:281:5: branch_true: ...to here
xen-4.20.2/tools/xl/xl_utils.c:281:5: acquire_resource: opened here
xen-4.20.2/tools/xl/xl_utils.c:281:5: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_utils.c:282:5: branch_false: ...to here
xen-4.20.2/tools/xl/xl_utils.c:282:5: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_utils.c:284:5: branch_true: ...to here
xen-4.20.2/tools/xl/xl_utils.c:285:5: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  283|   
#  284|       dup2(nullfd, 0);
#  285|->     dup2(logfile, 1);
#  286|       dup2(logfile, 2);
#  287|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1238]
xen-4.20.2/tools/xl/xl_vcpu.c:253:30: warning[-Wanalyzer-null-argument]: use of NULL ‘soft_str’ where non-null expected
xen-4.20.2/tools/xl/xl_vcpu.c:211:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vcpu.c:214:14: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vcpu.c:227:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vcpu.c:228:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vcpu.c:227:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vcpu.c:245:10: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vcpu.c:245:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xl/xl_vcpu.c:253:17: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vcpu.c:253:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vcpu.c:253:30: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vcpu.c:253:30: danger: argument 1 (‘soft_str’) NULL where non-null expected
#  251|        * to pass NULL to libxl_set_vcpuaffinity() if it is not specified.
#  252|        */
#  253|->     if (argc <= optind+3 || !strcmp(soft_str, "-"))
#  254|           soft = NULL;
#  255|       else if (parse_cpurange(soft_str, soft))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1239]
xen-4.20.2/tools/xl/xl_vmcontrol.c:747:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(restore_file, 0)’
xen-4.20.2/tools/xl/xl_vmcontrol.c:729:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:735:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:735:12: branch_false: following ‘false’ branch (when ‘migrate_fd < 0’)...
xen-4.20.2/tools/xl/xl_vmcontrol.c:741:26: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:741:26: acquire_resource: opened here
xen-4.20.2/tools/xl/xl_vmcontrol.c:742:16: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:747:18: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:747:18: throw: if ‘libxl_fd_set_cloexec’ throws an exception...
xen-4.20.2/tools/xl/xl_vmcontrol.c:747:18: danger: ‘open(restore_file, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  745|               }
#  746|               restore_fd_to_close = restore_fd;
#  747|->             rc = libxl_fd_set_cloexec(ctx, restore_fd, 1);
#  748|               if (rc) return rc;
#  749|           }

Error: CPPCHECK_WARNING (CWE-909): [#def1240]
xen-4.20.2/tools/xl/xl_vmcontrol.c:843: error[uninitStructMember]: Uninitialized struct member: hdr.mandatory_flags
#  841|           }
#  842|           config_source = "<saved>";
#  843|->         config_in_json = !!(hdr.mandatory_flags & XL_MANDATORY_FLAG_JSON);
#  844|       }
#  845|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1241]
xen-4.20.2/tools/xl/xl_vmcontrol.c:896:13: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(d_config.c_info.name)’
xen-4.20.2/tools/xl/xl_vmcontrol.c:729:8: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:735:12: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:751:9: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:754:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:759:13: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:759:12: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:763:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:770:12: branch_false: following ‘false’ branch (when ‘badflags == 0’)...
xen-4.20.2/tools/xl/xl_vmcontrol.c:776:13: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:776:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:777:29: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:778:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:796:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:798:24: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:800:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:800:13: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:804:13: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:804:13: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:812:8: branch_true: following ‘true’ branch (when ‘config_file’ is non-NULL)...
xen-4.20.2/tools/xl/xl_vmcontrol.c:813:9: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:815:12: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xl/xl_vmcontrol.c:816:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:849:8: branch_false: following ‘false’ branch (when ‘config_in_json == 0’)...
xen-4.20.2/tools/xl/xl_vmcontrol.c:853:9: branch_false: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:886:8: branch_true: following ‘true’ branch (when ‘migrate_fd >= 0’)...
xen-4.20.2/tools/xl/xl_vmcontrol.c:887:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:887:12: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:890:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:890:13: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xl/xl_vmcontrol.c:892:13: branch_true: ...to here
xen-4.20.2/tools/xl/xl_vmcontrol.c:896:46: acquire_memory: allocated here
xen-4.20.2/tools/xl/xl_vmcontrol.c:896:13: danger: ‘strdup(d_config.c_info.name)’ leaks here; was allocated at [(33)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/32)
#  894|   
#  895|               xasprintf(&d_config.c_info.name, "%s--incoming", common_domname);
#  896|->             *dom_info->migration_domname_r = strdup(d_config.c_info.name);
#  897|           }
#  898|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1242]
xen-4.20.2/tools/xs-clients/xenstore_control.c:20:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#   18|           return -1;
#   19|   
#   20|->     *buf = realloc(*buf, len + vallen);
#   21|       if (!*buf)
#   22|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1243]
xen-4.20.2/tools/xs-clients/xenstore_control.c:20:5: warning[-Wanalyzer-malloc-leak]: leak of ‘par’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:345:17: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:346:36: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:346:15: call_function: calling ‘add_to_buf’ from ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:346:15: return_function: returning to ‘main’ from ‘add_to_buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:345:17: branch_true: following ‘true’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:346:36: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:346:15: call_function: calling ‘add_to_buf’ from ‘main’
#   18|           return -1;
#   19|   
#   20|->     *buf = realloc(*buf, len + vallen);
#   21|       if (!*buf)
#   22|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1244]
xen-4.20.2/tools/xs-clients/xenstore_control.c:36:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#   34|   
#   35|       if (asprintf(&ret, "%u", to) < 0)
#   36|->         return 1;
#   37|       len = add_to_buf(&buf, "-s", len);
#   38|       len = add_to_buf(&buf, "-t", len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1245]
xen-4.20.2/tools/xs-clients/xenstore_control.c:54:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#   52|       for (time_start = time(NULL); time(NULL) - time_start < to;) {
#   53|           free(ret);
#   54|->         ret = xs_control_command(xsh, "live-update", buf, len);
#   55|           if (!ret)
#   56|               goto err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1246]
xen-4.20.2/tools/xs-clients/xenstore_control.c:139:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#  137|           goto out_rel;
#  138|       }
#  139|->     ret = xs_control_command(xsh, "live-update", buf, len);
#  140|       free(buf);
#  141|       if (!ret || strcmp(ret, "OK")) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1247]
xen-4.20.2/tools/xs-clients/xenstore_control.c:159:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(2057)’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#  157|       strcpy(buf, "-d");
#  158|       sz = BLOB_CHUNK_SZ;
#  159|->     for (off = 0; off < dom->kernel_size; off += BLOB_CHUNK_SZ) {
#  160|           if (dom->kernel_size - off < BLOB_CHUNK_SZ)
#  161|               sz = dom->kernel_size - off;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1248]
xen-4.20.2/tools/xs-clients/xenstore_control.c:242:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#  240|       len = add_to_buf(&buf, binary, len);
#  241|       if (len < 0)
#  242|->         return 1;
#  243|       ret = xs_control_command(xsh, "live-update", buf, len);
#  244|       free(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1249]
xen-4.20.2/tools/xs-clients/xenstore_control.c:243:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xen-4.20.2/tools/xs-clients/xenstore_control.c:318:5: enter_function: entry to ‘main’
xen-4.20.2/tools/xs-clients/xenstore_control.c:326:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:333:11: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:334:8: branch_false: following ‘false’ branch...
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:10: branch_false: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:340:8: branch_true: following ‘true’ branch (when the strings are equal)...
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: branch_true: ...to here
xen-4.20.2/tools/xs-clients/xenstore_control.c:341:14: call_function: calling ‘live_update’ from ‘main’
#  241|       if (len < 0)
#  242|           return 1;
#  243|->     ret = xs_control_command(xsh, "live-update", buf, len);
#  244|       free(buf);
#  245|       if (!ret || strcmp(ret, "OK")) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1250]
xen-4.20.2/xen/arch/x86/domain_page.c:192:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
xen-4.20.2/xen/arch/x86/domain_page.c:176:6: enter_function: entry to ‘unmap_domain_page’
xen-4.20.2/xen/arch/x86/domain_page.c:184:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/domain_page.c:189:9: branch_false: ...to here
xen-4.20.2/xen/arch/x86/domain_page.c:189:9: call_function: calling ‘mapcache_current_vcpu’ from ‘unmap_domain_page’
xen-4.20.2/xen/arch/x86/domain_page.c:189:9: return_function: return of NULL to ‘unmap_domain_page’ from ‘mapcache_current_vcpu’
xen-4.20.2/xen/arch/x86/domain_page.c:192:15: danger: dereference of NULL ‘v’
#  190|       ASSERT(v && is_pv_vcpu(v));
#  191|   
#  192|->     dcache = &v->domain->arch.pv.mapcache;
#  193|       ASSERT(dcache->inuse);
#  194|   

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1251]
xen-4.20.2/xen/arch/x86/extable.c:55:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/xen/arch/x86/extable.c:59:13: enter_function: entry to ‘sort_exception_tables’
xen-4.20.2/xen/arch/x86/extable.c:61:5: call_function: calling ‘sort_exception_table’ from ‘sort_exception_tables’
#   53|                                    const struct exception_table_entry *stop)
#   54|   {
#   55|->     sort(start, stop - start,
#   56|            sizeof(struct exception_table_entry), cmp_ex, swap_ex);
#   57|   }

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1252]
xen-4.20.2/xen/arch/x86/extable.c:76:21: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/xen/arch/x86/extable.c:220:26: enter_function: entry to ‘search_pre_exception_table’
xen-4.20.2/xen/arch/x86/extable.c:223:27: call_function: calling ‘search_one_extable’ from ‘search_pre_exception_table’
#   74|       while ( first <= last )
#   75|       {
#   76|->         mid = (last - first) / 2 + first;
#   77|           diff = ex_addr(mid) - value;
#   78|           if (diff == 0)

Error: GCC_ANALYZER_WARNING (CWE-674): [#def1253]
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3194:15: warning[-Wanalyzer-infinite-recursion]: infinite recursion
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3179:6: enter_function: entry to ‘hvmemul_read_cache’
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3186:11: call_function: inlined call to ‘is_hvm_vcpu’ from ‘hvmemul_read_cache’
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3186:10: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3186:10: branch_false: ...to here
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3189:13: branch_true: following ‘true’ branch (when ‘size > 8’)...
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3191:13: branch_true: ...to here
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3191:9: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3192:15: branch_true: ...to here
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3194:15: call_function: calling ‘hvmemul_read_cache’ from ‘hvmemul_read_cache’
# 3192|               ? -gpa & (sizeof(cache->ents->data) - 1)
# 3193|               : sizeof(cache->ents->data);
# 3194|->         if ( !hvmemul_read_cache(v, gpa, buffer, i) )
# 3195|               return false;
# 3196|           gpa += i;

Error: GCC_ANALYZER_WARNING (CWE-674): [#def1254]
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3226:9: warning[-Wanalyzer-infinite-recursion]: infinite recursion
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3211:6: enter_function: entry to ‘hvmemul_write_cache’
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3218:11: call_function: inlined call to ‘is_hvm_vcpu’ from ‘hvmemul_write_cache’
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3218:10: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3218:10: branch_false: ...to here
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3221:13: branch_true: following ‘true’ branch (when ‘size > 8’)...
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3223:13: branch_true: ...to here
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3223:9: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3224:15: branch_true: ...to here
xen-4.20.2/xen/arch/x86/hvm/emulate.c:3226:9: call_function: calling ‘hvmemul_write_cache’ from ‘hvmemul_write_cache’
# 3224|               ? -gpa & (sizeof(cache->ents->data) - 1)
# 3225|               : sizeof(cache->ents->data);
# 3226|->         hvmemul_write_cache(v, gpa, buffer, i);
# 3227|           gpa += i;
# 3228|           buffer += i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1255]
xen-4.20.2/xen/arch/x86/hvm/rtc.c:151:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
xen-4.20.2/xen/arch/x86/hvm/rtc.c:699:21: enter_function: entry to ‘handle_rtc_io’
xen-4.20.2/xen/arch/x86/hvm/rtc.c:704:8: branch_false: following ‘false’ branch (when ‘bytes == 1’)...
xen-4.20.2/xen/arch/x86/hvm/rtc.c:711:8: branch_false: ...to here
xen-4.20.2/xen/arch/x86/hvm/rtc.c:711:8: branch_true: following ‘true’ branch (when ‘dir == 0’)...
xen-4.20.2/xen/arch/x86/hvm/rtc.c:713:52: branch_true: ...to here
xen-4.20.2/xen/arch/x86/hvm/rtc.c:713:14: call_function: calling ‘rtc_ioport_write’ from ‘handle_rtc_io’
#  149|   
#  150|                   s->period = period;
#  151|->                 if ( v->domain->arch.hvm.params[HVM_PARAM_VPT_ALIGN] )
#  152|                       delta = 0;
#  153|                   else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1256]
xen-4.20.2/xen/arch/x86/hvm/vioapic.c:340:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vioapic’
xen-4.20.2/xen/arch/x86/hvm/vioapic.c:354:21: enter_function: entry to ‘vioapic_write’
xen-4.20.2/xen/arch/x86/hvm/vioapic.c:370:9: call_function: calling ‘vioapic_write_indirect’ from ‘vioapic_write’
#  338|                       redir_index, vioapic->ioregsel & 1 ? "hi" : "lo", val);
#  339|   
#  340|->         if ( redir_index >= vioapic->nr_pins )
#  341|           {
#  342|               gdprintk(XENLOG_WARNING, "vioapic_write_indirect "

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1257]
xen-4.20.2/xen/arch/x86/include/asm/shared.h:81:1: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
xen-4.20.2/xen/arch/x86/x86_64/traps.c:126:6: enter_function: entry to ‘show_registers’
xen-4.20.2/xen/arch/x86/x86_64/traps.c:131:22: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/x86_64/traps.c:133:10: call_function: inlined call to ‘get_cpu_info’ from ‘show_registers’
xen-4.20.2/xen/arch/x86/x86_64/traps.c:133:10: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/x86_64/traps.c:142:14: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/x86_64/traps.c:145:28: call_function: inlined call to ‘arch_get_cr2’ from ‘show_registers’
#   79|   GET_SET_SHARED(unsigned long, nmi_reason)
#   80|   
#   81|-> GET_SET_VCPU(unsigned long, cr2)
#   82|   
#   83|   #undef GET_SET_VCPU

Error: GCC_ANALYZER_WARNING (CWE-121): [#def1258]
xen-4.20.2/xen/arch/x86/include/asm/uaccess.h:310:13: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:678:21: enter_function: entry to ‘rep_outs’
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:693:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:696:10: branch_false: ...to here
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:696:10: call_function: calling ‘read_segment’ from ‘rep_outs’
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:696:10: return_function: returning to ‘rep_outs’ from ‘read_segment’
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:697:8: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:700:10: branch_false: ...to here
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:700:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:702:10: branch_false: ...to here
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:702:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:703:12: branch_false: ...to here
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:713:13: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:715:22: branch_true: ...to here
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:718:14: call_function: calling ‘pv_emul_virt_to_linear’ from ‘rep_outs’
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:718:14: return_function: returning to ‘rep_outs’ from ‘pv_emul_virt_to_linear’
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:720:12: branch_false: following ‘false’ branch (when ‘rc == 0’)...
xen-4.20.2/xen/arch/x86/pv/emul-priv-op.c:723:20: branch_false: ...to here
#  308|               return ret;
#  309|           case 8:
#  310|->             get_guest_size(*(uint64_t *)to, from, 8, ret, 8);
#  311|               return ret;
#  312|           }

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1259]
xen-4.20.2/xen/arch/x86/machine_kexec.c:120:5: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#  118|   
#  119|       code_page = __map_domain_page(image->control_code_page);
#  120|->     memcpy(code_page, kexec_reloc, kexec_reloc_end - (char *)kexec_reloc);
#  121|       unmap_domain_page(code_page);
#  122|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1260]
xen-4.20.2/xen/arch/x86/mm/altp2m.c:252:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cur_order’
xen-4.20.2/xen/arch/x86/mm/altp2m.c:231:6: enter_function: entry to ‘p2m_altp2m_get_or_propagate’
xen-4.20.2/xen/arch/x86/mm/altp2m.c:250:12: call_function: inlined call to ‘get_gfn_type_access’ from ‘p2m_altp2m_get_or_propagate’
xen-4.20.2/xen/arch/x86/mm/altp2m.c:250:12: call_function: inlined call to ‘get_gfn_type_access’ from ‘p2m_altp2m_get_or_propagate’
xen-4.20.2/xen/arch/x86/mm/altp2m.c:252:10: danger: use of uninitialized value ‘cur_order’ here
#  250|       amfn = get_gfn_type_access(ap2m, gfn_l, &ap2mt, &ap2ma, 0, &cur_order);
#  251|   
#  252|->     if ( cur_order > *page_order )
#  253|           cur_order = *page_order;
#  254|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1261]
xen-4.20.2/xen/arch/x86/mm/p2m.c:2127:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘order’
xen-4.20.2/xen/arch/x86/mm/p2m.c:2084:5: enter_function: entry to ‘relinquish_p2m_mapping’
xen-4.20.2/xen/arch/x86/mm/p2m.c:2090:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/p2m.c:2093:5: branch_false: ...to here
xen-4.20.2/xen/arch/x86/mm/p2m.c:2093:5: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/p2m.c:2095:5: call_function: inlined call to ‘p2m_lock’ from ‘relinquish_p2m_mapping’
xen-4.20.2/xen/arch/x86/mm/p2m.c:2100:13: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/p2m.c:2101:42: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/p2m.c:2100:13: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/p2m.c:2107:9: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/p2m.c:2107:9: call_function: calling ‘_get_gfn_type_access’ from ‘relinquish_p2m_mapping’
xen-4.20.2/xen/arch/x86/mm/p2m.c:2107:9: return_function: returning to ‘relinquish_p2m_mapping’ from ‘_get_gfn_type_access’
xen-4.20.2/xen/arch/x86/mm/p2m.c:2110:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/p2m.c:2127:16: branch_false: ...to here
xen-4.20.2/xen/arch/x86/mm/p2m.c:2127:16: danger: use of uninitialized value ‘order’ here
# 2125|           }
# 2126|   
# 2127|->         gfn += 1UL << order;
# 2128|   
# 2129|           if ( !(++count & 0xff) && hypercall_preempt_check() )

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1262]
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:114:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:98:1: enter_function: entry to ‘hvm_read’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:109:10: call_function: calling ‘hvm_translate_virtual_addr’ from ‘hvm_read’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:109:10: return_function: returning to ‘hvm_read’ from ‘hvm_translate_virtual_addr’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:111:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:114:10: branch_false: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:114:10: danger: use of uninitialized value ‘addr’ here
#  112|           return rc;
#  113|   
#  114|->     rc = hvm_copy_from_guest_linear(p_data, addr, bytes,
#  115|                                       (access_type == hvm_access_insn_fetch
#  116|                                        ? PFEC_insn_fetch : 0),

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1263]
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:352:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:315:31: enter_function: entry to ‘shadow_init_emulation’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:349:11: call_function: calling ‘hvm_translate_virtual_addr’ from ‘shadow_init_emulation’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:349:11: return_function: returning to ‘shadow_init_emulation’ from ‘hvm_translate_virtual_addr’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:348:5: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:352:11: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:352:11: danger: use of uninitialized value ‘addr’ here
#  350|               x86_seg_cs, regs->rip, sizeof(sh_ctxt->insn_buf),
#  351|               hvm_access_insn_fetch, sh_ctxt, &addr) &&
#  352|->          !hvm_copy_from_guest_linear(
#  353|                sh_ctxt->insn_buf, addr, sizeof(sh_ctxt->insn_buf),
#  354|                PFEC_insn_fetch, NULL))

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1264]
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:383:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:364:6: enter_function: entry to ‘shadow_continue_emulation’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:376:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:380:15: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:380:15: call_function: calling ‘hvm_translate_virtual_addr’ from ‘shadow_continue_emulation’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:380:15: return_function: returning to ‘shadow_continue_emulation’ from ‘hvm_translate_virtual_addr’
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:379:9: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:383:15: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/hvm.c:383:15: danger: use of uninitialized value ‘addr’ here
#  381|                   x86_seg_cs, regs->rip, sizeof(sh_ctxt->insn_buf),
#  382|                   hvm_access_insn_fetch, sh_ctxt, &addr) &&
#  383|->              !hvm_copy_from_guest_linear(
#  384|                    sh_ctxt->insn_buf, addr, sizeof(sh_ctxt->insn_buf),
#  385|                    PFEC_insn_fetch, NULL))

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1265]
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2818:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘gw.<U2f00>.l1e’
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2143:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2144:13: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2143:10: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2149:12: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2149:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2152:20: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2676:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2692:16: branch_false: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2724:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2754:8: branch_false: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2763:13: branch_true: following ‘true’ branch (when ‘fast_emul != 0’)...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2764:9: branch_true: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2767:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2775:8: branch_false: ...to here
xen-4.20.2/xen/arch/x86/mm/shadow/multi.c:2818:5: danger: use of uninitialized value ‘gw.<U2f00>.l1e’ here
# 2816|   #endif /* PAE guest */
# 2817|   
# 2818|->     sh_trace_emulate(gw.l1e, va);
# 2819|    emulate_done:
# 2820|       SHADOW_PRINTK("emulated\n");

Error: GCC_ANALYZER_WARNING (CWE-835): [#def1266]
xen-4.20.2/xen/arch/x86/physdev.c:58:13: warning[-Wanalyzer-infinite-loop]: infinite loop
xen-4.20.2/xen/arch/x86/physdev.c:58:13: danger: infinite loop here
xen-4.20.2/xen/arch/x86/physdev.c:58:13: branch_true: if it ever follows ‘true’ branch, it will always do so...
xen-4.20.2/xen/arch/x86/physdev.c:61:31: branch_true: ...to here
#   56|   
#   57|               BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_DOMU_IRQS);
#   58|->             list_for_each_entry ( girq,
#   59|                                     &hvm_irq_dpci->girq[*index],
#   60|                                     list )

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1267]
xen-4.20.2/xen/arch/x86/setup.c:586:5: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#  584|        * This includes a snapshot of the current stack.
#  585|        */
#  586|->     memcpy(__va(__pa(_start)), _start, _end - _start);
#  587|   
#  588|       /*

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1268]
xen-4.20.2/xen/arch/x86/setup.c:1443:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/xen/arch/x86/setup.c:1066:33: enter_function: entry to ‘__start_xen’
xen-4.20.2/xen/arch/x86/setup.c:1124:14: call_function: calling ‘multiboot_fill_boot_info’ from ‘__start_xen’
xen-4.20.2/xen/arch/x86/setup.c:1124:14: return_function: returning to ‘__start_xen’ from ‘multiboot_fill_boot_info’
xen-4.20.2/xen/arch/x86/setup.c:1138:8: branch_false: following ‘false’ branch (when ‘kextra’ is NULL)...
xen-4.20.2/xen/arch/x86/setup.c:1150:5: branch_false: ...to here
xen-4.20.2/xen/arch/x86/setup.c:1246:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/setup.c:1250:8: branch_false: ...to here
xen-4.20.2/xen/arch/x86/setup.c:1431:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/arch/x86/setup.c:1442:22: branch_true: ...to here
xen-4.20.2/xen/arch/x86/setup.c:1443:22: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
# 1441|            */
# 1442|           xen->start = virt_to_maddr(_stext);
# 1443|->         xen->size  = __2M_rwdata_end - _stext;
# 1444|       }
# 1445|   

Error: COMPILER_WARNING: [#def1269]
/tmp/cc6cPj6e.s: scope_hint: Assembler messages
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:34: Error: bad expression
#   32|   {
#   33|       OFFSET(UREGS_r15, struct cpu_user_regs, r15);
#   34|->     OFFSET(UREGS_r14, struct cpu_user_regs, r14);
#   35|       OFFSET(UREGS_r13, struct cpu_user_regs, r13);
#   36|       OFFSET(UREGS_r12, struct cpu_user_regs, r12);

Error: COMPILER_WARNING: [#def1270]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:34: Error: junk at end of line, first unrecognized character is `#'
#   32|   {
#   33|       OFFSET(UREGS_r15, struct cpu_user_regs, r15);
#   34|->     OFFSET(UREGS_r14, struct cpu_user_regs, r14);
#   35|       OFFSET(UREGS_r13, struct cpu_user_regs, r13);
#   36|       OFFSET(UREGS_r12, struct cpu_user_regs, r12);

Error: COMPILER_WARNING: [#def1271]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:35: Error: symbol `.ascii' is already defined
#   33|       OFFSET(UREGS_r15, struct cpu_user_regs, r15);
#   34|       OFFSET(UREGS_r14, struct cpu_user_regs, r14);
#   35|->     OFFSET(UREGS_r13, struct cpu_user_regs, r13);
#   36|       OFFSET(UREGS_r12, struct cpu_user_regs, r12);
#   37|       OFFSET(UREGS_rbp, struct cpu_user_regs, rbp);

Error: COMPILER_WARNING: [#def1272]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:36: Error: symbol `.ascii' is already defined
#   34|       OFFSET(UREGS_r14, struct cpu_user_regs, r14);
#   35|       OFFSET(UREGS_r13, struct cpu_user_regs, r13);
#   36|->     OFFSET(UREGS_r12, struct cpu_user_regs, r12);
#   37|       OFFSET(UREGS_rbp, struct cpu_user_regs, rbp);
#   38|       OFFSET(UREGS_rbx, struct cpu_user_regs, rbx);

Error: COMPILER_WARNING: [#def1273]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:37: Error: symbol `.ascii' is already defined
#   35|       OFFSET(UREGS_r13, struct cpu_user_regs, r13);
#   36|       OFFSET(UREGS_r12, struct cpu_user_regs, r12);
#   37|->     OFFSET(UREGS_rbp, struct cpu_user_regs, rbp);
#   38|       OFFSET(UREGS_rbx, struct cpu_user_regs, rbx);
#   39|       OFFSET(UREGS_r11, struct cpu_user_regs, r11);

Error: COMPILER_WARNING: [#def1274]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:38: Error: symbol `.ascii' is already defined
#   36|       OFFSET(UREGS_r12, struct cpu_user_regs, r12);
#   37|       OFFSET(UREGS_rbp, struct cpu_user_regs, rbp);
#   38|->     OFFSET(UREGS_rbx, struct cpu_user_regs, rbx);
#   39|       OFFSET(UREGS_r11, struct cpu_user_regs, r11);
#   40|       OFFSET(UREGS_r10, struct cpu_user_regs, r10);

Error: COMPILER_WARNING: [#def1275]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:39: Error: symbol `.ascii' is already defined
#   37|       OFFSET(UREGS_rbp, struct cpu_user_regs, rbp);
#   38|       OFFSET(UREGS_rbx, struct cpu_user_regs, rbx);
#   39|->     OFFSET(UREGS_r11, struct cpu_user_regs, r11);
#   40|       OFFSET(UREGS_r10, struct cpu_user_regs, r10);
#   41|       OFFSET(UREGS_r9, struct cpu_user_regs, r9);

Error: COMPILER_WARNING: [#def1276]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:40: Error: symbol `.ascii' is already defined
#   38|       OFFSET(UREGS_rbx, struct cpu_user_regs, rbx);
#   39|       OFFSET(UREGS_r11, struct cpu_user_regs, r11);
#   40|->     OFFSET(UREGS_r10, struct cpu_user_regs, r10);
#   41|       OFFSET(UREGS_r9, struct cpu_user_regs, r9);
#   42|       OFFSET(UREGS_r8, struct cpu_user_regs, r8);

Error: COMPILER_WARNING: [#def1277]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:41: Error: symbol `.ascii' is already defined
#   39|       OFFSET(UREGS_r11, struct cpu_user_regs, r11);
#   40|       OFFSET(UREGS_r10, struct cpu_user_regs, r10);
#   41|->     OFFSET(UREGS_r9, struct cpu_user_regs, r9);
#   42|       OFFSET(UREGS_r8, struct cpu_user_regs, r8);
#   43|       OFFSET(UREGS_rax, struct cpu_user_regs, rax);

Error: COMPILER_WARNING: [#def1278]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:42: Error: symbol `.ascii' is already defined
#   40|       OFFSET(UREGS_r10, struct cpu_user_regs, r10);
#   41|       OFFSET(UREGS_r9, struct cpu_user_regs, r9);
#   42|->     OFFSET(UREGS_r8, struct cpu_user_regs, r8);
#   43|       OFFSET(UREGS_rax, struct cpu_user_regs, rax);
#   44|       OFFSET(UREGS_rcx, struct cpu_user_regs, rcx);

Error: COMPILER_WARNING: [#def1279]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:43: Error: symbol `.ascii' is already defined
#   41|       OFFSET(UREGS_r9, struct cpu_user_regs, r9);
#   42|       OFFSET(UREGS_r8, struct cpu_user_regs, r8);
#   43|->     OFFSET(UREGS_rax, struct cpu_user_regs, rax);
#   44|       OFFSET(UREGS_rcx, struct cpu_user_regs, rcx);
#   45|       OFFSET(UREGS_rdx, struct cpu_user_regs, rdx);

Error: COMPILER_WARNING: [#def1280]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:44: Error: symbol `.ascii' is already defined
#   42|       OFFSET(UREGS_r8, struct cpu_user_regs, r8);
#   43|       OFFSET(UREGS_rax, struct cpu_user_regs, rax);
#   44|->     OFFSET(UREGS_rcx, struct cpu_user_regs, rcx);
#   45|       OFFSET(UREGS_rdx, struct cpu_user_regs, rdx);
#   46|       OFFSET(UREGS_rsi, struct cpu_user_regs, rsi);

Error: COMPILER_WARNING: [#def1281]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:45: Error: symbol `.ascii' is already defined
#   43|       OFFSET(UREGS_rax, struct cpu_user_regs, rax);
#   44|       OFFSET(UREGS_rcx, struct cpu_user_regs, rcx);
#   45|->     OFFSET(UREGS_rdx, struct cpu_user_regs, rdx);
#   46|       OFFSET(UREGS_rsi, struct cpu_user_regs, rsi);
#   47|       OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);

Error: COMPILER_WARNING: [#def1282]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:46: Error: symbol `.ascii' is already defined
#   44|       OFFSET(UREGS_rcx, struct cpu_user_regs, rcx);
#   45|       OFFSET(UREGS_rdx, struct cpu_user_regs, rdx);
#   46|->     OFFSET(UREGS_rsi, struct cpu_user_regs, rsi);
#   47|       OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);
#   48|       OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);

Error: COMPILER_WARNING: [#def1283]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:47: Error: symbol `.ascii' is already defined
#   45|       OFFSET(UREGS_rdx, struct cpu_user_regs, rdx);
#   46|       OFFSET(UREGS_rsi, struct cpu_user_regs, rsi);
#   47|->     OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);
#   48|       OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
#   49|       OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);

Error: COMPILER_WARNING: [#def1284]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:48: Error: symbol `.ascii' is already defined
#   46|       OFFSET(UREGS_rsi, struct cpu_user_regs, rsi);
#   47|       OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);
#   48|->     OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
#   49|       OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
#   50|       OFFSET(UREGS_rip, struct cpu_user_regs, rip);

Error: COMPILER_WARNING: [#def1285]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:49: Error: symbol `.ascii' is already defined
#   47|       OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);
#   48|       OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
#   49|->     OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
#   50|       OFFSET(UREGS_rip, struct cpu_user_regs, rip);
#   51|       OFFSET(UREGS_cs, struct cpu_user_regs, cs);

Error: COMPILER_WARNING: [#def1286]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:50: Error: symbol `.ascii' is already defined
#   48|       OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
#   49|       OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
#   50|->     OFFSET(UREGS_rip, struct cpu_user_regs, rip);
#   51|       OFFSET(UREGS_cs, struct cpu_user_regs, cs);
#   52|       OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);

Error: COMPILER_WARNING: [#def1287]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:51: Error: symbol `.ascii' is already defined
#   49|       OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
#   50|       OFFSET(UREGS_rip, struct cpu_user_regs, rip);
#   51|->     OFFSET(UREGS_cs, struct cpu_user_regs, cs);
#   52|       OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
#   53|       OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);

Error: COMPILER_WARNING: [#def1288]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:52: Error: symbol `.ascii' is already defined
#   50|       OFFSET(UREGS_rip, struct cpu_user_regs, rip);
#   51|       OFFSET(UREGS_cs, struct cpu_user_regs, cs);
#   52|->     OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
#   53|       OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
#   54|       OFFSET(UREGS_ss, struct cpu_user_regs, ss);

Error: COMPILER_WARNING: [#def1289]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:53: Error: symbol `.ascii' is already defined
#   51|       OFFSET(UREGS_cs, struct cpu_user_regs, cs);
#   52|       OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
#   53|->     OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
#   54|       OFFSET(UREGS_ss, struct cpu_user_regs, ss);
#   55|       OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);

Error: COMPILER_WARNING: [#def1290]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:54: Error: symbol `.ascii' is already defined
#   52|       OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
#   53|       OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
#   54|->     OFFSET(UREGS_ss, struct cpu_user_regs, ss);
#   55|       OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);
#   56|       BLANK();

Error: COMPILER_WARNING: [#def1291]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:55: Error: symbol `.ascii' is already defined
#   53|       OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
#   54|       OFFSET(UREGS_ss, struct cpu_user_regs, ss);
#   55|->     OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);
#   56|       BLANK();
#   57|   

Error: COMPILER_WARNING: [#def1292]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:56: Error: symbol `.ascii' is already defined
#   54|       OFFSET(UREGS_ss, struct cpu_user_regs, ss);
#   55|       OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);
#   56|->     BLANK();
#   57|   
#   58|       /*

Error: COMPILER_WARNING: [#def1293]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:57: Error: symbol `.ascii' is already defined
#   55|       OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);
#   56|       BLANK();
#   57|-> 
#   58|       /*
#   59|        * EFRAME_* is for the entry/exit logic where %rsp is pointing at

Error: COMPILER_WARNING: [#def1294]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:67: Error: symbol `.ascii' is already defined
#   65|   
#   66|       OFFSET_EF(EFRAME_entry_vector,    entry_vector);
#   67|->     OFFSET_EF(EFRAME_rip,             rip);
#   68|       OFFSET_EF(EFRAME_cs,              cs);
#   69|       OFFSET_EF(EFRAME_eflags,          eflags);

Error: COMPILER_WARNING: [#def1295]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:68: Error: symbol `.ascii' is already defined
#   66|       OFFSET_EF(EFRAME_entry_vector,    entry_vector);
#   67|       OFFSET_EF(EFRAME_rip,             rip);
#   68|->     OFFSET_EF(EFRAME_cs,              cs);
#   69|       OFFSET_EF(EFRAME_eflags,          eflags);
#   70|   

Error: COMPILER_WARNING: [#def1296]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:69: Error: symbol `.ascii' is already defined
#   67|       OFFSET_EF(EFRAME_rip,             rip);
#   68|       OFFSET_EF(EFRAME_cs,              cs);
#   69|->     OFFSET_EF(EFRAME_eflags,          eflags);
#   70|   
#   71|       /*

Error: COMPILER_WARNING: [#def1297]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:70: Error: symbol `.ascii' is already defined
#   68|       OFFSET_EF(EFRAME_cs,              cs);
#   69|       OFFSET_EF(EFRAME_eflags,          eflags);
#   70|-> 
#   71|       /*
#   72|        * These aren't real fields.  They're spare space, used by the IST

Error: COMPILER_WARNING: [#def1298]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:76: Error: symbol `.ascii' is already defined
#   74|        */
#   75|       OFFSET_EF(EFRAME_shadow_scf,      eflags, +4);
#   76|->     OFFSET_EF(EFRAME_shadow_sel,      eflags, +6);
#   77|   
#   78|       OFFSET_EF(EFRAME_rsp,             rsp);

Error: COMPILER_WARNING: [#def1299]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:77: Error: symbol `.ascii' is already defined
#   75|       OFFSET_EF(EFRAME_shadow_scf,      eflags, +4);
#   76|       OFFSET_EF(EFRAME_shadow_sel,      eflags, +6);
#   77|-> 
#   78|       OFFSET_EF(EFRAME_rsp,             rsp);
#   79|       BLANK();

Error: COMPILER_WARNING: [#def1300]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:79: Error: symbol `.ascii' is already defined
#   77|   
#   78|       OFFSET_EF(EFRAME_rsp,             rsp);
#   79|->     BLANK();
#   80|   
#   81|   #undef OFFSET_EF

Error: COMPILER_WARNING: [#def1301]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:80: Error: symbol `.ascii' is already defined
#   78|       OFFSET_EF(EFRAME_rsp,             rsp);
#   79|       BLANK();
#   80|-> 
#   81|   #undef OFFSET_EF
#   82|   

Error: COMPILER_WARNING: [#def1302]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:84: Error: symbol `.ascii' is already defined
#   82|   
#   83|       OFFSET(VCPU_processor, struct vcpu, processor);
#   84|->     OFFSET(VCPU_domain, struct vcpu, domain);
#   85|       OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info_area.map);
#   86|       OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv.trap_bounce);

Error: COMPILER_WARNING: [#def1303]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:85: Error: symbol `.ascii' is already defined
#   83|       OFFSET(VCPU_processor, struct vcpu, processor);
#   84|       OFFSET(VCPU_domain, struct vcpu, domain);
#   85|->     OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info_area.map);
#   86|       OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv.trap_bounce);
#   87|       OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);

Error: COMPILER_WARNING: [#def1304]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:86: Error: symbol `.ascii' is already defined
#   84|       OFFSET(VCPU_domain, struct vcpu, domain);
#   85|       OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info_area.map);
#   86|->     OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv.trap_bounce);
#   87|       OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
#   88|       OFFSET(VCPU_event_addr, struct vcpu, arch.pv.event_callback_eip);

Error: COMPILER_WARNING: [#def1305]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:87: Error: symbol `.ascii' is already defined
#   85|       OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info_area.map);
#   86|       OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv.trap_bounce);
#   87|->     OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
#   88|       OFFSET(VCPU_event_addr, struct vcpu, arch.pv.event_callback_eip);
#   89|       OFFSET(VCPU_event_sel, struct vcpu, arch.pv.event_callback_cs);

Error: COMPILER_WARNING: [#def1306]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:88: Error: symbol `.ascii' is already defined
#   86|       OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv.trap_bounce);
#   87|       OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
#   88|->     OFFSET(VCPU_event_addr, struct vcpu, arch.pv.event_callback_eip);
#   89|       OFFSET(VCPU_event_sel, struct vcpu, arch.pv.event_callback_cs);
#   90|       OFFSET(VCPU_syscall_addr, struct vcpu, arch.pv.syscall_callback_eip);

Error: COMPILER_WARNING: [#def1307]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:89: Error: symbol `.ascii' is already defined
#   87|       OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
#   88|       OFFSET(VCPU_event_addr, struct vcpu, arch.pv.event_callback_eip);
#   89|->     OFFSET(VCPU_event_sel, struct vcpu, arch.pv.event_callback_cs);
#   90|       OFFSET(VCPU_syscall_addr, struct vcpu, arch.pv.syscall_callback_eip);
#   91|       OFFSET(VCPU_syscall32_addr, struct vcpu, arch.pv.syscall32_callback_eip);

Error: COMPILER_WARNING: [#def1308]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:90: Error: symbol `.ascii' is already defined
#   88|       OFFSET(VCPU_event_addr, struct vcpu, arch.pv.event_callback_eip);
#   89|       OFFSET(VCPU_event_sel, struct vcpu, arch.pv.event_callback_cs);
#   90|->     OFFSET(VCPU_syscall_addr, struct vcpu, arch.pv.syscall_callback_eip);
#   91|       OFFSET(VCPU_syscall32_addr, struct vcpu, arch.pv.syscall32_callback_eip);
#   92|       OFFSET(VCPU_syscall32_sel, struct vcpu, arch.pv.syscall32_callback_cs);

Error: COMPILER_WARNING: [#def1309]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:91: Error: symbol `.ascii' is already defined
#   89|       OFFSET(VCPU_event_sel, struct vcpu, arch.pv.event_callback_cs);
#   90|       OFFSET(VCPU_syscall_addr, struct vcpu, arch.pv.syscall_callback_eip);
#   91|->     OFFSET(VCPU_syscall32_addr, struct vcpu, arch.pv.syscall32_callback_eip);
#   92|       OFFSET(VCPU_syscall32_sel, struct vcpu, arch.pv.syscall32_callback_cs);
#   93|       OFFSET(VCPU_syscall32_disables_events,

Error: COMPILER_WARNING: [#def1310]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:92: Error: symbol `.ascii' is already defined
#   90|       OFFSET(VCPU_syscall_addr, struct vcpu, arch.pv.syscall_callback_eip);
#   91|       OFFSET(VCPU_syscall32_addr, struct vcpu, arch.pv.syscall32_callback_eip);
#   92|->     OFFSET(VCPU_syscall32_sel, struct vcpu, arch.pv.syscall32_callback_cs);
#   93|       OFFSET(VCPU_syscall32_disables_events,
#   94|              struct vcpu, arch.pv.syscall32_disables_events);

Error: COMPILER_WARNING: [#def1311]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:93: Error: symbol `.ascii' is already defined
#   91|       OFFSET(VCPU_syscall32_addr, struct vcpu, arch.pv.syscall32_callback_eip);
#   92|       OFFSET(VCPU_syscall32_sel, struct vcpu, arch.pv.syscall32_callback_cs);
#   93|->     OFFSET(VCPU_syscall32_disables_events,
#   94|              struct vcpu, arch.pv.syscall32_disables_events);
#   95|       OFFSET(VCPU_sysenter_addr, struct vcpu, arch.pv.sysenter_callback_eip);

Error: COMPILER_WARNING: [#def1312]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:94: Error: symbol `.ascii' is already defined
#   92|       OFFSET(VCPU_syscall32_sel, struct vcpu, arch.pv.syscall32_callback_cs);
#   93|       OFFSET(VCPU_syscall32_disables_events,
#   94|->            struct vcpu, arch.pv.syscall32_disables_events);
#   95|       OFFSET(VCPU_sysenter_addr, struct vcpu, arch.pv.sysenter_callback_eip);
#   96|       OFFSET(VCPU_sysenter_sel, struct vcpu, arch.pv.sysenter_callback_cs);

Error: COMPILER_WARNING: [#def1313]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:96: Error: symbol `.ascii' is already defined
#   94|              struct vcpu, arch.pv.syscall32_disables_events);
#   95|       OFFSET(VCPU_sysenter_addr, struct vcpu, arch.pv.sysenter_callback_eip);
#   96|->     OFFSET(VCPU_sysenter_sel, struct vcpu, arch.pv.sysenter_callback_cs);
#   97|       OFFSET(VCPU_sysenter_disables_events,
#   98|              struct vcpu, arch.pv.sysenter_disables_events);

Error: COMPILER_WARNING: [#def1314]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:97: Error: symbol `.ascii' is already defined
#   95|       OFFSET(VCPU_sysenter_addr, struct vcpu, arch.pv.sysenter_callback_eip);
#   96|       OFFSET(VCPU_sysenter_sel, struct vcpu, arch.pv.sysenter_callback_cs);
#   97|->     OFFSET(VCPU_sysenter_disables_events,
#   98|              struct vcpu, arch.pv.sysenter_disables_events);
#   99|       OFFSET(VCPU_trap_ctxt, struct vcpu, arch.pv.trap_ctxt);

Error: COMPILER_WARNING: [#def1315]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:98: Error: symbol `.ascii' is already defined
#   96|       OFFSET(VCPU_sysenter_sel, struct vcpu, arch.pv.sysenter_callback_cs);
#   97|       OFFSET(VCPU_sysenter_disables_events,
#   98|->            struct vcpu, arch.pv.sysenter_disables_events);
#   99|       OFFSET(VCPU_trap_ctxt, struct vcpu, arch.pv.trap_ctxt);
#  100|       OFFSET(VCPU_kernel_sp, struct vcpu, arch.pv.kernel_sp);

Error: COMPILER_WARNING: [#def1316]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:100: Error: symbol `.ascii' is already defined
#   98|              struct vcpu, arch.pv.sysenter_disables_events);
#   99|       OFFSET(VCPU_trap_ctxt, struct vcpu, arch.pv.trap_ctxt);
#  100|->     OFFSET(VCPU_kernel_sp, struct vcpu, arch.pv.kernel_sp);
#  101|       OFFSET(VCPU_kernel_ss, struct vcpu, arch.pv.kernel_ss);
#  102|       OFFSET(VCPU_iopl, struct vcpu, arch.pv.iopl);

Error: COMPILER_WARNING: [#def1317]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:101: Error: symbol `.ascii' is already defined
#   99|       OFFSET(VCPU_trap_ctxt, struct vcpu, arch.pv.trap_ctxt);
#  100|       OFFSET(VCPU_kernel_sp, struct vcpu, arch.pv.kernel_sp);
#  101|->     OFFSET(VCPU_kernel_ss, struct vcpu, arch.pv.kernel_ss);
#  102|       OFFSET(VCPU_iopl, struct vcpu, arch.pv.iopl);
#  103|       OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);

Error: COMPILER_WARNING: [#def1318]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:102: Error: symbol `.ascii' is already defined
#  100|       OFFSET(VCPU_kernel_sp, struct vcpu, arch.pv.kernel_sp);
#  101|       OFFSET(VCPU_kernel_ss, struct vcpu, arch.pv.kernel_ss);
#  102|->     OFFSET(VCPU_iopl, struct vcpu, arch.pv.iopl);
#  103|       OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);
#  104|       OFFSET(VCPU_cr3, struct vcpu, arch.cr3);

Error: COMPILER_WARNING: [#def1319]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:103: Error: symbol `.ascii' is already defined
#  101|       OFFSET(VCPU_kernel_ss, struct vcpu, arch.pv.kernel_ss);
#  102|       OFFSET(VCPU_iopl, struct vcpu, arch.pv.iopl);
#  103|->     OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);
#  104|       OFFSET(VCPU_cr3, struct vcpu, arch.cr3);
#  105|       OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);

Error: COMPILER_WARNING: [#def1320]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:104: Error: symbol `.ascii' is already defined
#  102|       OFFSET(VCPU_iopl, struct vcpu, arch.pv.iopl);
#  103|       OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);
#  104|->     OFFSET(VCPU_cr3, struct vcpu, arch.cr3);
#  105|       OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);
#  106|       OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);

Error: COMPILER_WARNING: [#def1321]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:105: Error: symbol `.ascii' is already defined
#  103|       OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);
#  104|       OFFSET(VCPU_cr3, struct vcpu, arch.cr3);
#  105|->     OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);
#  106|       OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);
#  107|       OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);

Error: COMPILER_WARNING: [#def1322]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:106: Error: symbol `.ascii' is already defined
#  104|       OFFSET(VCPU_cr3, struct vcpu, arch.cr3);
#  105|       OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);
#  106|->     OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);
#  107|       OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);
#  108|       OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);

Error: COMPILER_WARNING: [#def1323]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:107: Error: symbol `.ascii' is already defined
#  105|       OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);
#  106|       OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);
#  107|->     OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);
#  108|       OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);
#  109|       OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);

Error: COMPILER_WARNING: [#def1324]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:108: Error: symbol `.ascii' is already defined
#  106|       OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);
#  107|       OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);
#  108|->     OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);
#  109|       OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);
#  110|       OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);

Error: COMPILER_WARNING: [#def1325]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:109: Error: symbol `.ascii' is already defined
#  107|       OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);
#  108|       OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);
#  109|->     OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);
#  110|       OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);
#  111|       DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);

Error: COMPILER_WARNING: [#def1326]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:110: Error: symbol `.ascii' is already defined
#  108|       OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);
#  109|       OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);
#  110|->     OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);
#  111|       DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
#  112|       DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);

Error: COMPILER_WARNING: [#def1327]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:111: Error: symbol `.ascii' is already defined
#  109|       OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);
#  110|       OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);
#  111|->     DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
#  112|       DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);
#  113|       DEFINE(_VGCF_syscall_disables_events,  _VGCF_syscall_disables_events);

Error: COMPILER_WARNING: [#def1328]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:112: Error: symbol `.ascii' is already defined
#  110|       OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);
#  111|       DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
#  112|->     DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);
#  113|       DEFINE(_VGCF_syscall_disables_events,  _VGCF_syscall_disables_events);
#  114|       BLANK();

Error: COMPILER_WARNING: [#def1329]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:113: Error: symbol `.ascii' is already defined
#  111|       DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
#  112|       DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);
#  113|->     DEFINE(_VGCF_syscall_disables_events,  _VGCF_syscall_disables_events);
#  114|       BLANK();
#  115|   

Error: COMPILER_WARNING: [#def1330]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:114: Error: symbol `.ascii' is already defined
#  112|       DEFINE(VCPU_TRAP_MCE, VCPU_TRAP_MCE);
#  113|       DEFINE(_VGCF_syscall_disables_events,  _VGCF_syscall_disables_events);
#  114|->     BLANK();
#  115|   
#  116|   #ifdef CONFIG_HVM

Error: COMPILER_WARNING: [#def1331]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:115: Error: symbol `.ascii' is already defined
#  113|       DEFINE(_VGCF_syscall_disables_events,  _VGCF_syscall_disables_events);
#  114|       BLANK();
#  115|-> 
#  116|   #ifdef CONFIG_HVM
#  117|       OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm.svm.vmcb_pa);

Error: COMPILER_WARNING: [#def1332]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:118: Error: symbol `.ascii' is already defined
#  116|   #ifdef CONFIG_HVM
#  117|       OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm.svm.vmcb_pa);
#  118|->     OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm.svm.vmcb);
#  119|       BLANK();
#  120|   

Error: COMPILER_WARNING: [#def1333]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:119: Error: symbol `.ascii' is already defined
#  117|       OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm.svm.vmcb_pa);
#  118|       OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm.svm.vmcb);
#  119|->     BLANK();
#  120|   
#  121|       OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm.vmx.launched);

Error: COMPILER_WARNING: [#def1334]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:120: Error: symbol `.ascii' is already defined
#  118|       OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm.svm.vmcb);
#  119|       BLANK();
#  120|-> 
#  121|       OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm.vmx.launched);
#  122|       OFFSET(VCPU_vmx_realmode, struct vcpu, arch.hvm.vmx.vmx_realmode);

Error: COMPILER_WARNING: [#def1335]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:122: Error: symbol `.ascii' is already defined
#  120|   
#  121|       OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm.vmx.launched);
#  122|->     OFFSET(VCPU_vmx_realmode, struct vcpu, arch.hvm.vmx.vmx_realmode);
#  123|       OFFSET(VCPU_vmx_emulate, struct vcpu, arch.hvm.vmx.vmx_emulate);
#  124|       OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm.vmx.vm86_segment_mask);

Error: COMPILER_WARNING: [#def1336]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:123: Error: symbol `.ascii' is already defined
#  121|       OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm.vmx.launched);
#  122|       OFFSET(VCPU_vmx_realmode, struct vcpu, arch.hvm.vmx.vmx_realmode);
#  123|->     OFFSET(VCPU_vmx_emulate, struct vcpu, arch.hvm.vmx.vmx_emulate);
#  124|       OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm.vmx.vm86_segment_mask);
#  125|       OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm.guest_cr[2]);

Error: COMPILER_WARNING: [#def1337]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:124: Error: symbol `.ascii' is already defined
#  122|       OFFSET(VCPU_vmx_realmode, struct vcpu, arch.hvm.vmx.vmx_realmode);
#  123|       OFFSET(VCPU_vmx_emulate, struct vcpu, arch.hvm.vmx.vmx_emulate);
#  124|->     OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm.vmx.vm86_segment_mask);
#  125|       OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm.guest_cr[2]);
#  126|       BLANK();

Error: COMPILER_WARNING: [#def1338]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:125: Error: symbol `.ascii' is already defined
#  123|       OFFSET(VCPU_vmx_emulate, struct vcpu, arch.hvm.vmx.vmx_emulate);
#  124|       OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm.vmx.vm86_segment_mask);
#  125|->     OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm.guest_cr[2]);
#  126|       BLANK();
#  127|   

Error: COMPILER_WARNING: [#def1339]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:126: Error: symbol `.ascii' is already defined
#  124|       OFFSET(VCPU_vm86_seg_mask, struct vcpu, arch.hvm.vmx.vm86_segment_mask);
#  125|       OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm.guest_cr[2]);
#  126|->     BLANK();
#  127|   
#  128|       OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm.nvcpu.nv_guestmode);

Error: COMPILER_WARNING: [#def1340]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:127: Error: symbol `.ascii' is already defined
#  125|       OFFSET(VCPU_hvm_guest_cr2, struct vcpu, arch.hvm.guest_cr[2]);
#  126|       BLANK();
#  127|-> 
#  128|       OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm.nvcpu.nv_guestmode);
#  129|       OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm.nvcpu.nv_p2m);

Error: COMPILER_WARNING: [#def1341]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:129: Error: symbol `.ascii' is already defined
#  127|   
#  128|       OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm.nvcpu.nv_guestmode);
#  129|->     OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm.nvcpu.nv_p2m);
#  130|       OFFSET(VCPU_nsvm_hap_enabled, struct vcpu, arch.hvm.nvcpu.u.nsvm.ns_hap_enabled);
#  131|       BLANK();

Error: COMPILER_WARNING: [#def1342]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:130: Error: symbol `.ascii' is already defined
#  128|       OFFSET(VCPU_nhvm_guestmode, struct vcpu, arch.hvm.nvcpu.nv_guestmode);
#  129|       OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm.nvcpu.nv_p2m);
#  130|->     OFFSET(VCPU_nsvm_hap_enabled, struct vcpu, arch.hvm.nvcpu.u.nsvm.ns_hap_enabled);
#  131|       BLANK();
#  132|   #endif

Error: COMPILER_WARNING: [#def1343]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:131: Error: symbol `.ascii' is already defined
#  129|       OFFSET(VCPU_nhvm_p2m, struct vcpu, arch.hvm.nvcpu.nv_p2m);
#  130|       OFFSET(VCPU_nsvm_hap_enabled, struct vcpu, arch.hvm.nvcpu.u.nsvm.ns_hap_enabled);
#  131|->     BLANK();
#  132|   #endif
#  133|   

Error: COMPILER_WARNING: [#def1344]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:132: Error: symbol `.ascii' is already defined
#  130|       OFFSET(VCPU_nsvm_hap_enabled, struct vcpu, arch.hvm.nvcpu.u.nsvm.ns_hap_enabled);
#  131|       BLANK();
#  132|-> #endif
#  133|   
#  134|   #ifdef CONFIG_PV32

Error: COMPILER_WARNING: [#def1345]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:136: Error: symbol `.ascii' is already defined
#  134|   #ifdef CONFIG_PV32
#  135|       OFFSET(DOMAIN_is_32bit_pv, struct domain, arch.pv.is_32bit);
#  136|->     BLANK();
#  137|   
#  138|       OFFSET(COMPAT_VCPUINFO_upcall_pending, struct compat_vcpu_info, evtchn_upcall_pending);

Error: COMPILER_WARNING: [#def1346]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:137: Error: symbol `.ascii' is already defined
#  135|       OFFSET(DOMAIN_is_32bit_pv, struct domain, arch.pv.is_32bit);
#  136|       BLANK();
#  137|-> 
#  138|       OFFSET(COMPAT_VCPUINFO_upcall_pending, struct compat_vcpu_info, evtchn_upcall_pending);
#  139|       OFFSET(COMPAT_VCPUINFO_upcall_mask, struct compat_vcpu_info, evtchn_upcall_mask);

Error: COMPILER_WARNING: [#def1347]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:139: Error: symbol `.ascii' is already defined
#  137|   
#  138|       OFFSET(COMPAT_VCPUINFO_upcall_pending, struct compat_vcpu_info, evtchn_upcall_pending);
#  139|->     OFFSET(COMPAT_VCPUINFO_upcall_mask, struct compat_vcpu_info, evtchn_upcall_mask);
#  140|       BLANK();
#  141|   #endif

Error: COMPILER_WARNING: [#def1348]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:140: Error: symbol `.ascii' is already defined
#  138|       OFFSET(COMPAT_VCPUINFO_upcall_pending, struct compat_vcpu_info, evtchn_upcall_pending);
#  139|       OFFSET(COMPAT_VCPUINFO_upcall_mask, struct compat_vcpu_info, evtchn_upcall_mask);
#  140|->     BLANK();
#  141|   #endif
#  142|   

Error: COMPILER_WARNING: [#def1349]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:141: Error: symbol `.ascii' is already defined
#  139|       OFFSET(COMPAT_VCPUINFO_upcall_mask, struct compat_vcpu_info, evtchn_upcall_mask);
#  140|       BLANK();
#  141|-> #endif
#  142|   
#  143|   #ifdef CONFIG_PV

Error: COMPILER_WARNING: [#def1350]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:145: Error: symbol `.ascii' is already defined
#  143|   #ifdef CONFIG_PV
#  144|       OFFSET(VCPUINFO_upcall_pending, struct vcpu_info, evtchn_upcall_pending);
#  145|->     OFFSET(VCPUINFO_upcall_mask, struct vcpu_info, evtchn_upcall_mask);
#  146|       BLANK();
#  147|   #endif

Error: COMPILER_WARNING: [#def1351]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:146: Error: symbol `.ascii' is already defined
#  144|       OFFSET(VCPUINFO_upcall_pending, struct vcpu_info, evtchn_upcall_pending);
#  145|       OFFSET(VCPUINFO_upcall_mask, struct vcpu_info, evtchn_upcall_mask);
#  146|->     BLANK();
#  147|   #endif
#  148|   

Error: COMPILER_WARNING: [#def1352]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:147: Error: symbol `.ascii' is already defined
#  145|       OFFSET(VCPUINFO_upcall_mask, struct vcpu_info, evtchn_upcall_mask);
#  146|       BLANK();
#  147|-> #endif
#  148|   
#  149|       OFFSET(CPUINFO_guest_cpu_user_regs, struct cpu_info, guest_cpu_user_regs);

Error: COMPILER_WARNING: [#def1353]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:150: Error: symbol `.ascii' is already defined
#  148|   
#  149|       OFFSET(CPUINFO_guest_cpu_user_regs, struct cpu_info, guest_cpu_user_regs);
#  150|->     OFFSET(CPUINFO_error_code, struct cpu_info, guest_cpu_user_regs.error_code);
#  151|       OFFSET(CPUINFO_rip, struct cpu_info, guest_cpu_user_regs.rip);
#  152|       OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);

Error: COMPILER_WARNING: [#def1354]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:151: Error: symbol `.ascii' is already defined
#  149|       OFFSET(CPUINFO_guest_cpu_user_regs, struct cpu_info, guest_cpu_user_regs);
#  150|       OFFSET(CPUINFO_error_code, struct cpu_info, guest_cpu_user_regs.error_code);
#  151|->     OFFSET(CPUINFO_rip, struct cpu_info, guest_cpu_user_regs.rip);
#  152|       OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);
#  153|       OFFSET(CPUINFO_verw_sel, struct cpu_info, verw_sel);

Error: COMPILER_WARNING: [#def1355]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:152: Error: symbol `.ascii' is already defined
#  150|       OFFSET(CPUINFO_error_code, struct cpu_info, guest_cpu_user_regs.error_code);
#  151|       OFFSET(CPUINFO_rip, struct cpu_info, guest_cpu_user_regs.rip);
#  152|->     OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);
#  153|       OFFSET(CPUINFO_verw_sel, struct cpu_info, verw_sel);
#  154|       OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);

Error: COMPILER_WARNING: [#def1356]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:153: Error: symbol `.ascii' is already defined
#  151|       OFFSET(CPUINFO_rip, struct cpu_info, guest_cpu_user_regs.rip);
#  152|       OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);
#  153|->     OFFSET(CPUINFO_verw_sel, struct cpu_info, verw_sel);
#  154|       OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
#  155|       OFFSET(CPUINFO_per_cpu_offset, struct cpu_info, per_cpu_offset);

Error: COMPILER_WARNING: [#def1357]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:154: Error: symbol `.ascii' is already defined
#  152|       OFFSET(CPUINFO_processor_id, struct cpu_info, processor_id);
#  153|       OFFSET(CPUINFO_verw_sel, struct cpu_info, verw_sel);
#  154|->     OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
#  155|       OFFSET(CPUINFO_per_cpu_offset, struct cpu_info, per_cpu_offset);
#  156|       OFFSET(CPUINFO_cr4, struct cpu_info, cr4);

Error: COMPILER_WARNING: [#def1358]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:155: Error: symbol `.ascii' is already defined
#  153|       OFFSET(CPUINFO_verw_sel, struct cpu_info, verw_sel);
#  154|       OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
#  155|->     OFFSET(CPUINFO_per_cpu_offset, struct cpu_info, per_cpu_offset);
#  156|       OFFSET(CPUINFO_cr4, struct cpu_info, cr4);
#  157|       OFFSET(CPUINFO_xen_cr3, struct cpu_info, xen_cr3);

Error: COMPILER_WARNING: [#def1359]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:156: Error: symbol `.ascii' is already defined
#  154|       OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
#  155|       OFFSET(CPUINFO_per_cpu_offset, struct cpu_info, per_cpu_offset);
#  156|->     OFFSET(CPUINFO_cr4, struct cpu_info, cr4);
#  157|       OFFSET(CPUINFO_xen_cr3, struct cpu_info, xen_cr3);
#  158|       OFFSET(CPUINFO_pv_cr3, struct cpu_info, pv_cr3);

Error: COMPILER_WARNING: [#def1360]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:157: Error: symbol `.ascii' is already defined
#  155|       OFFSET(CPUINFO_per_cpu_offset, struct cpu_info, per_cpu_offset);
#  156|       OFFSET(CPUINFO_cr4, struct cpu_info, cr4);
#  157|->     OFFSET(CPUINFO_xen_cr3, struct cpu_info, xen_cr3);
#  158|       OFFSET(CPUINFO_pv_cr3, struct cpu_info, pv_cr3);
#  159|       OFFSET(CPUINFO_shadow_spec_ctrl, struct cpu_info, shadow_spec_ctrl);

Error: COMPILER_WARNING: [#def1361]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:158: Error: symbol `.ascii' is already defined
#  156|       OFFSET(CPUINFO_cr4, struct cpu_info, cr4);
#  157|       OFFSET(CPUINFO_xen_cr3, struct cpu_info, xen_cr3);
#  158|->     OFFSET(CPUINFO_pv_cr3, struct cpu_info, pv_cr3);
#  159|       OFFSET(CPUINFO_shadow_spec_ctrl, struct cpu_info, shadow_spec_ctrl);
#  160|       OFFSET(CPUINFO_xen_spec_ctrl, struct cpu_info, xen_spec_ctrl);

Error: COMPILER_WARNING: [#def1362]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:159: Error: symbol `.ascii' is already defined
#  157|       OFFSET(CPUINFO_xen_cr3, struct cpu_info, xen_cr3);
#  158|       OFFSET(CPUINFO_pv_cr3, struct cpu_info, pv_cr3);
#  159|->     OFFSET(CPUINFO_shadow_spec_ctrl, struct cpu_info, shadow_spec_ctrl);
#  160|       OFFSET(CPUINFO_xen_spec_ctrl, struct cpu_info, xen_spec_ctrl);
#  161|       OFFSET(CPUINFO_last_spec_ctrl, struct cpu_info, last_spec_ctrl);

Error: COMPILER_WARNING: [#def1363]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:160: Error: symbol `.ascii' is already defined
#  158|       OFFSET(CPUINFO_pv_cr3, struct cpu_info, pv_cr3);
#  159|       OFFSET(CPUINFO_shadow_spec_ctrl, struct cpu_info, shadow_spec_ctrl);
#  160|->     OFFSET(CPUINFO_xen_spec_ctrl, struct cpu_info, xen_spec_ctrl);
#  161|       OFFSET(CPUINFO_last_spec_ctrl, struct cpu_info, last_spec_ctrl);
#  162|       OFFSET(CPUINFO_scf, struct cpu_info, scf);

Error: COMPILER_WARNING: [#def1364]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:161: Error: symbol `.ascii' is already defined
#  159|       OFFSET(CPUINFO_shadow_spec_ctrl, struct cpu_info, shadow_spec_ctrl);
#  160|       OFFSET(CPUINFO_xen_spec_ctrl, struct cpu_info, xen_spec_ctrl);
#  161|->     OFFSET(CPUINFO_last_spec_ctrl, struct cpu_info, last_spec_ctrl);
#  162|       OFFSET(CPUINFO_scf, struct cpu_info, scf);
#  163|       OFFSET(CPUINFO_root_pgt_changed, struct cpu_info, root_pgt_changed);

Error: COMPILER_WARNING: [#def1365]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:162: Error: symbol `.ascii' is already defined
#  160|       OFFSET(CPUINFO_xen_spec_ctrl, struct cpu_info, xen_spec_ctrl);
#  161|       OFFSET(CPUINFO_last_spec_ctrl, struct cpu_info, last_spec_ctrl);
#  162|->     OFFSET(CPUINFO_scf, struct cpu_info, scf);
#  163|       OFFSET(CPUINFO_root_pgt_changed, struct cpu_info, root_pgt_changed);
#  164|       OFFSET(CPUINFO_use_pv_cr3, struct cpu_info, use_pv_cr3);

Error: COMPILER_WARNING: [#def1366]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:163: Error: symbol `.ascii' is already defined
#  161|       OFFSET(CPUINFO_last_spec_ctrl, struct cpu_info, last_spec_ctrl);
#  162|       OFFSET(CPUINFO_scf, struct cpu_info, scf);
#  163|->     OFFSET(CPUINFO_root_pgt_changed, struct cpu_info, root_pgt_changed);
#  164|       OFFSET(CPUINFO_use_pv_cr3, struct cpu_info, use_pv_cr3);
#  165|       DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));

Error: COMPILER_WARNING: [#def1367]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:164: Error: symbol `.ascii' is already defined
#  162|       OFFSET(CPUINFO_scf, struct cpu_info, scf);
#  163|       OFFSET(CPUINFO_root_pgt_changed, struct cpu_info, root_pgt_changed);
#  164|->     OFFSET(CPUINFO_use_pv_cr3, struct cpu_info, use_pv_cr3);
#  165|       DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
#  166|       BLANK();

Error: COMPILER_WARNING: [#def1368]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:165: Error: symbol `.ascii' is already defined
#  163|       OFFSET(CPUINFO_root_pgt_changed, struct cpu_info, root_pgt_changed);
#  164|       OFFSET(CPUINFO_use_pv_cr3, struct cpu_info, use_pv_cr3);
#  165|->     DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
#  166|       BLANK();
#  167|   

Error: COMPILER_WARNING: [#def1369]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:166: Error: symbol `.ascii' is already defined
#  164|       OFFSET(CPUINFO_use_pv_cr3, struct cpu_info, use_pv_cr3);
#  165|       DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
#  166|->     BLANK();
#  167|   
#  168|   #ifdef CONFIG_PV

Error: COMPILER_WARNING: [#def1370]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:167: Error: symbol `.ascii' is already defined
#  165|       DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
#  166|       BLANK();
#  167|-> 
#  168|   #ifdef CONFIG_PV
#  169|       OFFSET(TRAPINFO_eip, struct trap_info, address);

Error: COMPILER_WARNING: [#def1371]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:170: Error: symbol `.ascii' is already defined
#  168|   #ifdef CONFIG_PV
#  169|       OFFSET(TRAPINFO_eip, struct trap_info, address);
#  170|->     OFFSET(TRAPINFO_cs, struct trap_info, cs);
#  171|       OFFSET(TRAPINFO_flags, struct trap_info, flags);
#  172|       DEFINE(TRAPINFO_sizeof, sizeof(struct trap_info));

Error: COMPILER_WARNING: [#def1372]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:171: Error: symbol `.ascii' is already defined
#  169|       OFFSET(TRAPINFO_eip, struct trap_info, address);
#  170|       OFFSET(TRAPINFO_cs, struct trap_info, cs);
#  171|->     OFFSET(TRAPINFO_flags, struct trap_info, flags);
#  172|       DEFINE(TRAPINFO_sizeof, sizeof(struct trap_info));
#  173|       BLANK();

Error: COMPILER_WARNING: [#def1373]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:172: Error: symbol `.ascii' is already defined
#  170|       OFFSET(TRAPINFO_cs, struct trap_info, cs);
#  171|       OFFSET(TRAPINFO_flags, struct trap_info, flags);
#  172|->     DEFINE(TRAPINFO_sizeof, sizeof(struct trap_info));
#  173|       BLANK();
#  174|   

Error: COMPILER_WARNING: [#def1374]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:173: Error: symbol `.ascii' is already defined
#  171|       OFFSET(TRAPINFO_flags, struct trap_info, flags);
#  172|       DEFINE(TRAPINFO_sizeof, sizeof(struct trap_info));
#  173|->     BLANK();
#  174|   
#  175|       OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);

Error: COMPILER_WARNING: [#def1375]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:174: Error: symbol `.ascii' is already defined
#  172|       DEFINE(TRAPINFO_sizeof, sizeof(struct trap_info));
#  173|       BLANK();
#  174|-> 
#  175|       OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
#  176|       OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);

Error: COMPILER_WARNING: [#def1376]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:176: Error: symbol `.ascii' is already defined
#  174|   
#  175|       OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
#  176|->     OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
#  177|       OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
#  178|       OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);

Error: COMPILER_WARNING: [#def1377]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:177: Error: symbol `.ascii' is already defined
#  175|       OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
#  176|       OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
#  177|->     OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
#  178|       OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
#  179|       BLANK();

Error: COMPILER_WARNING: [#def1378]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:178: Error: symbol `.ascii' is already defined
#  176|       OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
#  177|       OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
#  178|->     OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
#  179|       BLANK();
#  180|   #endif

Error: COMPILER_WARNING: [#def1379]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:179: Error: symbol `.ascii' is already defined
#  177|       OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
#  178|       OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
#  179|->     BLANK();
#  180|   #endif
#  181|   

Error: COMPILER_WARNING: [#def1380]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:180: Error: symbol `.ascii' is already defined
#  178|       OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
#  179|       BLANK();
#  180|-> #endif
#  181|   
#  182|       OFFSET(VCPUMSR_spec_ctrl_raw, struct vcpu_msrs, spec_ctrl.raw);

Error: COMPILER_WARNING: [#def1381]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:183: Error: symbol `.ascii' is already defined
#  181|   
#  182|       OFFSET(VCPUMSR_spec_ctrl_raw, struct vcpu_msrs, spec_ctrl.raw);
#  183|->     BLANK();
#  184|   
#  185|   #ifdef CONFIG_PERF_COUNTERS

Error: COMPILER_WARNING: [#def1382]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:184: Error: symbol `.ascii' is already defined
#  182|       OFFSET(VCPUMSR_spec_ctrl_raw, struct vcpu_msrs, spec_ctrl.raw);
#  183|       BLANK();
#  184|-> 
#  185|   #ifdef CONFIG_PERF_COUNTERS
#  186|       DEFINE(ASM_PERFC_exceptions, PERFC_exceptions);

Error: COMPILER_WARNING: [#def1383]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:191: Error: symbol `.ascii' is already defined
#  189|   
#  190|       DEFINE(IRQSTAT_shift, ilog2(sizeof(irq_cpustat_t)));
#  191|->     OFFSET(IRQSTAT_softirq_pending, irq_cpustat_t, __softirq_pending);
#  192|       BLANK();
#  193|   

Error: COMPILER_WARNING: [#def1384]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:192: Error: symbol `.ascii' is already defined
#  190|       DEFINE(IRQSTAT_shift, ilog2(sizeof(irq_cpustat_t)));
#  191|       OFFSET(IRQSTAT_softirq_pending, irq_cpustat_t, __softirq_pending);
#  192|->     BLANK();
#  193|   
#  194|       OFFSET(CPUINFO_features, struct cpuinfo_x86, x86_capability);

Error: COMPILER_WARNING: [#def1385]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:193: Error: symbol `.ascii' is already defined
#  191|       OFFSET(IRQSTAT_softirq_pending, irq_cpustat_t, __softirq_pending);
#  192|       BLANK();
#  193|-> 
#  194|       OFFSET(CPUINFO_features, struct cpuinfo_x86, x86_capability);
#  195|       BLANK();

Error: COMPILER_WARNING: [#def1386]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:195: Error: symbol `.ascii' is already defined
#  193|   
#  194|       OFFSET(CPUINFO_features, struct cpuinfo_x86, x86_capability);
#  195|->     BLANK();
#  196|   
#  197|       OFFSET(MB_flags, multiboot_info_t, flags);

Error: COMPILER_WARNING: [#def1387]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:196: Error: symbol `.ascii' is already defined
#  194|       OFFSET(CPUINFO_features, struct cpuinfo_x86, x86_capability);
#  195|       BLANK();
#  196|-> 
#  197|       OFFSET(MB_flags, multiboot_info_t, flags);
#  198|       OFFSET(MB_cmdline, multiboot_info_t, cmdline);

Error: COMPILER_WARNING: [#def1388]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:198: Error: symbol `.ascii' is already defined
#  196|   
#  197|       OFFSET(MB_flags, multiboot_info_t, flags);
#  198|->     OFFSET(MB_cmdline, multiboot_info_t, cmdline);
#  199|       OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
#  200|       BLANK();

Error: COMPILER_WARNING: [#def1389]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:199: Error: symbol `.ascii' is already defined
#  197|       OFFSET(MB_flags, multiboot_info_t, flags);
#  198|       OFFSET(MB_cmdline, multiboot_info_t, cmdline);
#  199|->     OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
#  200|       BLANK();
#  201|   

Error: COMPILER_WARNING: [#def1390]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:200: Error: symbol `.ascii' is already defined
#  198|       OFFSET(MB_cmdline, multiboot_info_t, cmdline);
#  199|       OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
#  200|->     BLANK();
#  201|   
#  202|       DEFINE(MB2_fixed_sizeof, sizeof(multiboot2_fixed_t));

Error: COMPILER_WARNING: [#def1391]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:201: Error: symbol `.ascii' is already defined
#  199|       OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
#  200|       BLANK();
#  201|-> 
#  202|       DEFINE(MB2_fixed_sizeof, sizeof(multiboot2_fixed_t));
#  203|       OFFSET(MB2_fixed_total_size, multiboot2_fixed_t, total_size);

Error: COMPILER_WARNING: [#def1392]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:203: Error: symbol `.ascii' is already defined
#  201|   
#  202|       DEFINE(MB2_fixed_sizeof, sizeof(multiboot2_fixed_t));
#  203|->     OFFSET(MB2_fixed_total_size, multiboot2_fixed_t, total_size);
#  204|       OFFSET(MB2_tag_type, multiboot2_tag_t, type);
#  205|       OFFSET(MB2_tag_size, multiboot2_tag_t, size);

Error: COMPILER_WARNING: [#def1393]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:204: Error: symbol `.ascii' is already defined
#  202|       DEFINE(MB2_fixed_sizeof, sizeof(multiboot2_fixed_t));
#  203|       OFFSET(MB2_fixed_total_size, multiboot2_fixed_t, total_size);
#  204|->     OFFSET(MB2_tag_type, multiboot2_tag_t, type);
#  205|       OFFSET(MB2_tag_size, multiboot2_tag_t, size);
#  206|       OFFSET(MB2_load_base_addr, multiboot2_tag_load_base_addr_t, load_base_addr);

Error: COMPILER_WARNING: [#def1394]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:205: Error: symbol `.ascii' is already defined
#  203|       OFFSET(MB2_fixed_total_size, multiboot2_fixed_t, total_size);
#  204|       OFFSET(MB2_tag_type, multiboot2_tag_t, type);
#  205|->     OFFSET(MB2_tag_size, multiboot2_tag_t, size);
#  206|       OFFSET(MB2_load_base_addr, multiboot2_tag_load_base_addr_t, load_base_addr);
#  207|       OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower);

Error: COMPILER_WARNING: [#def1395]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:206: Error: symbol `.ascii' is already defined
#  204|       OFFSET(MB2_tag_type, multiboot2_tag_t, type);
#  205|       OFFSET(MB2_tag_size, multiboot2_tag_t, size);
#  206|->     OFFSET(MB2_load_base_addr, multiboot2_tag_load_base_addr_t, load_base_addr);
#  207|       OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower);
#  208|       OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer);

Error: COMPILER_WARNING: [#def1396]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:207: Error: symbol `.ascii' is already defined
#  205|       OFFSET(MB2_tag_size, multiboot2_tag_t, size);
#  206|       OFFSET(MB2_load_base_addr, multiboot2_tag_load_base_addr_t, load_base_addr);
#  207|->     OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower);
#  208|       OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer);
#  209|       OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer);

Error: COMPILER_WARNING: [#def1397]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:208: Error: symbol `.ascii' is already defined
#  206|       OFFSET(MB2_load_base_addr, multiboot2_tag_load_base_addr_t, load_base_addr);
#  207|       OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower);
#  208|->     OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer);
#  209|       OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer);
#  210|       OFFSET(MB2_tag_string, multiboot2_tag_string_t, string);

Error: COMPILER_WARNING: [#def1398]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:209: Error: symbol `.ascii' is already defined
#  207|       OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower);
#  208|       OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer);
#  209|->     OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer);
#  210|       OFFSET(MB2_tag_string, multiboot2_tag_string_t, string);
#  211|       BLANK();

Error: COMPILER_WARNING: [#def1399]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:210: Error: symbol `.ascii' is already defined
#  208|       OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer);
#  209|       OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer);
#  210|->     OFFSET(MB2_tag_string, multiboot2_tag_string_t, string);
#  211|       BLANK();
#  212|   

Error: COMPILER_WARNING: [#def1400]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:211: Error: symbol `.ascii' is already defined
#  209|       OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer);
#  210|       OFFSET(MB2_tag_string, multiboot2_tag_string_t, string);
#  211|->     BLANK();
#  212|   
#  213|       OFFSET(DOMAIN_vm_assist, struct domain, vm_assist);

Error: COMPILER_WARNING: [#def1401]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:212: Error: symbol `.ascii' is already defined
#  210|       OFFSET(MB2_tag_string, multiboot2_tag_string_t, string);
#  211|       BLANK();
#  212|-> 
#  213|       OFFSET(DOMAIN_vm_assist, struct domain, vm_assist);
#  214|       BLANK();

Error: COMPILER_WARNING: [#def1402]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:214: Error: symbol `.ascii' is already defined
#  212|   
#  213|       OFFSET(DOMAIN_vm_assist, struct domain, vm_assist);
#  214|->     BLANK();
#  215|   
#  216|   #ifdef CONFIG_VIDEO

Error: COMPILER_WARNING: [#def1403]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:215: Error: symbol `.ascii' is already defined
#  213|       OFFSET(DOMAIN_vm_assist, struct domain, vm_assist);
#  214|       BLANK();
#  215|-> 
#  216|   #ifdef CONFIG_VIDEO
#  217|       OFFSET(BVI_cursor_pos,      struct boot_video_info, orig_x);

Error: COMPILER_WARNING: [#def1404]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:218: Error: symbol `.ascii' is already defined
#  216|   #ifdef CONFIG_VIDEO
#  217|       OFFSET(BVI_cursor_pos,      struct boot_video_info, orig_x);
#  218|->     OFFSET(BVI_video_mode,      struct boot_video_info, orig_video_mode);
#  219|       OFFSET(BVI_video_cols,      struct boot_video_info, orig_video_cols);
#  220|       OFFSET(BVI_video_lines,     struct boot_video_info, orig_video_lines);

Error: COMPILER_WARNING: [#def1405]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:219: Error: symbol `.ascii' is already defined
#  217|       OFFSET(BVI_cursor_pos,      struct boot_video_info, orig_x);
#  218|       OFFSET(BVI_video_mode,      struct boot_video_info, orig_video_mode);
#  219|->     OFFSET(BVI_video_cols,      struct boot_video_info, orig_video_cols);
#  220|       OFFSET(BVI_video_lines,     struct boot_video_info, orig_video_lines);
#  221|       OFFSET(BVI_have_vga,        struct boot_video_info, orig_video_isVGA);

Error: COMPILER_WARNING: [#def1406]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:220: Error: symbol `.ascii' is already defined
#  218|       OFFSET(BVI_video_mode,      struct boot_video_info, orig_video_mode);
#  219|       OFFSET(BVI_video_cols,      struct boot_video_info, orig_video_cols);
#  220|->     OFFSET(BVI_video_lines,     struct boot_video_info, orig_video_lines);
#  221|       OFFSET(BVI_have_vga,        struct boot_video_info, orig_video_isVGA);
#  222|       OFFSET(BVI_font_points,     struct boot_video_info, orig_video_points);

Error: COMPILER_WARNING: [#def1407]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:221: Error: symbol `.ascii' is already defined
#  219|       OFFSET(BVI_video_cols,      struct boot_video_info, orig_video_cols);
#  220|       OFFSET(BVI_video_lines,     struct boot_video_info, orig_video_lines);
#  221|->     OFFSET(BVI_have_vga,        struct boot_video_info, orig_video_isVGA);
#  222|       OFFSET(BVI_font_points,     struct boot_video_info, orig_video_points);
#  223|       OFFSET(BVI_capabilities,    struct boot_video_info, capabilities);

Error: COMPILER_WARNING: [#def1408]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:222: Error: symbol `.ascii' is already defined
#  220|       OFFSET(BVI_video_lines,     struct boot_video_info, orig_video_lines);
#  221|       OFFSET(BVI_have_vga,        struct boot_video_info, orig_video_isVGA);
#  222|->     OFFSET(BVI_font_points,     struct boot_video_info, orig_video_points);
#  223|       OFFSET(BVI_capabilities,    struct boot_video_info, capabilities);
#  224|       OFFSET(BVI_lfb_linelength,  struct boot_video_info, lfb_linelength);

Error: COMPILER_WARNING: [#def1409]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:223: Error: symbol `.ascii' is already defined
#  221|       OFFSET(BVI_have_vga,        struct boot_video_info, orig_video_isVGA);
#  222|       OFFSET(BVI_font_points,     struct boot_video_info, orig_video_points);
#  223|->     OFFSET(BVI_capabilities,    struct boot_video_info, capabilities);
#  224|       OFFSET(BVI_lfb_linelength,  struct boot_video_info, lfb_linelength);
#  225|       OFFSET(BVI_lfb_width,       struct boot_video_info, lfb_width);

Error: COMPILER_WARNING: [#def1410]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:224: Error: symbol `.ascii' is already defined
#  222|       OFFSET(BVI_font_points,     struct boot_video_info, orig_video_points);
#  223|       OFFSET(BVI_capabilities,    struct boot_video_info, capabilities);
#  224|->     OFFSET(BVI_lfb_linelength,  struct boot_video_info, lfb_linelength);
#  225|       OFFSET(BVI_lfb_width,       struct boot_video_info, lfb_width);
#  226|       OFFSET(BVI_lfb_height,      struct boot_video_info, lfb_height);

Error: COMPILER_WARNING: [#def1411]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:225: Error: symbol `.ascii' is already defined
#  223|       OFFSET(BVI_capabilities,    struct boot_video_info, capabilities);
#  224|       OFFSET(BVI_lfb_linelength,  struct boot_video_info, lfb_linelength);
#  225|->     OFFSET(BVI_lfb_width,       struct boot_video_info, lfb_width);
#  226|       OFFSET(BVI_lfb_height,      struct boot_video_info, lfb_height);
#  227|       OFFSET(BVI_lfb_depth,       struct boot_video_info, lfb_depth);

Error: COMPILER_WARNING: [#def1412]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:226: Error: symbol `.ascii' is already defined
#  224|       OFFSET(BVI_lfb_linelength,  struct boot_video_info, lfb_linelength);
#  225|       OFFSET(BVI_lfb_width,       struct boot_video_info, lfb_width);
#  226|->     OFFSET(BVI_lfb_height,      struct boot_video_info, lfb_height);
#  227|       OFFSET(BVI_lfb_depth,       struct boot_video_info, lfb_depth);
#  228|       OFFSET(BVI_lfb_base,        struct boot_video_info, lfb_base);

Error: COMPILER_WARNING: [#def1413]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:227: Error: symbol `.ascii' is already defined
#  225|       OFFSET(BVI_lfb_width,       struct boot_video_info, lfb_width);
#  226|       OFFSET(BVI_lfb_height,      struct boot_video_info, lfb_height);
#  227|->     OFFSET(BVI_lfb_depth,       struct boot_video_info, lfb_depth);
#  228|       OFFSET(BVI_lfb_base,        struct boot_video_info, lfb_base);
#  229|       OFFSET(BVI_lfb_size,        struct boot_video_info, lfb_size);

Error: COMPILER_WARNING: [#def1414]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:228: Error: symbol `.ascii' is already defined
#  226|       OFFSET(BVI_lfb_height,      struct boot_video_info, lfb_height);
#  227|       OFFSET(BVI_lfb_depth,       struct boot_video_info, lfb_depth);
#  228|->     OFFSET(BVI_lfb_base,        struct boot_video_info, lfb_base);
#  229|       OFFSET(BVI_lfb_size,        struct boot_video_info, lfb_size);
#  230|       OFFSET(BVI_lfb_colors,      struct boot_video_info, colors);

Error: COMPILER_WARNING: [#def1415]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:229: Error: symbol `.ascii' is already defined
#  227|       OFFSET(BVI_lfb_depth,       struct boot_video_info, lfb_depth);
#  228|       OFFSET(BVI_lfb_base,        struct boot_video_info, lfb_base);
#  229|->     OFFSET(BVI_lfb_size,        struct boot_video_info, lfb_size);
#  230|       OFFSET(BVI_lfb_colors,      struct boot_video_info, colors);
#  231|       OFFSET(BVI_vesapm_seg,      struct boot_video_info, vesapm.seg);

Error: COMPILER_WARNING: [#def1416]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:230: Error: symbol `.ascii' is already defined
#  228|       OFFSET(BVI_lfb_base,        struct boot_video_info, lfb_base);
#  229|       OFFSET(BVI_lfb_size,        struct boot_video_info, lfb_size);
#  230|->     OFFSET(BVI_lfb_colors,      struct boot_video_info, colors);
#  231|       OFFSET(BVI_vesapm_seg,      struct boot_video_info, vesapm.seg);
#  232|       OFFSET(BVI_vesapm_off,      struct boot_video_info, vesapm.off);

Error: COMPILER_WARNING: [#def1417]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:231: Error: symbol `.ascii' is already defined
#  229|       OFFSET(BVI_lfb_size,        struct boot_video_info, lfb_size);
#  230|       OFFSET(BVI_lfb_colors,      struct boot_video_info, colors);
#  231|->     OFFSET(BVI_vesapm_seg,      struct boot_video_info, vesapm.seg);
#  232|       OFFSET(BVI_vesapm_off,      struct boot_video_info, vesapm.off);
#  233|       OFFSET(BVI_vesa_attrib,     struct boot_video_info, vesa_attrib);

Error: COMPILER_WARNING: [#def1418]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:232: Error: symbol `.ascii' is already defined
#  230|       OFFSET(BVI_lfb_colors,      struct boot_video_info, colors);
#  231|       OFFSET(BVI_vesapm_seg,      struct boot_video_info, vesapm.seg);
#  232|->     OFFSET(BVI_vesapm_off,      struct boot_video_info, vesapm.off);
#  233|       OFFSET(BVI_vesa_attrib,     struct boot_video_info, vesa_attrib);
#  234|       DEFINE(BVI_size,            sizeof(struct boot_video_info));

Error: COMPILER_WARNING: [#def1419]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:233: Error: symbol `.ascii' is already defined
#  231|       OFFSET(BVI_vesapm_seg,      struct boot_video_info, vesapm.seg);
#  232|       OFFSET(BVI_vesapm_off,      struct boot_video_info, vesapm.off);
#  233|->     OFFSET(BVI_vesa_attrib,     struct boot_video_info, vesa_attrib);
#  234|       DEFINE(BVI_size,            sizeof(struct boot_video_info));
#  235|       BLANK();

Error: COMPILER_WARNING: [#def1420]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:234: Error: symbol `.ascii' is already defined
#  232|       OFFSET(BVI_vesapm_off,      struct boot_video_info, vesapm.off);
#  233|       OFFSET(BVI_vesa_attrib,     struct boot_video_info, vesa_attrib);
#  234|->     DEFINE(BVI_size,            sizeof(struct boot_video_info));
#  235|       BLANK();
#  236|   #endif /* CONFIG_VIDEO */

Error: COMPILER_WARNING: [#def1421]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:235: Error: symbol `.ascii' is already defined
#  233|       OFFSET(BVI_vesa_attrib,     struct boot_video_info, vesa_attrib);
#  234|       DEFINE(BVI_size,            sizeof(struct boot_video_info));
#  235|->     BLANK();
#  236|   #endif /* CONFIG_VIDEO */
#  237|   }

Error: COMPILER_WARNING: [#def1422]
xen-4.20.2/xen/arch/x86/x86_64/asm-offsets.c:236: Error: symbol `.ascii' is already defined
#  234|       DEFINE(BVI_size,            sizeof(struct boot_video_info));
#  235|       BLANK();
#  236|-> #endif /* CONFIG_VIDEO */
#  237|   }

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1423]
xen-4.20.2/xen/arch/x86/x86_64/mm.c:727:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/xen/arch/x86/x86_64/mm.c:717:13: enter_function: entry to ‘zap_low_mappings’
xen-4.20.2/xen/arch/x86/x86_64/mm.c:719:5: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/x86_64/mm.c:722:5: call_function: inlined call to ‘write_u64_atomic’ from ‘zap_low_mappings’
xen-4.20.2/xen/arch/x86/x86_64/mm.c:727:22: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
#  725|       /* Replace with mapping of the boot trampoline only. */
#  726|       map_pages_to_xen(trampoline_phys, maddr_to_mfn(trampoline_phys),
#  727|->                      PFN_UP(trampoline_end - trampoline_start),
#  728|                        __PAGE_HYPERVISOR_RX);
#  729|   }

Error: CPPCHECK_WARNING (CWE-758): [#def1424]
xen-4.20.2/xen/arch/x86/x86_emulate/0f01.c:294: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
#  292|                                 &base, mode_64bit() ? 8 : 4, ctxt, ops)) )
#  293|               goto done;
#  294|->         generate_exception_if(!is_canonical_address(base), X86_EXC_GP, 0);
#  295|           sreg.base = base;
#  296|           sreg.limit = limit;

Error: CPPCHECK_WARNING (CWE-758): [#def1425]
xen-4.20.2/xen/arch/x86/x86_emulate/0fae.c:193: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
#  191|               {
#  192|                   sreg.base = *dst->reg;
#  193|->                 generate_exception_if(!is_canonical_address(sreg.base),
#  194|                                         X86_EXC_GP, 0);
#  195|               }

Error: CPPCHECK_WARNING (CWE-758): [#def1426]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:1015: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 1013|               if ( (desc_hi.b & 0x00001f00) ||
# 1014|                    (seg != x86_seg_none &&
# 1015|->                   !is_canonical_address((uint64_t)desc_hi.a << 32)) )
# 1016|                   goto raise_exn;
# 1017|           }

Error: CPPCHECK_WARNING (CWE-758): [#def1427]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:2055: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 2053|           if ( (rc = ops->read_segment(x86_seg_cs, &sreg, ctxt)) ||
# 2054|                (rc = load_seg(x86_seg_cs, imm2, 0, &cs, ctxt, ops)) ||
# 2055|->              (validate_far_branch(&cs, imm1),
# 2056|                 src.val = sreg.sel,
# 2057|                 rc = ops->write(x86_seg_ss, sp_pre_dec(op_bytes),

Error: CPPCHECK_WARNING (CWE-758): [#def1428]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:2385: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 2383|                                 &src.val, op_bytes, ctxt, ops)) ||
# 2384|                (rc = load_seg(x86_seg_cs, src.val, 1, &cs, ctxt, ops)) ||
# 2385|->              (rc = commit_far_branch(&cs, dst.val)) )
# 2386|               goto done;
# 2387|           break;

Error: CPPCHECK_WARNING (CWE-758): [#def1429]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:2560: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 2558|       far_jmp:
# 2559|           if ( (rc = load_seg(x86_seg_cs, imm2, 0, &cs, ctxt, ops)) ||
# 2560|->              (rc = commit_far_branch(&cs, imm1)) )
# 2561|               goto done;
# 2562|           break;

Error: CPPCHECK_WARNING (CWE-758): [#def1430]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:3105: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 3103|            * XSA-7 (CVE-2012-0217).
# 3104|            */
# 3105|->         generate_exception_if(cp->x86_vendor == X86_VENDOR_INTEL &&
# 3106|                                 op_bytes == 8 && !is_canonical_address(_regs.rcx),
# 3107|                                 X86_EXC_GP, 0);

Error: CPPCHECK_WARNING (CWE-758): [#def1431]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:3905: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 3903|   
# 3904|           generate_exception_if(!(msr_val & 0xfffc), X86_EXC_GP, 0);
# 3905|->         generate_exception_if(op_bytes == 8 &&
# 3906|                                 (!is_canonical_address(_regs.r(dx)) ||
# 3907|                                  !is_canonical_address(_regs.r(cx))),

Error: CPPCHECK_WARNING (CWE-758): [#def1432]
xen-4.20.2/xen/arch/x86/x86_emulate/x86_emulate.c:6277: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
# 6275|           {
# 6276|           case X86_INVPCID_INDIV_ADDR:
# 6277|->              generate_exception_if(!is_canonical_address(mmvalp->xmm[1]),
# 6278|                                      X86_EXC_GP, 0);
# 6279|                /* fall through */

Error: GCC_ANALYZER_WARNING (CWE-1335): [#def1433]
xen-4.20.2/xen/common/bunzip2.c:140:55: warning[-Wanalyzer-shift-count-overflow]: shift by count (‘32’) >= precision of type (‘32’)
xen-4.20.2/xen/common/bunzip2.c:518:19: enter_function: entry to ‘read_bunzip’
xen-4.20.2/xen/common/bunzip2.c:524:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/bunzip2.c:528:9: branch_false: ...to here
xen-4.20.2/xen/common/bunzip2.c:536:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/bunzip2.c:605:20: branch_false: ...to here
xen-4.20.2/xen/common/bunzip2.c:605:20: call_function: calling ‘get_next_block’ from ‘read_bunzip’
#  138|   	/* Calculate result */
#  139|   	bd->inbufBitCount -= bits_wanted;
#  140|-> 	bits |= (bd->inbufBits >> bd->inbufBitCount)&((1 << bits_wanted)-1);
#  141|   
#  142|   	return bits;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1434]
xen-4.20.2/xen/common/domain.c:753:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘config’
xen-4.20.2/xen/common/domain.c:887:13: enter_function: entry to ‘setup_system_domains’
xen-4.20.2/xen/common/domain.c:896:15: call_function: calling ‘domain_create’ from ‘setup_system_domains’
#  751|       {
#  752|           err = -ENOMEM;
#  753|->         d->vcpu = xzalloc_array(struct vcpu *, config->max_vcpus);
#  754|           if ( !d->vcpu )
#  755|               goto fail;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1435]
xen-4.20.2/xen/common/domain.c:813:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘config’
xen-4.20.2/xen/common/domain.c:887:13: enter_function: entry to ‘setup_system_domains’
xen-4.20.2/xen/common/domain.c:896:15: call_function: calling ‘domain_create’ from ‘setup_system_domains’
#  811|       atomic_inc(&d->pause_count);
#  812|   
#  813|->     if ( (err = evtchn_init(d, config->max_evtchn_port)) != 0 )
#  814|           goto fail;
#  815|       init_status |= INIT_evtchn;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1436]
xen-4.20.2/xen/common/domctl.c:75:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:543:15: call_function: inlined call to ‘xsm_getdomaininfo’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:547:9: call_function: calling ‘getdomaininfo’ from ‘do_domctl’
#   73|       memset(info, 0, sizeof(*info));
#   74|   
#   75|->     info->domain = d->domain_id;
#   76|       info->max_vcpu_id = XEN_INVALID_MAX_VCPU_ID;
#   77|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1437]
xen-4.20.2/xen/common/domctl.c:227:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:827:17: call_function: calling ‘vnuma_init’ from ‘do_domctl’
#  225|       nr_vnodes = uinfo->nr_vnodes;
#  226|   
#  227|->     if ( uinfo->nr_vcpus != d->max_vcpus || uinfo->pad != 0 )
#  228|           return ERR_PTR(ret);
#  229|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1438]
xen-4.20.2/xen/common/domctl.c:351:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:350:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:351:23: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:351:23: danger: dereference of NULL ‘d’
#  349|           ret = -EINVAL;
#  350|           if ( (d == current->domain) || /* no domain_pause() */
#  351|->              (vcpu >= d->max_vcpus) || ((v = d->vcpu[vcpu]) == NULL) )
#  352|               break;
#  353|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1439]
xen-4.20.2/xen/common/domctl.c:465:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:464:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:465:22: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:465:22: danger: dereference of NULL ‘d’
#  463|           ret = -EINVAL;
#  464|           if ( (d == current->domain) || /* no domain_pause() */
#  465|->              (max != d->max_vcpus) )   /* max_vcpus set up in createdomain */
#  466|               break;
#  467|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1440]
xen-4.20.2/xen/common/domctl.c:559:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:559:40: danger: dereference of NULL ‘d’
#  557|   
#  558|           ret = -EINVAL;
#  559|->         if ( op->u.vcpucontext.vcpu >= d->max_vcpus ||
#  560|                (v = d->vcpu[op->u.vcpucontext.vcpu]) == NULL ||
#  561|                v == current ) /* no vcpu_pause() */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1441]
xen-4.20.2/xen/common/domctl.c:608:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:608:40: danger: dereference of NULL ‘d’
#  606|   
#  607|           ret = -EINVAL;
#  608|->         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
#  609|               break;
#  610|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1442]
xen-4.20.2/xen/common/domctl.c:637:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:637:9: danger: dereference of NULL ‘d’
#  635|            * the meantime, while tot > max, all new allocations are disallowed.
#  636|            */
#  637|->         d->max_pages = min(new_max, (uint64_t)(typeof(d->max_pages))-1);
#  638|           nrspin_unlock(&d->page_alloc_lock);
#  639|           break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1443]
xen-4.20.2/xen/common/domctl.c:643:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:643:9: danger: dereference of NULL ‘d’
#  641|   
#  642|       case XEN_DOMCTL_setdomainhandle:
#  643|->         memcpy(d->handle, op->u.setdomainhandle.handle,
#  644|                  sizeof(xen_domain_handle_t));
#  645|           break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1444]
xen-4.20.2/xen/common/domctl.c:653:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:648:14: call_function: inlined call to ‘get_cpu_info’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:648:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:652:13: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:653:13: danger: dereference of NULL ‘d’
#  651|           {
#  652|               domain_pause(d);
#  653|->             d->debugger_attached = !!op->u.setdebugging.enable;
#  654|               domain_unpause(d); /* causes guest to latch new status */
#  655|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1445]
xen-4.20.2/xen/common/domctl.c:775:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:771:12: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
xen-4.20.2/xen/common/domctl.c:775:12: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:775:12: branch_false: following ‘false’ branch (when ‘d != e’)...
xen-4.20.2/xen/common/domctl.c:775:27: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:775:27: danger: dereference of NULL ‘d’
#  773|   
#  774|           ret = -EINVAL;
#  775|->         if ( (d == e) || (d->target != NULL) )
#  776|           {
#  777|               put_domain(e);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1446]
xen-4.20.2/xen/common/domctl.c:796:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:796:9: danger: dereference of NULL ‘d’
#  794|   
#  795|       case XEN_DOMCTL_subscribe:
#  796|->         d->suspend_evtchn = op->u.subscribe.port;
#  797|           break;
#  798|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1447]
xen-4.20.2/xen/common/grant_table.c:2219:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘raw_shah’
xen-4.20.2/xen/common/compat/grant_table.c:63:5: enter_function: entry to ‘compat_grant_table_op’
xen-4.20.2/xen/common/compat/grant_table.c:138:16: call_function: calling ‘do_grant_table_op’ from ‘compat_grant_table_op’
# 2217|       /* This call also ensures the above check cannot be passed speculatively */
# 2218|       raw_shah = (uint32_t *)shared_entry_header(rgt, ref);
# 2219|->     scombo.raw = ACCESS_ONCE(*raw_shah);
# 2220|   
# 2221|       for ( ; ; )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1448]
xen-4.20.2/xen/common/grant_table.c:4325:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sha’
xen-4.20.2/xen/common/grant_table.c:4288:13: enter_function: entry to ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4298:5: call_function: inlined call to ‘grant_read_lock’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4298:5: call_function: inlined call to ‘grant_read_lock’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4307:20: branch_true: following ‘true’ branch (when ‘ref != nr_ents’)...
xen-4.20.2/xen/common/grant_table.c:4314:15: call_function: inlined call to ‘active_entry_acquire’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4315:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/grant_table.c:4321:15: branch_false: ...to here
xen-4.20.2/xen/common/grant_table.c:4321:15: call_function: calling ‘shared_entry_header’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4321:15: return_function: return of NULL to ‘gnttab_usage_print’ from ‘shared_entry_header’
xen-4.20.2/xen/common/grant_table.c:4323:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/grant_table.c:4325:13: branch_true: ...to here
xen-4.20.2/xen/common/grant_table.c:4325:13: danger: dereference of NULL ‘sha’
# 4323|           if ( gt->gt_version == 1 )
# 4324|           {
# 4325|->             status = sha->flags;
# 4326|               frame = shared_entry_v1(gt, ref).frame;
# 4327|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1449]
xen-4.20.2/xen/common/grant_table.c:4339:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sha’
xen-4.20.2/xen/common/grant_table.c:4288:13: enter_function: entry to ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4298:5: call_function: inlined call to ‘grant_read_lock’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4298:5: call_function: inlined call to ‘grant_read_lock’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4307:20: branch_true: following ‘true’ branch (when ‘ref != nr_ents’)...
xen-4.20.2/xen/common/grant_table.c:4314:15: call_function: inlined call to ‘active_entry_acquire’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4321:15: call_function: calling ‘shared_entry_header’ from ‘gnttab_usage_print’
xen-4.20.2/xen/common/grant_table.c:4321:15: return_function: return of NULL to ‘gnttab_usage_print’ from ‘shared_entry_header’
xen-4.20.2/xen/common/grant_table.c:4323:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/grant_table.c:4330:21: branch_false: ...to here
xen-4.20.2/xen/common/grant_table.c:4339:16: danger: dereference of NULL ‘sha’
# 4337|           printk("[0x%03x]  %5d 0x%"PRI_mfn" 0x%08x      %5d 0x%06"PRIx64" 0x%02x\n",
# 4338|                  ref, act->domid, mfn_x(act->mfn), act->pin,
# 4339|->                sha->domid, frame, status);
# 4340|           active_entry_release(act);
# 4341|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1450]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:182:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  180|       {
#  181|       case XEN_ELFNOTE_LOADER:
#  182|->         safe_strcpy(parms->loader, str);
#  183|           break;
#  184|       case XEN_ELFNOTE_GUEST_OS:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1451]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:185:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  183|           break;
#  184|       case XEN_ELFNOTE_GUEST_OS:
#  185|->         safe_strcpy(parms->guest_os, str);
#  186|           break;
#  187|       case XEN_ELFNOTE_GUEST_VERSION:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1452]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:188:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  186|           break;
#  187|       case XEN_ELFNOTE_GUEST_VERSION:
#  188|->         safe_strcpy(parms->guest_ver, str);
#  189|           break;
#  190|       case XEN_ELFNOTE_XEN_VERSION:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1453]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:191:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  189|           break;
#  190|       case XEN_ELFNOTE_XEN_VERSION:
#  191|->         safe_strcpy(parms->xen_ver, str);
#  192|           break;
#  193|       case XEN_ELFNOTE_PAE_MODE:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1454]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:194:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch (when ‘i < count’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#argument 1 of ‘__builtin_strcmp’ must be non-null
#  192|           break;
#  193|       case XEN_ELFNOTE_PAE_MODE:
#  194|->         if ( !strcmp(str, "yes") )
#  195|               parms->pae = XEN_PAE_EXTCR3;
#  196|           if ( strstr(str, "bimodal") )

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1455]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:194:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  192|           break;
#  193|       case XEN_ELFNOTE_PAE_MODE:
#  194|->         if ( !strcmp(str, "yes") )
#  195|               parms->pae = XEN_PAE_EXTCR3;
#  196|           if ( strstr(str, "bimodal") )

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1456]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:200:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch (when ‘i < count’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#argument 1 of ‘__builtin_strcmp’ must be non-null
#  198|           break;
#  199|       case XEN_ELFNOTE_BSD_SYMTAB:
#  200|->         if ( !strcmp(str, "yes") )
#  201|               parms->bsd_symtab = 1;
#  202|           break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1457]
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:200:15: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:560:17: enter_function: entry to ‘elf_xen_parse’
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:614:8: branch_true: following ‘true’ branch (when ‘xen_elfnotes == 0’)...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:616:17: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:617:22: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:619:20: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:620:16: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:624:18: branch_true: ...to here
xen-4.20.2/xen/common/libelf/libelf-dominfo.c:627:26: call_function: calling ‘elf_xen_parse_notes’ from ‘elf_xen_parse’
#  198|           break;
#  199|       case XEN_ELFNOTE_BSD_SYMTAB:
#  200|->         if ( !strcmp(str, "yes") )
#  201|               parms->bsd_symtab = 1;
#  202|           break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1458]
xen-4.20.2/xen/common/libelf/libelf-loader.c:122:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xen-4.20.2/xen/common/libelf/libelf-loader.c:116:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/libelf/libelf-loader.c:118:8: branch_false: ...to here
xen-4.20.2/xen/common/libelf/libelf-loader.c:121:5: acquire_resource: ‘va_start’ called here
xen-4.20.2/xen/common/libelf/libelf-loader.c:122:5: throw: if the called function throws an exception...
xen-4.20.2/xen/common/libelf/libelf-loader.c:122:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  120|   
#  121|       va_start(al,fmt);
#  122|->     elf->log_callback(elf, elf->log_caller_data, iserr, fmt, al);
#  123|       va_end(al);
#  124|   }

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1459]
xen-4.20.2/xen/common/percpu.c:37:35: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/xen/common/percpu.c:32:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/percpu.c:37:35: branch_false: ...to here
xen-4.20.2/xen/common/percpu.c:37:35: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
#   35|                  : -EBUSY;
#   36|   
#   37|->     if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
#   38|           return -ENOMEM;
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1460]
xen-4.20.2/xen/common/percpu.c:58:27: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#   56|       char *p = __per_cpu_start + __per_cpu_offset[cpu];
#   57|   
#   58|->     free_xenheap_pages(p, PERCPU_ORDER);
#   59|       __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
#   60|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1461]
xen-4.20.2/xen/common/rangeset.c:152:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/xen/common/rangeset.c:388:21: enter_function: entry to ‘merge’
xen-4.20.2/xen/common/rangeset.c:392:12: call_function: calling ‘rangeset_add_range’ from ‘merge’
#  150|           {
#  151|               x = first_range(r);
#  152|->             x->s = s;
#  153|           }
#  154|           else if ( (x->e < s) && ((x->e + 1) != s) )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1462]
xen-4.20.2/xen/common/rangeset.c:152:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘x’
xen-4.20.2/xen/common/rangeset.c:395:5: enter_function: entry to ‘rangeset_merge’
xen-4.20.2/xen/common/rangeset.c:397:12: call_function: calling ‘rangeset_report_ranges’ from ‘rangeset_merge’
#  150|           {
#  151|               x = first_range(r);
#  152|->             x->s = s;
#  153|           }
#  154|           else if ( (x->e < s) && ((x->e + 1) != s) )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1463]
xen-4.20.2/xen/common/rangeset.c:157:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/xen/common/rangeset.c:395:5: enter_function: entry to ‘rangeset_merge’
xen-4.20.2/xen/common/rangeset.c:397:12: call_function: calling ‘rangeset_report_ranges’ from ‘rangeset_merge’
#  155|           {
#  156|               x = next_range(r, x);
#  157|->             x->s = s;
#  158|           }
#  159|           

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1464]
xen-4.20.2/xen/common/rangeset.c:157:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘x’
xen-4.20.2/xen/common/rangeset.c:388:21: enter_function: entry to ‘merge’
xen-4.20.2/xen/common/rangeset.c:392:12: call_function: calling ‘rangeset_add_range’ from ‘merge’
#  155|           {
#  156|               x = next_range(r, x);
#  157|->             x->s = s;
#  158|           }
#  159|           

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1465]
xen-4.20.2/xen/common/rangeset.c:160:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘x’
xen-4.20.2/xen/common/rangeset.c:388:21: enter_function: entry to ‘merge’
xen-4.20.2/xen/common/rangeset.c:392:12: call_function: calling ‘rangeset_add_range’ from ‘merge’
#  158|           }
#  159|           
#  160|->         x->e = (y->e > e) ? y->e : e;
#  161|   
#  162|           for ( ; ; )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1466]
xen-4.20.2/xen/drivers/passthrough/pci.c:1534:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pdev’
xen-4.20.2/xen/drivers/passthrough/pci.c:1514:12: enter_function: entry to ‘assign_device’
xen-4.20.2/xen/drivers/passthrough/pci.c:1520:11: call_function: inlined call to ‘is_iommu_enabled’ from ‘assign_device’
xen-4.20.2/xen/drivers/passthrough/pci.c:1523:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/drivers/passthrough/pci.c:1528:31: branch_true: ...to here
xen-4.20.2/xen/drivers/passthrough/pci.c:1528:12: call_function: calling ‘pci_get_pdev’ from ‘assign_device’
xen-4.20.2/xen/drivers/passthrough/pci.c:1528:12: return_function: return of NULL to ‘assign_device’ from ‘pci_get_pdev’
xen-4.20.2/xen/drivers/passthrough/pci.c:1534:10: danger: dereference of NULL ‘pdev’
# 1532|       /* Do not allow broken devices to be assigned to guests. */
# 1533|       rc = -EBADF;
# 1534|->     if ( pdev->broken && d != hardware_domain && d != dom_io )
# 1535|           goto done;
# 1536|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1467]
xen-4.20.2/xen/drivers/passthrough/x86/hvm.c:753:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  751|   
#  752|               pirq = pirqs[i]->pirq;
#  753|->             if ( (pirq_dpci->flags & HVM_IRQ_DPCI_MAPPED) )
#  754|               {
#  755|                   rc = cb(d, pirq_dpci, arg);

Error: GCC_ANALYZER_WARNING (CWE-469): [#def1468]
xen-4.20.2/xen/drivers/vpci/vpci.c:162:22: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
xen-4.20.2/xen/drivers/vpci/vpci.c:137:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/drivers/vpci/vpci.c:144:29: branch_false: ...to here
xen-4.20.2/xen/drivers/vpci/vpci.c:149:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/drivers/vpci/vpci.c:152:5: branch_false: ...to here
xen-4.20.2/xen/drivers/vpci/vpci.c:162:22: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
#  160|   #endif
#  161|   
#  162|->     for ( i = 0; i < NUM_VPCI_INIT; i++ )
#  163|       {
#  164|           rc = __start_vpci_array[i](pdev);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1469]
xen-4.20.2/xen/include/xen/iocap.h:18:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:687:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:690:15: call_function: inlined call to ‘get_cpu_info’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:690:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:694:17: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:694:17: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:695:19: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:695:19: call_function: calling ‘iomem_permit_access’ from ‘do_domctl’
#   16|                                         unsigned long e)
#   17|   {
#   18|->     bool flush = cache_flush_permitted(d);
#   19|       int ret = rangeset_add_range(d->iomem_caps, s, e);
#   20|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1470]
xen-4.20.2/xen/include/xen/iocap.h:35:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘d’
xen-4.20.2/xen/common/domctl.c:282:6: enter_function: entry to ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:289:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:292:10: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:292:8: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:295:14: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:326:11: call_function: inlined call to ‘xsm_domctl’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:332:8: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:340:14: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:687:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:690:15: call_function: inlined call to ‘get_cpu_info’ from ‘do_domctl’
xen-4.20.2/xen/common/domctl.c:690:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/common/domctl.c:694:17: branch_true: ...to here
xen-4.20.2/xen/common/domctl.c:694:17: branch_false: following ‘false’ branch...
xen-4.20.2/xen/common/domctl.c:697:19: branch_false: ...to here
xen-4.20.2/xen/common/domctl.c:697:19: call_function: calling ‘iomem_deny_access’ from ‘do_domctl’
#   33|                                       unsigned long e)
#   34|   {
#   35|->     int ret = rangeset_remove_range(d->iomem_caps, s, e);
#   36|   
#   37|       if ( !ret && !is_iommu_enabled(d) && !cache_flush_permitted(d) )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1471]
xen-4.20.2/xen/include/xen/sched.h:1183:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/xen/arch/x86/emul-i8254.c:229:13: enter_function: entry to ‘pit_latch_count’
xen-4.20.2/xen/arch/x86/emul-i8254.c:237:28: call_function: calling ‘pit_get_count’ from ‘pit_latch_count’
# 1181|   static always_inline bool is_hvm_vcpu(const struct vcpu *v)
# 1182|   {
# 1183|->     return is_hvm_domain(v->domain);
# 1184|   }
# 1185|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1472]
xen-4.20.2/xen/include/xen/sched.h:1183:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
xen-4.20.2/xen/arch/x86/x86_64/traps.c:126:6: enter_function: entry to ‘show_registers’
xen-4.20.2/xen/arch/x86/x86_64/traps.c:131:22: branch_false: following ‘false’ branch...
xen-4.20.2/xen/arch/x86/x86_64/traps.c:133:10: call_function: inlined call to ‘get_cpu_info’ from ‘show_registers’
xen-4.20.2/xen/arch/x86/x86_64/traps.c:133:30: call_function: inlined call to ‘is_hvm_vcpu’ from ‘show_registers’
# 1181|   static always_inline bool is_hvm_vcpu(const struct vcpu *v)
# 1182|   {
# 1183|->     return is_hvm_domain(v->domain);
# 1184|   }
# 1185|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1473]
xen-4.20.2/xen/lib/list-sort.c:92:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’
xen-4.20.2/xen/lib/list-sort.c:114:6: enter_function: entry to ‘list_sort’
xen-4.20.2/xen/lib/list-sort.c:124:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/lib/list-sort.c:127:9: branch_false: ...to here
xen-4.20.2/xen/lib/list-sort.c:132:16: branch_false: following ‘false’ branch (when ‘list’ is NULL)...
xen-4.20.2/xen/lib/list-sort.c:132:16: branch_false: ...to here
xen-4.20.2/xen/lib/list-sort.c:152:23: branch_false: following ‘false’ branch (when ‘lev >= max_lev’)...
xen-4.20.2/xen/lib/list-sort.c:156:9: branch_false: ...to here
xen-4.20.2/xen/lib/list-sort.c:156:9: release_memory: ‘list’ is NULL
xen-4.20.2/xen/lib/list-sort.c:156:9: call_function: calling ‘merge_and_restore_back_links’ from ‘list_sort’
#   90|   			(*cmp)(priv, tail->next, tail->next);
#   91|   
#   92|-> 		tail->next->prev = tail;
#   93|   		tail = tail->next;
#   94|   	} while (tail->next);

Error: CPPCHECK_WARNING (CWE-457): [#def1474]
xen-4.20.2/xen/lib/x86/cpuid.c:470: error[uninitvar]: Uninitialized variable: data.leaf
#  468|           l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
#  469|   
#  470|->         switch ( data.leaf )
#  471|           {
#  472|           case 0 ... ARRAY_SIZE(p->basic.raw) - 1:

Error: CPPCHECK_WARNING (CWE-457): [#def1475]
xen-4.20.2/xen/lib/x86/msr.c:80: error[uninitvar]: Uninitialized variable: data.flags
#   78|               return -EFAULT;
#   79|   
#   80|->         if ( data.flags ) /* .flags MBZ */
#   81|           {
#   82|               rc = -EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-127): [#def1476]
xen-4.20.2/xen/tools/fixdep.c:327:30: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
xen-4.20.2/xen/tools/fixdep.c:385:5: enter_function: entry to ‘main’
xen-4.20.2/xen/tools/fixdep.c:390:12: branch_false: following ‘false’ branch (when ‘argc == 4’)...
xen-4.20.2/xen/tools/fixdep.c:393:9: branch_false: ...to here
xen-4.20.2/xen/tools/fixdep.c:397:9: call_function: calling ‘xprintf’ from ‘main’
xen-4.20.2/xen/tools/fixdep.c:397:9: return_function: returning to ‘main’ from ‘xprintf’
xen-4.20.2/xen/tools/fixdep.c:399:15: call_function: calling ‘read_file’ from ‘main’
xen-4.20.2/xen/tools/fixdep.c:399:15: return_function: returning to ‘main’ from ‘read_file’
xen-4.20.2/xen/tools/fixdep.c:400:9: call_function: calling ‘parse_dep_file’ from ‘main’
#  325|   		is_last = (*p == '\0');
#  326|   		/* Is the token we found a target name? */
#  327|-> 		is_target = (*(p-1) == ':');
#  328|   		/* Don't write any target names into the dependency file */
#  329|   		if (is_target) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def1477]
xen-4.20.2/xen/tools/kconfig/confdata.c:96:9: warning[-Wanalyzer-out-of-bounds]: buffer over-read
xen-4.20.2/xen/tools/kconfig/confdata.c:988:12: enter_function: entry to ‘conf_touch_deps’
xen-4.20.2/xen/tools/kconfig/confdata.c:1001:9: branch_true: following ‘true’ branch (when ‘i != 9973’)...
xen-4.20.2/xen/tools/kconfig/confdata.c:1001:9: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/confdata.c:1043:27: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/confdata.c:1052:38: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/confdata.c:1052:23: call_function: calling ‘conf_touch_dep’ from ‘conf_touch_deps’
#   94|   	char *p;
#   95|   
#   96|-> 	strncpy(tmp, path, sizeof(tmp));
#   97|   	tmp[sizeof(tmp) - 1] = 0;
#   98|   

Error: CPPCHECK_WARNING (CWE-404): [#def1478]
xen-4.20.2/xen/tools/kconfig/confdata.c:1090: error[resourceLeak]: Resource leak: tristate
# 1088|   		fclose(out);
# 1089|   		fclose(tristate);
# 1090|-> 		return 1;
# 1091|   	}
# 1092|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1479]
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:3643:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
# 3641|   	 * we need to put in 2 end-of-buffer characters.
# 3642|   	 */
# 3643|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 3644|   	if ( ! b->yy_ch_buf )
# 3645|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1480]
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:3643:54: warning[-Wanalyzer-malloc-leak]: leak of ‘yy_create_buffer(zconf_fopen(*file.name), 16384)’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: return_function: returning to ‘zconf_nextfile’ from ‘yy_create_buffer’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_switch_to_buffer’ from ‘zconf_nextfile’
# 3641|   	 * we need to put in 2 end-of-buffer characters.
# 3642|   	 */
# 3643|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 3644|   	if ( ! b->yy_ch_buf )
# 3645|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1481]
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:3651:16: warning[-Wanalyzer-file-leak]: leak of FILE
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: return_function: returning to ‘zconf_nextfile’ from ‘yy_create_buffer’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_switch_to_buffer’ from ‘zconf_nextfile’
# 3649|   	yy_init_buffer( b, file );
# 3650|   
# 3651|-> 	return b;
# 3652|   }
# 3653|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1482]
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:3651:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4261:6: enter_function: entry to ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: call_function: calling ‘zconf_fopen’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4269:16: return_function: returning to ‘zconf_nextfile’ from ‘zconf_fopen’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4270:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_create_buffer’ from ‘zconf_nextfile’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: return_function: returning to ‘zconf_nextfile’ from ‘yy_create_buffer’
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:4275:9: call_function: calling ‘yy_switch_to_buffer’ from ‘zconf_nextfile’
# 3649|   	yy_init_buffer( b, file );
# 3650|   
# 3651|-> 	return b;
# 3652|   }
# 3653|   

Error: CPPCHECK_WARNING (CWE-476): [#def1483]
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:3684: warning[nullPointer]: Possible null pointer dereference: b
# 3682|   	yy_flush_buffer( b );
# 3683|   
# 3684|-> 	b->yy_input_file = file;
# 3685|   	b->yy_fill_buffer = 1;
# 3686|   

Error: CPPCHECK_WARNING (CWE-476): [#def1484]
xen-4.20.2/xen/tools/kconfig/lexer.lex.c:3685: warning[nullPointer]: Possible null pointer dereference: b
# 3683|   
# 3684|   	b->yy_input_file = file;
# 3685|-> 	b->yy_fill_buffer = 1;
# 3686|   
# 3687|       /* If b is the current buffer, then yy_init_buffer was _probably_

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1485]
xen-4.20.2/xen/tools/kconfig/menu.c:851:1: warning[-Wanalyzer-malloc-leak]: leak of ‘res.s’
xen-4.20.2/xen/tools/kconfig/menu.c:840:13: enter_function: entry to ‘get_relations_str’
xen-4.20.2/xen/tools/kconfig/menu.c:843:27: call_function: calling ‘str_new’ from ‘get_relations_str’
xen-4.20.2/xen/tools/kconfig/menu.c:843:27: return_function: returning to ‘get_relations_str’ from ‘str_new’
xen-4.20.2/xen/tools/kconfig/menu.c:846:21: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/menu.c:847:17: call_function: calling ‘get_symbol_str’ from ‘get_relations_str’
xen-4.20.2/xen/tools/kconfig/menu.c:847:17: return_function: returning to ‘get_relations_str’ from ‘get_symbol_str’
xen-4.20.2/xen/tools/kconfig/menu.c:846:21: branch_true: following ‘true’ branch (when ‘sym_arr’ is non-NULL)...
xen-4.20.2/xen/tools/kconfig/menu.c:846:46: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/menu.c:846:21: branch_false: following ‘false’ branch (when ‘sym’ is NULL)...
xen-4.20.2/xen/tools/kconfig/menu.c:848:12: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/menu.c:848:12: branch_false: following ‘false’ branch (when ‘i != 0’)...
xen-4.20.2/xen/tools/kconfig/menu.c:850:16: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/menu.c:851:1: danger: ‘res.s’ leaks here; was allocated at [(47)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/46)
#  849|   		str_append(&res, "No matches found.\n");
#  850|   	return res;
#  851|-> }
#  852|   
#  853|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1486]
xen-4.20.2/xen/tools/kconfig/symbol.c:1073:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘prop’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1071|   		}
# 1072|   		if (stack->sym == last_sym)
# 1073|-> 			fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
# 1074|   				prop->file->name, prop->lineno);
# 1075|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1487]
xen-4.20.2/xen/tools/kconfig/symbol.c:1080:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1078|   				menu->file->name, menu->lineno,
# 1079|   				sym->name ? sym->name : "<choice>",
# 1080|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1081|   		} else if (sym_is_choice_value(sym)) {
# 1082|   			fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1488]
xen-4.20.2/xen/tools/kconfig/symbol.c:1085:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1083|   				menu->file->name, menu->lineno,
# 1084|   				sym->name ? sym->name : "<choice>",
# 1085|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1086|   		} else if (stack->expr == &sym->dir_dep.expr) {
# 1087|   			fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1489]
xen-4.20.2/xen/tools/kconfig/symbol.c:1090:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1088|   				prop->file->name, prop->lineno,
# 1089|   				sym->name ? sym->name : "<choice>",
# 1090|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1091|   		} else if (stack->expr == &sym->rev_dep.expr) {
# 1092|   			fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1490]
xen-4.20.2/xen/tools/kconfig/symbol.c:1095:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1093|   				prop->file->name, prop->lineno,
# 1094|   				sym->name ? sym->name : "<choice>",
# 1095|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1096|   		} else if (stack->expr == &sym->implied.expr) {
# 1097|   			fprintf(stderr, "%s:%d:\tsymbol %s is implied by %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1491]
xen-4.20.2/xen/tools/kconfig/symbol.c:1100:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1098|   				prop->file->name, prop->lineno,
# 1099|   				sym->name ? sym->name : "<choice>",
# 1100|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1101|   		} else if (stack->expr) {
# 1102|   			fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1492]
xen-4.20.2/xen/tools/kconfig/symbol.c:1106:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1104|   				sym->name ? sym->name : "<choice>",
# 1105|   				prop_get_type_name(prop->type),
# 1106|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1107|   		} else {
# 1108|   			fprintf(stderr, "%s:%d:\tsymbol %s %s is visible depending on %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1493]
xen-4.20.2/xen/tools/kconfig/symbol.c:1112:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next_sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1110|   				sym->name ? sym->name : "<choice>",
# 1111|   				prop_get_type_name(prop->type),
# 1112|-> 				next_sym->name ? next_sym->name : "<choice>");
# 1113|   		}
# 1114|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1494]
xen-4.20.2/xen/tools/kconfig/symbol.c:1218:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1254:13: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1254:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1257:13: call_function: inlined call to ‘sym_is_choice_value’ from ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1257:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1265:20: call_function: inlined call to ‘sym_is_choice’ from ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1265:19: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1266:24: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1266:24: call_function: calling ‘sym_check_choice_deps’ from ‘sym_check_deps’
# 1216|   
# 1217|   	prop = sym_get_choice_prop(choice);
# 1218|-> 	expr_list_for_each_sym(prop->expr, e, sym)
# 1219|   		sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
# 1220|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1495]
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sym’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1254:13: branch_false: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1254:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1257:13: call_function: inlined call to ‘sym_is_choice_value’ from ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1257:12: branch_false: following ‘false’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1265:20: call_function: inlined call to ‘sym_is_choice’ from ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1265:19: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1266:24: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1266:24: call_function: calling ‘sym_check_choice_deps’ from ‘sym_check_deps’
# 1248|   	struct property *prop;
# 1249|   
# 1250|-> 	if (sym->flags & SYMBOL_CHECK) {
# 1251|   		sym_check_print_recursive(sym);
# 1252|   		return sym;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1496]
xen-4.20.2/xen/tools/kconfig/symbol.c:1300:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xen-4.20.2/xen/tools/kconfig/symbol.c:1245:16: enter_function: entry to ‘sym_check_deps’
xen-4.20.2/xen/tools/kconfig/symbol.c:1250:12: branch_true: following ‘true’ branch...
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: branch_true: ...to here
xen-4.20.2/xen/tools/kconfig/symbol.c:1251:17: call_function: calling ‘sym_check_print_recursive’ from ‘sym_check_deps’
# 1298|   struct symbol *prop_get_symbol(struct property *prop)
# 1299|   {
# 1300|-> 	if (prop->expr && (prop->expr->type == E_SYMBOL ||
# 1301|   			   prop->expr->type == E_LIST))
# 1302|   		return prop->expr->left.sym;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def1497]
xen-4.20.2/xen/tools/symbols.c:120:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘0’
xen-4.20.2/xen/tools/symbols.c:594:5: enter_function: entry to ‘main’
xen-4.20.2/xen/tools/symbols.c:624:19: branch_false: following ‘false’ branch (when ‘argc == 1’)...
xen-4.20.2/xen/tools/symbols.c:627:9: branch_false: ...to here
xen-4.20.2/xen/tools/symbols.c:627:9: call_function: calling ‘read_map’ from ‘main’
#  118|   	     input_format == fmt_sysv && !*type && stype == '?' && sym &&
#  119|   	     sym[1] && strchr("cSsoh", sym[1]) && !sym[2])) {
#  120|-> 		free(filename);
#  121|   		filename = *str ? strdup(str) : NULL;
#  122|   		goto skip_tail;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1498]
xen-4.20.2/xen/tools/symbols.c:175:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*s.sym’
xen-4.20.2/xen/tools/symbols.c:594:5: enter_function: entry to ‘main’
xen-4.20.2/xen/tools/symbols.c:624:19: branch_false: following ‘false’ branch (when ‘argc == 1’)...
xen-4.20.2/xen/tools/symbols.c:627:9: branch_false: ...to here
xen-4.20.2/xen/tools/symbols.c:627:9: call_function: calling ‘read_map’ from ‘main’
#  173|   		s->type = stype; /* As s->sym[0] ends mangled. */
#  174|   	}
#  175|-> 	s->sym[0] = stype;
#  176|   	rc = 0;
#  177|   

Error: CPPCHECK_WARNING (CWE-476): [#def1499]
xen-4.20.2/xen/tools/symbols.c:362: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: markers
#  360|   	output_label("symbols_markers");
#  361|   	for (i = 0; i < ((table_cnt + 255) >> 8); i++)
#  362|-> 		printf("\t.long\t%d\n", markers[i]);
#  363|   	printf("\n");
#  364|   

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-169.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-namexen-4.20.2-2.fc44
store-results-to/tmp/tmpsunzp3ro/xen-4.20.2-2.fc44.tar.xz
time-created2026-01-08 22:22:57
time-finished2026-01-08 22:34:20
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpsunzp3ro/xen-4.20.2-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpsunzp3ro/xen-4.20.2-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9