postgresql18-18beta1-4.fc43

List of Findings

Error: SHELLCHECK_WARNING (CWE-457): [#def1]
/usr/bin/postgresql-setup:9:18: warning[SC2154]: var_content is referenced but not assigned.
#    7|       for v in PGSETUP_DEBUG PGSETUP_INITDB_OPTIONS PGSETUP_PGUPGRADE_OPTIONS; do
#    8|           eval var_content=\$$v
#    9|->         test -z "$var_content" && continue
#   10|           cmd+=$v="$(printf %q "$var_content") "
#   11|       done

Error: SHELLCHECK_WARNING (CWE-571): [#def2]
/usr/bin/postgresql-setup:223:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  221|   
#  222|       # must see previous version in PG_VERSION
#  223|->     local old_data_version="`cat "$upgradefrom_data/PG_VERSION"`"
#  224|       if [ ! -f "$upgradefrom_data/PG_VERSION" -o \
#  225|            x"$old_data_version" != x"$upgradefrom_major" ]

Error: SHELLCHECK_WARNING (CWE-477): [#def3]
/usr/bin/postgresql-setup:224:46: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  222|       # must see previous version in PG_VERSION
#  223|       local old_data_version="`cat "$upgradefrom_data/PG_VERSION"`"
#  224|->     if [ ! -f "$upgradefrom_data/PG_VERSION" -o \
#  225|            x"$old_data_version" != x"$upgradefrom_major" ]
#  226|       then

Error: SHELLCHECK_WARNING (CWE-457): [#def4]
/usr/bin/postgresql-setup:225:36: warning[SC2154]: upgradefrom_major is referenced but not assigned.
#  223|       local old_data_version="`cat "$upgradefrom_data/PG_VERSION"`"
#  224|       if [ ! -f "$upgradefrom_data/PG_VERSION" -o \
#  225|->          x"$old_data_version" != x"$upgradefrom_major" ]
#  226|       then
#  227|           error $"Cannot upgrade because the database in $upgradefrom_data is of"

Error: SHELLCHECK_WARNING (CWE-457): [#def5]
/usr/bin/postgresql-setup:231:16: warning[SC2154]: upgradefrom_engine is referenced but not assigned.
#  229|           exit 1
#  230|       fi
#  231|->     if [ ! -x "$upgradefrom_engine/postgres" ]; then
#  232|           error $"Please install the $upgradefrom_package package."
#  233|           exit 5

Error: SHELLCHECK_WARNING (CWE-457): [#def6]
/usr/bin/postgresql-setup:232:36: warning[SC2154]: upgradefrom_package is referenced but not assigned.
#  230|       fi
#  231|       if [ ! -x "$upgradefrom_engine/postgres" ]; then
#  232|->         error $"Please install the $upgradefrom_package package."
#  233|           exit 5
#  234|       fi

Error: SHELLCHECK_WARNING (CWE-457): [#def7]
/usr/bin/postgresql-setup:278:14: warning[SC2154]: upgradefrom_scls is referenced but not assigned.
#  276|   
#  277|       scls_upgrade_hacks=
#  278|->     test -n "$upgradefrom_scls" && {
#  279|           debug "scls [$upgradefrom_scls] will be enabled"
#  280|           scls_upgrade_hacks="source scl_source enable $upgradefrom_scls"

Error: SHELLCHECK_WARNING (CWE-457): [#def8]
/usr/bin/postgresql-setup:283:12: warning[SC2154]: upgradefrom_redhat_sockets_hack is referenced but not assigned.
#  281|       }
#  282|   
#  283|->     test x"$upgradefrom_redhat_sockets_hack" = xyes && {
#  284|           debug "upgrading from redhat server"
#  285|           socket_hacks="export REDHAT_PGUPGRADE_FROM_RHEL=yes"

Error: SHELLCHECK_WARNING (CWE-457): [#def9]
/usr/bin/postgresql-setup:288:14: warning[SC2154]: upgradefrom_pghost_override is referenced but not assigned.
#  286|       }
#  287|   
#  288|->     test -n "$upgradefrom_pghost_override" && {
#  289|           pghost_override="export PGHOST='$upgradefrom_pghost_override'"
#  290|       }

Error: SHELLCHECK_WARNING (CWE-252): [#def10]
/usr/bin/postgresql-setup:307:9: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#  305|           # After creating the empty new-format database, do the upgrade
#  306|           (
#  307|->         cd # pg_upgrade writes to $PWD
#  308|           eval "
#  309|               $scls_upgrade_hacks

Error: SHELLCHECK_WARNING (CWE-457): [#def11]
/usr/bin/postgresql-setup:324:14: warning[SC2154]: add_options is referenced but not assigned.
#  322|               --new-port="$PGPORT" \
#  323|               --username=postgres \
#  324|->             "${add_options[@]}" \
#  325|               >>"$upgrade_log" 2>>"$upgrade_log"
#  326|           )

Error: SHELLCHECK_WARNING (CWE-571): [#def12]
/usr/bin/postgresql-setup:366:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  364|       test 0 = 1 && return 0
#  365|   
#  366|->     local nr_out="`systemctl show -p $nr_option $option_service.service 2>/dev/null`"
#  367|       if [[ "$nr_out" != "$nr_option=no" ]]; then
#  368|           error   $"Note that systemd configuration for '$option_service' changed."

Error: SHELLCHECK_WARNING (CWE-571): [#def13]
/usr/bin/postgresql-setup:380:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  378|       local service="$1"
#  379|   
#  380|->     local systemd_env="$(systemctl show -p Environment "${service}.service")" \
#  381|           || { return; }
#  382|   

Error: SHELLCHECK_WARNING (CWE-571): [#def14]
/usr/bin/postgresql-setup:427:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  425|       local service="$2"
#  426|   
#  427|->     local envfiles="$(systemctl show -p EnvironmentFiles "${service}.service")"\
#  428|           || return
#  429|   

Error: SHELLCHECK_WARNING (CWE-563): [#def15]
/usr/bin/postgresql-setup:470:11: warning[SC2034]: port appears unused. Verify use (or export if used externally).
#  468|   {
#  469|       local data=
#  470|->     local port=
#  471|       local unit_pgport=
#  472|       local unit_pgdata=

Error: SHELLCHECK_WARNING (CWE-563): [#def16]
/usr/bin/postgresql-setup:630:13: warning[SC2034]: option_debug appears unused. Verify use (or export if used externally).
#  628|   
#  629|           --debug)
#  630|->             option_debug=1
#  631|               shift
#  632|               ;;

Error: SHELLCHECK_WARNING (CWE-457): [#def17]
/usr/bin/postgresql-setup:705:23: warning[SC2154]: upgradefrom_data_default is referenced but not assigned.
#  703|   
#  704|   if test upgrade = "$option_mode"; then
#  705|->     upgradefrom_data="$upgradefrom_data_default"
#  706|   
#  707|       if test -z "$option_upgradefrom_unit"; then

Error: SHELLCHECK_WARNING (CWE-457): [#def18]
/usr/bin/postgresql-setup:716:37: warning[SC2154]: upgradefrom_id is referenced but not assigned.
#  714|               # a different one, e.g. from postgresql92 to postgresql93, or from
#  715|               # postgresql (system version) to postgresql94 (scl).
#  716|->             option_upgradefrom_unit=$upgradefrom_id
#  717|   
#  718|               # Try to predict situations: postgresql93@second -> postgresql94@second

Error: SHELLCHECK_WARNING (CWE-398): [#def19]
/usr/bin/postgresql-setup:744:13: warning[SC2247]: Flip leading $ and " if this should be a quoted substitution.
#  742|       error_q $"In order to use this script, please remove data_directory entry from"
#  743|       error_q $"configuration file and make sure that the default location"
#  744|->     error_q $"(PGDATA) in .service file is valid."
#  745|       exit 1
#  746|   fi

Error: SHELLCHECK_WARNING (CWE-457): [#def20]
/usr/bin/postgresql-upgrade:149:33: warning[SC2154]: upgradefrom_major is referenced but not assigned.
#  147|   old_data_version="$(cat "$version_file")"
#  148|   
#  149|-> if test "$old_data_version" != "$upgradefrom_major"; then
#  150|       error   "Cannot upgrade because the database in $option_datadir of"
#  151|       error_q "version $old_data_version but it should be $upgradefrom_major"

Error: SHELLCHECK_WARNING (CWE-457): [#def21]
/usr/bin/postgresql-upgrade:155:12: warning[SC2154]: upgradefrom_engine is referenced but not assigned.
#  153|   fi
#  154|   
#  155|-> if [ ! -x "$upgradefrom_engine/postgres" ]; then
#  156|       error "Please install the $upgradefrom_package package."
#  157|       exit 1

Error: SHELLCHECK_WARNING (CWE-457): [#def22]
/usr/bin/postgresql-upgrade:156:31: warning[SC2154]: upgradefrom_package is referenced but not assigned.
#  154|   
#  155|   if [ ! -x "$upgradefrom_engine/postgres" ]; then
#  156|->     error "Please install the $upgradefrom_package package."
#  157|       exit 1
#  158|   fi

Error: SHELLCHECK_WARNING (CWE-457): [#def23]
/usr/bin/postgresql-upgrade:167:26: warning[SC2154]: data is referenced but not assigned.
#  165|   test -r "$conffile" || {
#  166|       error "config file $conffile is not readable or does not exist"
#  167|->     die "Old cluster in '$data' does not seem to be initialized"
#  168|   }
#  169|   

Error: SHELLCHECK_WARNING (CWE-456): [#def24]
/usr/lib64/pgsql/pgxs/config/install-sh:53:3: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#   51|   doit=${DOITPROG-}
#   52|   if test -z "$doit"; then
#   53|->   doit_exec=exec
#   54|   else
#   55|     doit_exec=$doit

Error: SHELLCHECK_WARNING: [#def25]
/usr/lib64/pgsql/pgxs/config/install-sh:142:33: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  140|   	shift;;
#  141|   
#  142|->     --help) echo "$usage"; exit $?;;
#  143|   
#  144|       -m) mode=$2

Error: SHELLCHECK_WARNING: [#def26]
/usr/lib64/pgsql/pgxs/config/install-sh:167:47: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  165|       -T) no_target_directory=true;;
#  166|   
#  167|->     --version) echo "$0 $scriptversion"; exit $?;;
#  168|   
#  169|       --)	shift

Error: SHELLCHECK_WARNING (CWE-456): [#def27]
/usr/lib64/pgsql/pgxs/config/install-sh:188:11: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  186|       if test -n "$dst_arg"; then
#  187|         # $@ is not empty: it contains at least $arg.
#  188|->       set fnord "$@" "$dst_arg"
#  189|         shift # fnord
#  190|       fi

Error: SHELLCHECK_WARNING (CWE-569): [#def28]
/usr/lib64/pgsql/pgxs/config/install-sh:212:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  210|   if test -z "$dir_arg"; then
#  211|     do_exit='(exit $ret); exit $ret'
#  212|->   trap "ret=129; $do_exit" 1
#  213|     trap "ret=130; $do_exit" 2
#  214|     trap "ret=141; $do_exit" 13

Error: SHELLCHECK_WARNING (CWE-569): [#def29]
/usr/lib64/pgsql/pgxs/config/install-sh:213:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  211|     do_exit='(exit $ret); exit $ret'
#  212|     trap "ret=129; $do_exit" 1
#  213|->   trap "ret=130; $do_exit" 2
#  214|     trap "ret=141; $do_exit" 13
#  215|     trap "ret=143; $do_exit" 15

Error: SHELLCHECK_WARNING (CWE-569): [#def30]
/usr/lib64/pgsql/pgxs/config/install-sh:214:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  212|     trap "ret=129; $do_exit" 1
#  213|     trap "ret=130; $do_exit" 2
#  214|->   trap "ret=141; $do_exit" 13
#  215|     trap "ret=143; $do_exit" 15
#  216|   

Error: SHELLCHECK_WARNING (CWE-398): [#def31]
/usr/lib64/pgsql/pgxs/config/install-sh:214:28: warning[SC2172]: Trapping signals by number is not well defined. Prefer signal names.
#  212|     trap "ret=129; $do_exit" 1
#  213|     trap "ret=130; $do_exit" 2
#  214|->   trap "ret=141; $do_exit" 13
#  215|     trap "ret=143; $do_exit" 15
#  216|   

Error: SHELLCHECK_WARNING (CWE-569): [#def32]
/usr/lib64/pgsql/pgxs/config/install-sh:215:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  213|     trap "ret=130; $do_exit" 2
#  214|     trap "ret=141; $do_exit" 13
#  215|->   trap "ret=143; $do_exit" 15
#  216|   
#  217|     # Set umask so as not to create temps with too-generous modes.

Error: SHELLCHECK_WARNING: [#def33]
/usr/lib64/pgsql/pgxs/config/install-sh:348:31: warning[SC3028]: In POSIX sh, RANDOM is undefined.
#  346|   	    ;;
#  347|   	  *)
#  348|-> 	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
#  349|   	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
#  350|   

Error: SHELLCHECK_WARNING (CWE-457): [#def34]
/usr/lib64/pgsql/pgxs/config/install-sh:349:11: warning[SC2154]: ret is referenced but not assigned.
#  347|   	  *)
#  348|   	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
#  349|-> 	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
#  350|   
#  351|   	    if (umask $mkdir_umask &&

Error: SHELLCHECK_WARNING (CWE-456): [#def35]
/usr/lib64/pgsql/pgxs/config/install-sh:404:11: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  402|         IFS=/
#  403|         $posix_glob set -f
#  404|->       set fnord $dstdir
#  405|         shift
#  406|         $posix_glob set +f

Error: SHELLCHECK_WARNING (CWE-456): [#def36]
/usr/lib64/pgsql/pgxs/config/install-sh:480:12: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  478|          eval "$initialize_posix_glob" &&
#  479|          $posix_glob set -f &&
#  480|->        set X $old && old=:$2:$4:$5:$6 &&
#  481|          set X $new && new=:$2:$4:$5:$6 &&
#  482|          $posix_glob set +f &&

Error: SHELLCHECK_WARNING (CWE-456): [#def37]
/usr/lib64/pgsql/pgxs/config/install-sh:481:12: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  479|          $posix_glob set -f &&
#  480|          set X $old && old=:$2:$4:$5:$6 &&
#  481|->        set X $new && new=:$2:$4:$5:$6 &&
#  482|          $posix_glob set +f &&
#  483|   

Error: SHELLCHECK_WARNING (CWE-456): [#def38]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:53:3: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#   51|   doit=${DOITPROG-}
#   52|   if test -z "$doit"; then
#   53|->   doit_exec=exec
#   54|   else
#   55|     doit_exec=$doit

Error: SHELLCHECK_WARNING: [#def39]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:142:33: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  140|   	shift;;
#  141|   
#  142|->     --help) echo "$usage"; exit $?;;
#  143|   
#  144|       -m) mode=$2

Error: SHELLCHECK_WARNING: [#def40]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:167:47: warning[SC2320]: This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
#  165|       -T) no_target_directory=true;;
#  166|   
#  167|->     --version) echo "$0 $scriptversion"; exit $?;;
#  168|   
#  169|       --)	shift

Error: SHELLCHECK_WARNING (CWE-456): [#def41]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:188:11: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  186|       if test -n "$dst_arg"; then
#  187|         # $@ is not empty: it contains at least $arg.
#  188|->       set fnord "$@" "$dst_arg"
#  189|         shift # fnord
#  190|       fi

Error: SHELLCHECK_WARNING (CWE-569): [#def42]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:212:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  210|   if test -z "$dir_arg"; then
#  211|     do_exit='(exit $ret); exit $ret'
#  212|->   trap "ret=129; $do_exit" 1
#  213|     trap "ret=130; $do_exit" 2
#  214|     trap "ret=141; $do_exit" 13

Error: SHELLCHECK_WARNING (CWE-569): [#def43]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:213:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  211|     do_exit='(exit $ret); exit $ret'
#  212|     trap "ret=129; $do_exit" 1
#  213|->   trap "ret=130; $do_exit" 2
#  214|     trap "ret=141; $do_exit" 13
#  215|     trap "ret=143; $do_exit" 15

Error: SHELLCHECK_WARNING (CWE-569): [#def44]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:214:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  212|     trap "ret=129; $do_exit" 1
#  213|     trap "ret=130; $do_exit" 2
#  214|->   trap "ret=141; $do_exit" 13
#  215|     trap "ret=143; $do_exit" 15
#  216|   

Error: SHELLCHECK_WARNING (CWE-398): [#def45]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:214:28: warning[SC2172]: Trapping signals by number is not well defined. Prefer signal names.
#  212|     trap "ret=129; $do_exit" 1
#  213|     trap "ret=130; $do_exit" 2
#  214|->   trap "ret=141; $do_exit" 13
#  215|     trap "ret=143; $do_exit" 15
#  216|   

Error: SHELLCHECK_WARNING (CWE-569): [#def46]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:215:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  213|     trap "ret=130; $do_exit" 2
#  214|     trap "ret=141; $do_exit" 13
#  215|->   trap "ret=143; $do_exit" 15
#  216|   
#  217|     # Set umask so as not to create temps with too-generous modes.

Error: SHELLCHECK_WARNING: [#def47]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:348:31: warning[SC3028]: In POSIX sh, RANDOM is undefined.
#  346|   	    ;;
#  347|   	  *)
#  348|-> 	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
#  349|   	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
#  350|   

Error: SHELLCHECK_WARNING (CWE-457): [#def48]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:349:11: warning[SC2154]: ret is referenced but not assigned.
#  347|   	  *)
#  348|   	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
#  349|-> 	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
#  350|   
#  351|   	    if (umask $mkdir_umask &&

Error: SHELLCHECK_WARNING (CWE-456): [#def49]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:404:11: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  402|         IFS=/
#  403|         $posix_glob set -f
#  404|->       set fnord $dstdir
#  405|         shift
#  406|         $posix_glob set +f

Error: SHELLCHECK_WARNING (CWE-456): [#def50]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:480:12: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  478|          eval "$initialize_posix_glob" &&
#  479|          $posix_glob set -f &&
#  480|->        set X $old && old=:$2:$4:$5:$6 &&
#  481|          set X $new && new=:$2:$4:$5:$6 &&
#  482|          $posix_glob set +f &&

Error: SHELLCHECK_WARNING (CWE-456): [#def51]
/usr/lib64/pgsql/postgresql-17/lib/pgxs/config/install-sh:481:12: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  479|          $posix_glob set -f &&
#  480|          set X $old && old=:$2:$4:$5:$6 &&
#  481|->        set X $new && new=:$2:$4:$5:$6 &&
#  482|          $posix_glob set +f &&
#  483|   

Error: SHELLCHECK_WARNING (CWE-758): [#def52]
/usr/share/postgresql-setup/library.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> die()     { echo >&2 $"FATAL: $@" ; exit 1 ; }
#    2|   error()   { echo >&2 $"ERROR: $@" ; }
#    3|   error_q() { echo >&2 $"       $@" ; }

Error: SHELLCHECK_WARNING (CWE-457): [#def53]
/usr/share/postgresql-setup/library.sh:8:19: warning[SC2154]: option_debug is referenced but not assigned.
#    6|   info()    { echo >&2 $" * $@" ; }
#    7|   info_q()  { echo >&2 $"   $@" ; }
#    8|-> debug()   { test "$option_debug" != "1" || echo >&2 $"DEBUG: $@";  }
#    9|   
#   10|   

Error: SHELLCHECK_WARNING (CWE-563): [#def54]
/usr/share/postgresql-setup/library.sh:67:11: warning[SC2034]: id appears unused. Verify use (or export if used externally).
#   65|       local action="$1"
#   66|       local expected_id="$2"
#   67|->     local id temp_major temp_engine temp_data_default temp_description
#   68|   
#   69|       local upgrade_confdir="/etc/postgresql-setup/upgrade"

Error: SHELLCHECK_WARNING (CWE-563): [#def55]
/usr/share/postgresql-setup/library.sh:67:14: warning[SC2034]: temp_major appears unused. Verify use (or export if used externally).
#   65|       local action="$1"
#   66|       local expected_id="$2"
#   67|->     local id temp_major temp_engine temp_data_default temp_description
#   68|   
#   69|       local upgrade_confdir="/etc/postgresql-setup/upgrade"

Error: SHELLCHECK_WARNING (CWE-563): [#def56]
/usr/share/postgresql-setup/library.sh:67:25: warning[SC2034]: temp_engine appears unused. Verify use (or export if used externally).
#   65|       local action="$1"
#   66|       local expected_id="$2"
#   67|->     local id temp_major temp_engine temp_data_default temp_description
#   68|   
#   69|       local upgrade_confdir="/etc/postgresql-setup/upgrade"

Error: SHELLCHECK_WARNING (CWE-563): [#def57]
/usr/share/postgresql-setup/library.sh:67:37: warning[SC2034]: temp_data_default appears unused. Verify use (or export if used externally).
#   65|       local action="$1"
#   66|       local expected_id="$2"
#   67|->     local id temp_major temp_engine temp_data_default temp_description
#   68|   
#   69|       local upgrade_confdir="/etc/postgresql-setup/upgrade"

Error: SHELLCHECK_WARNING (CWE-563): [#def58]
/usr/share/postgresql-setup/library.sh:67:55: warning[SC2034]: temp_description appears unused. Verify use (or export if used externally).
#   65|       local action="$1"
#   66|       local expected_id="$2"
#   67|->     local id temp_major temp_engine temp_data_default temp_description
#   68|   
#   69|       local upgrade_confdir="/etc/postgresql-setup/upgrade"

Error: SHELLCHECK_WARNING (CWE-457): [#def59]
/usr/share/postgresql-setup/library.sh:81:19: warning[SC2154]: __pg_conf_id is referenced but not assigned.
#   79|   
#   80|           if test help = "$action"; then
#   81|->             echo "$__pg_conf_id - $__pg_conf_description"
#   82|           elif test list = "$action"; then
#   83|               echo "$__pg_conf_id $__pg_conf_major"

Error: SHELLCHECK_WARNING (CWE-457): [#def60]
/usr/share/postgresql-setup/library.sh:81:35: warning[SC2154]: __pg_conf_description is referenced but not assigned.
#   79|   
#   80|           if test help = "$action"; then
#   81|->             echo "$__pg_conf_id - $__pg_conf_description"
#   82|           elif test list = "$action"; then
#   83|               echo "$__pg_conf_id $__pg_conf_major"

Error: SHELLCHECK_WARNING (CWE-457): [#def61]
/usr/share/postgresql-setup/library.sh:83:33: warning[SC2154]: __pg_conf_major is referenced but not assigned.
#   81|               echo "$__pg_conf_id - $__pg_conf_description"
#   82|           elif test list = "$action"; then
#   83|->             echo "$__pg_conf_id $__pg_conf_major"
#   84|           elif test config = "$action"; then
#   85|               test "$__pg_conf_id" = "$expected_id" || continue

Error: SHELLCHECK_WARNING (CWE-457): [#def62]
/usr/share/postgresql-setup/library.sh:95:30: warning[SC2154]: upgrade_from_scls is referenced but not assigned.
#   93|                   case "$i" in
#   94|                   scls)
#   95|->                     test -z "$upgrade_from_scls" \
#   96|                           || [[ $upgrade_from_scls =~ ^[-a-zA-Z0-9_\ ]+$ ]] \
#   97|                           || die "$cm: bad '$i' value '$upgrade_from_scls'"

Error: SHELLCHECK_WARNING (CWE-457): [#def63]
/usr/share/postgresql-setup/library.sh:100:27: warning[SC2154]: upgradefrom_redhat_sockets_hack is referenced but not assigned.
#   98|                       ;;
#   99|                   redhat_sockets_hack)
#  100|->                     case "$upgradefrom_redhat_sockets_hack" in
#  101|                       yes|no|'')
#  102|                           ;;

Error: SHELLCHECK_WARNING: [#def64]
/usr/share/postgresql-setup/postgresql_pkg_tests.sh:9:11: warning[SC3028]: In POSIX sh, RANDOM is undefined.
#    7|   try_random_port ()
#    8|   {
#    9|->     _port=$RANDOM
#   10|       if test -n "$_port" && eval '_port=$(( $_port + 32000 ))' 2>/dev/null; then
#   11|           echo "$_port"

Error: SHELLCHECK_WARNING: [#def65]
/usr/share/postgresql-setup/postgresql_pkg_tests.sh:86:9: warning[SC3011]: In POSIX sh, here-strings are undefined.
#   84|   {
#   85|       psql -d postgres --set=user="$1" --set=pass="$2" -tA \
#   86|->         <<<"ALTER USER :\"user\" WITH ENCRYPTED PASSWORD :'pass';"
#   87|   }
#   88|   

Error: CPPCHECK_WARNING (CWE-457): [#def66]
postgresql-18beta1/contrib/bloom/blvacuum.c:149: warning[uninitvar]: Uninitialized variable: notFullPage
#  147|   
#  148|   	metaData = BloomPageGetMeta(page);
#  149|-> 	memcpy(metaData->notFullPage, notFullPage, sizeof(BlockNumber) * countPage);
#  150|   	metaData->nStart = 0;
#  151|   	metaData->nEnd = countPage;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def67]
postgresql-18beta1/contrib/btree_gist/btree_utils_num.c:90:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘leaf’
postgresql-18beta1/contrib/btree_gist/btree_utils_num.c:18:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/btree_gist/btree_utils_num.c:34:56: branch_true: ...to here
postgresql-18beta1/contrib/btree_gist/btree_utils_num.c:90:17: danger: use of uninitialized value ‘leaf’ here
#   88|   		Assert(tinfo->indexsize >= 2 * tinfo->size);
#   89|   
#   90|-> 		memcpy(&r[0], leaf, tinfo->size);
#   91|   		memcpy(&r[tinfo->size], leaf, tinfo->size);
#   92|   		retval = palloc(sizeof(GISTENTRY));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def68]
postgresql-18beta1/contrib/cube/cubeparse.c:975:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/contrib/cube/cubeparse.c:933:6: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/cube/cubeparse.c:939:28: branch_true: ...to here
postgresql-18beta1/contrib/cube/cubeparse.c:962:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/contrib/cube/cubeparse.c:964:7: branch_false: ...to here
postgresql-18beta1/contrib/cube/cubeparse.c:973:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/cube/cubeparse.c:975:9: branch_false: ...to here
postgresql-18beta1/contrib/cube/cubeparse.c:975:9: danger: use of uninitialized value ‘yyss’ here
#  973|           if (! yyptr)
#  974|             YYNOMEM;
#  975|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#  976|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  977|   #  undef YYSTACK_RELOCATE

Error: CPPCHECK_WARNING (CWE-457): [#def69]
postgresql-18beta1/contrib/dblink/dblink.c:698: error[legacyUninitvar]: Uninitialized variable: conn
#  696|   
#  697|   	/* async query send */
#  698|-> 	retval = PQsendQuery(conn, sql);
#  699|   	if (retval != 1)
#  700|   		elog(NOTICE, "could not send query: %s", pchomp(PQerrorMessage(conn)));

Error: CPPCHECK_WARNING (CWE-457): [#def70]
postgresql-18beta1/contrib/dblink/dblink.c:698: error[legacyUninitvar]: Uninitialized variable: sql
#  696|   
#  697|   	/* async query send */
#  698|-> 	retval = PQsendQuery(conn, sql);
#  699|   	if (retval != 1)
#  700|   		elog(NOTICE, "could not send query: %s", pchomp(PQerrorMessage(conn)));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def71]
postgresql-18beta1/contrib/dblink/dblink.c:2851:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/contrib/dblink/dblink.c:2791:1: enter_function: entry to ‘dblink_res_error’
postgresql-18beta1/contrib/dblink/dblink.c:2850:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/contrib/dblink/dblink.c:2851:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/contrib/dblink/dblink.c:2851:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 2849|   	 */
# 2850|   	va_start(ap, fmt);
# 2851|-> 	vsnprintf(dblink_context_msg, sizeof(dblink_context_msg), fmt, ap);
# 2852|   	va_end(ap);
# 2853|   

Error: CPPCHECK_WARNING (CWE-768): [#def72]
postgresql-18beta1/contrib/hstore/hstore_io.c:469: error[unknownEvaluationOrder]: Expression '(entry)++->entry' depends on order of evaluation of side effects
#  467|   
#  468|   	for (i = 0; i < pcount; i++)
#  469|-> 		HS_ADDITEM(entry, buf, ptr, pairs[i]);
#  470|   
#  471|   	HS_FINALIZE(out, pcount, buf, ptr);

Error: CPPCHECK_WARNING (CWE-457): [#def73]
postgresql-18beta1/contrib/hstore/hstore_io.c:469: warning[uninitvar]: Uninitialized variable: pairs.val
#  467|   
#  468|   	for (i = 0; i < pcount; i++)
#  469|-> 		HS_ADDITEM(entry, buf, ptr, pairs[i]);
#  470|   
#  471|   	HS_FINALIZE(out, pcount, buf, ptr);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
postgresql-18beta1/contrib/hstore/hstore_op.c:341:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/contrib/hstore/hstore_op.c:292:1: enter_function: entry to ‘hstore_delete_array’
postgresql-18beta1/contrib/hstore/hstore_op.c:307:33: call_function: calling ‘hstoreArrayToPairs’ from ‘hstore_delete_array’
postgresql-18beta1/contrib/hstore/hstore_op.c:307:33: return_function: returning to ‘hstore_delete_array’ from ‘hstoreArrayToPairs’
postgresql-18beta1/contrib/hstore/hstore_op.c:317:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/hstore/hstore_op.c:317:12: branch_false: ...to here
postgresql-18beta1/contrib/hstore/hstore_op.c:331:25: branch_true: following ‘true’ branch (when ‘i < hs_count’)...
postgresql-18beta1/contrib/hstore/hstore_op.c:335:21: branch_true: ...to here
postgresql-18beta1/contrib/hstore/hstore_op.c:335:20: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/hstore/hstore_op.c:339:59: branch_false: ...to here
postgresql-18beta1/contrib/hstore/hstore_op.c:341:40: danger: dereference of NULL ‘hstoreArrayToPairs(pg_detoast_datum((char *)*fcinfo.args[1].value), &nkeys) + (long unsigned int)j * 40’
#  339|   			int			skeylen = HSTORE_KEYLEN(es, i);
#  340|   
#  341|-> 			if (skeylen == key_pairs[j].keylen)
#  342|   				difference = memcmp(HSTORE_KEY(es, ps, i),
#  343|   									key_pairs[j].key,

Error: CPPCHECK_WARNING (CWE-457): [#def75]
postgresql-18beta1/contrib/hstore_plpython/hstore_plpython.c:192: warning[uninitvar]: Uninitialized variables: out.vl_len_, out.size_
#  190|   	PG_END_TRY();
#  191|   
#  192|-> 	PG_RETURN_POINTER(out);
#  193|   }

Error: CPPCHECK_WARNING (CWE-476): [#def76]
postgresql-18beta1/contrib/intarray/_intbig_gist.c:173: warning[nullPointer]: Possible null pointer dereference: ptr
#  171|   		while (num--)
#  172|   		{
#  173|-> 			HASH(GETSIGN(res), *ptr, siglen);
#  174|   			ptr++;
#  175|   		}

Error: CPPCHECK_WARNING (CWE-682): [#def77]
postgresql-18beta1/contrib/intarray/_intbig_gist.c:174: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  172|   		{
#  173|   			HASH(GETSIGN(res), *ptr, siglen);
#  174|-> 			ptr++;
#  175|   		}
#  176|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def78]
postgresql-18beta1/contrib/ltree/ltree_gist.c:76:17: warning[-Wanalyzer-null-argument]: use of NULL ‘left’ where non-null expected
postgresql-18beta1/contrib/ltree/ltree_gist.c:192:1: enter_function: entry to ‘ltree_union’
postgresql-18beta1/contrib/ltree/ltree_gist.c:207:21: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/ltree/ltree_gist.c:240:12: branch_false: ...to here
postgresql-18beta1/contrib/ltree/ltree_gist.c:240:12: branch_false: following ‘false’ branch (when ‘isalltrue == 0’)...
postgresql-18beta1/contrib/ltree/ltree_gist.c:240:12: branch_false: ...to here
postgresql-18beta1/contrib/ltree/ltree_gist.c:253:18: call_function: calling ‘ltree_gist_alloc’ from ‘ltree_union’
#   74|   		Assert(left);
#   75|   		result->flag = LTG_ONENODE;
#   76|-> 		memcpy(LTG_NODE(result), left, VARSIZE(left));
#   77|   	}
#   78|   

Error: CPPCHECK_WARNING (CWE-457): [#def79]
postgresql-18beta1/contrib/pg_prewarm/autoprewarm.c:852: warning[uninitvar]: Uninitialized variable: num_blocks
#  850|   	PG_END_ENSURE_ERROR_CLEANUP(apw_detach_shmem, 0);
#  851|   
#  852|-> 	PG_RETURN_INT64((int64) num_blocks);
#  853|   }
#  854|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2392:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2323:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2334:13: branch_false: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2334:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2345:13: branch_false: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2345:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2346:32: branch_true: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2346:32: acquire_memory: allocated here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2349:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2349:12: branch_false: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2392:13: throw: if ‘CloseTransientFile’ throws an exception...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2392:13: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 2390|   	}
# 2391|   
# 2392|-> 	if (CloseTransientFile(fd) != 0)
# 2393|   		ereport(LOG,
# 2394|   				(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2393:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2323:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2334:13: branch_false: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2334:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2345:13: branch_false: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2345:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2346:32: branch_true: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2346:32: acquire_memory: allocated here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2349:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2349:12: branch_false: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2392:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2393:17: branch_true: ...to here
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2393:17: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/contrib/pg_stat_statements/pg_stat_statements.c:2393:17: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 2391|   
# 2392|   	if (CloseTransientFile(fd) != 0)
# 2393|-> 		ereport(LOG,
# 2394|   				(errcode_for_file_access(),
# 2395|   				 errmsg("could not close file \"%s\": %m", PGSS_TEXT_FILE)));

Error: CPPCHECK_WARNING (CWE-476): [#def82]
postgresql-18beta1/contrib/pg_trgm/trgm_gin.c:144: warning[nullPointer]: Possible null pointer dereference: (union varattrib_4b*)(trg)
#  142|   	}
#  143|   
#  144|-> 	trglen = ARRNELEM(trg);
#  145|   	*nentries = trglen;
#  146|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def83]
postgresql-18beta1/contrib/pg_trgm/trgm_regexp.c:2001:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/contrib/pg_trgm/trgm_regexp.c:1971:16: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/pg_trgm/trgm_regexp.c:1971:16: branch_true: ...to here
postgresql-18beta1/contrib/pg_trgm/trgm_regexp.c:2001:60: danger: dereference of NULL ‘<unknown>’
# 1999|   				arcs[arcIndex].sourceState = source->snumber;
# 2000|   				arcs[arcIndex].targetState = target->snumber;
# 2001|-> 				arcs[arcIndex].colorTrgm = ctrgm->cnumber;
# 2002|   				arcIndex++;
# 2003|   			}

Error: CPPCHECK_WARNING (CWE-457): [#def84]
postgresql-18beta1/contrib/pgcrypto/pgp-pgsql.c:403: error[uninitvar]: Uninitialized variable: tmp
#  401|   	 * reserve room for header
#  402|   	 */
#  403|-> 	mbuf_append(dst, tmp, VARHDRSZ);
#  404|   
#  405|   	/*

Error: CPPCHECK_WARNING (CWE-457): [#def85]
postgresql-18beta1/contrib/pgcrypto/pgp-pgsql.c:482: error[uninitvar]: Uninitialized variable: tmp
#  480|   	 * reserve room for header
#  481|   	 */
#  482|-> 	mbuf_append(dst, tmp, VARHDRSZ);
#  483|   
#  484|   	/*

Error: GCC_ANALYZER_WARNING (CWE-404): [#def86]
postgresql-18beta1/contrib/pgcrypto/px.c:158:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/contrib/pgcrypto/px.c:153:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/contrib/pgcrypto/px.c:154:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/pgcrypto/px.c:158:17: branch_true: ...to here
postgresql-18beta1/contrib/pgcrypto/px.c:158:17: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/contrib/pgcrypto/px.c:158:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  156|   		char		buf[512];
#  157|   
#  158|-> 		vsnprintf(buf, sizeof(buf), fmt, ap);
#  159|   		debug_handler(buf);
#  160|   	}

Error: CPPCHECK_WARNING (CWE-909): [#def87]
postgresql-18beta1/contrib/postgres_fdw/deparse.c:1922: error[uninitStructMember]: Uninitialized struct member: join_sql_o.len
# 1920|   		if (fpinfo->jointype == JOIN_SEMI)
# 1921|   		{
# 1922|-> 			appendBinaryStringInfo(buf, join_sql_o.data, join_sql_o.len);
# 1923|   		}
# 1924|   		else

Error: CPPCHECK_WARNING (CWE-768): [#def88]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:1419: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(retrieved_attrs)}' depends on order of evaluation of side effects
# 1417|   	 * Items in the list must match order in enum FdwScanPrivateIndex.
# 1418|   	 */
# 1419|-> 	fdw_private = list_make3(makeString(sql.data),
# 1420|   							 retrieved_attrs,
# 1421|   							 makeInteger(fpinfo->fetch_size));

Error: CPPCHECK_WARNING (CWE-768): [#def89]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:1419: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(retrieved_attrs)},(union ListCell){.ptr_value=(makeInteger(fpinfo->fetch_size))}' depends on order of evaluation of side effects
# 1417|   	 * Items in the list must match order in enum FdwScanPrivateIndex.
# 1418|   	 */
# 1419|-> 	fdw_private = list_make3(makeString(sql.data),
# 1420|   							 retrieved_attrs,
# 1421|   							 makeInteger(fpinfo->fetch_size));

Error: CPPCHECK_WARNING (CWE-768): [#def90]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:1907: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)}' depends on order of evaluation of side effects
# 1905|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1906|   	 */
# 1907|-> 	return list_make5(makeString(sql.data),
# 1908|   					  targetAttrs,
# 1909|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def91]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:1907: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)},(union ListCell){.ptr_value=(makeInteger(values_end_len))}' depends on order of evaluation of side effects
# 1905|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1906|   	 */
# 1907|-> 	return list_make5(makeString(sql.data),
# 1908|   					  targetAttrs,
# 1909|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def92]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:1907: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)},(union ListCell){.ptr_value=(makeInteger(values_end_len))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))}' depends on order of evaluation of side effects
# 1905|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1906|   	 */
# 1907|-> 	return list_make5(makeString(sql.data),
# 1908|   					  targetAttrs,
# 1909|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def93]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:1907: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)},(union ListCell){.ptr_value=(makeInteger(values_end_len))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))},(union ListCell){.ptr_value=(retrieved_attrs)}' depends on order of evaluation of side effects
# 1905|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1906|   	 */
# 1907|-> 	return list_make5(makeString(sql.data),
# 1908|   					  targetAttrs,
# 1909|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def94]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:2616: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))}' depends on order of evaluation of side effects
# 2614|   	 * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2615|   	 */
# 2616|-> 	fscan->fdw_private = list_make4(makeString(sql.data),
# 2617|   									makeBoolean((retrieved_attrs != NIL)),
# 2618|   									retrieved_attrs,

Error: CPPCHECK_WARNING (CWE-768): [#def95]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:2616: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))},(union ListCell){.ptr_value=(retrieved_attrs)}' depends on order of evaluation of side effects
# 2614|   	 * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2615|   	 */
# 2616|-> 	fscan->fdw_private = list_make4(makeString(sql.data),
# 2617|   									makeBoolean((retrieved_attrs != NIL)),
# 2618|   									retrieved_attrs,

Error: CPPCHECK_WARNING (CWE-768): [#def96]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:2616: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))},(union ListCell){.ptr_value=(retrieved_attrs)},(union ListCell){.ptr_value=(makeBoolean(plan->canSetTag))}' depends on order of evaluation of side effects
# 2614|   	 * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2615|   	 */
# 2616|-> 	fscan->fdw_private = list_make4(makeString(sql.data),
# 2617|   									makeBoolean((retrieved_attrs != NIL)),
# 2618|   									retrieved_attrs,

Error: CPPCHECK_WARNING (CWE-768): [#def97]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:7004: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeBoolean(true))},(union ListCell){.ptr_value=(makeBoolean(false))}' depends on order of evaluation of side effects
# 7002|   	 * Items in the list must match order in enum FdwPathPrivateIndex.
# 7003|   	 */
# 7004|-> 	fdw_private = list_make2(makeBoolean(true), makeBoolean(false));
# 7005|   
# 7006|   	/* Create foreign ordering path */

Error: CPPCHECK_WARNING (CWE-768): [#def98]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:7257: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeBoolean(has_final_sort))},(union ListCell){.ptr_value=(makeBoolean(extra->limit_needed))}' depends on order of evaluation of side effects
# 7255|   	 * Items in the list must match order in enum FdwPathPrivateIndex.
# 7256|   	 */
# 7257|-> 	fdw_private = list_make2(makeBoolean(has_final_sort),
# 7258|   							 makeBoolean(extra->limit_needed));
# 7259|   

Error: CPPCHECK_WARNING (CWE-476): [#def99]
postgresql-18beta1/contrib/postgres_fdw/postgres_fdw.c:7625: warning[nullPointer]: Possible null pointer dereference: fsstate
# 7623|   	{
# 7624|   		Assert(fsstate);
# 7625|-> 		tupdesc = fsstate->ss.ss_ScanTupleSlot->tts_tupleDescriptor;
# 7626|   	}
# 7627|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def100]
postgresql-18beta1/contrib/seg/segparse.c:970:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/contrib/seg/segparse.c:928:6: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/seg/segparse.c:934:28: branch_true: ...to here
postgresql-18beta1/contrib/seg/segparse.c:957:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/contrib/seg/segparse.c:959:7: branch_false: ...to here
postgresql-18beta1/contrib/seg/segparse.c:968:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/seg/segparse.c:970:9: branch_false: ...to here
postgresql-18beta1/contrib/seg/segparse.c:970:9: danger: use of uninitialized value ‘yyss’ here
#  968|           if (! yyptr)
#  969|             YYNOMEM;
#  970|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#  971|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  972|   #  undef YYSTACK_RELOCATE

Error: CPPCHECK_WARNING (CWE-457): [#def101]
postgresql-18beta1/contrib/sepgsql/label.c:605: warning[uninitvar]: Uninitialized variable: result
#  603|   	PG_END_TRY();
#  604|   
#  605|-> 	PG_RETURN_TEXT_P(cstring_to_text(result));
#  606|   }
#  607|   

Error: CPPCHECK_WARNING (CWE-457): [#def102]
postgresql-18beta1/contrib/sepgsql/label.c:643: warning[uninitvar]: Uninitialized variable: result
#  641|   	PG_END_TRY();
#  642|   
#  643|-> 	PG_RETURN_TEXT_P(cstring_to_text(result));
#  644|   }
#  645|   

Error: CPPCHECK_WARNING (CWE-457): [#def103]
postgresql-18beta1/contrib/sepgsql/selinux.c:887: warning[uninitvar]: Uninitialized variable: result
#  885|   	PG_END_TRY();
#  886|   
#  887|-> 	return result;
#  888|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def104]
postgresql-18beta1/contrib/spi/refint.c:165:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argtypes’
postgresql-18beta1/contrib/spi/refint.c:78:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:83:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:87:14: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:87:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:92:13: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:108:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:112:9: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:134:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:138:9: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:138:21: branch_true: following ‘true’ branch (when ‘i < nkeys’)...
postgresql-18beta1/contrib/spi/refint.c:141:76: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:144:20: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:151:22: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:158:20: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:164:21: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:164:20: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/spi/refint.c:165:33: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:165:25: danger: dereference of NULL ‘argtypes + (long unsigned int)i * 4’
#  163|   
#  164|   		if (plan->nplans <= 0)	/* Get typeId of column */
#  165|-> 			argtypes[i] = SPI_gettypeid(tupdesc, fnumber);
#  166|   	}
#  167|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def105]
postgresql-18beta1/contrib/spi/refint.c:414:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argtypes’
postgresql-18beta1/contrib/spi/refint.c:280:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:285:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:290:13: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:290:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:294:14: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:294:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:299:9: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:306:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/spi/refint.c:308:17: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:315:12: branch_false: following ‘false’ branch (when ‘nargs > 4’)...
postgresql-18beta1/contrib/spi/refint.c:320:17: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:321:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:324:18: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:331:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:352:9: branch_true: following ‘true’ branch (when ‘is_update != 0’)...
postgresql-18beta1/contrib/spi/refint.c:352:9: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:356:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:362:17: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:362:17: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:368:9: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:368:21: branch_true: following ‘true’ branch (when ‘i < nkeys’)...
postgresql-18beta1/contrib/spi/refint.c:371:76: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:374:20: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:381:22: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:388:20: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:399:20: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:399:20: branch_true: following ‘true’ branch (when ‘newtuple’ is non-NULL)...
postgresql-18beta1/contrib/spi/refint.c:401:46: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:405:28: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/spi/refint.c:408:34: branch_false: ...to here
postgresql-18beta1/contrib/spi/refint.c:409:28: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/spi/refint.c:413:21: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:413:20: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/spi/refint.c:414:33: branch_true: ...to here
postgresql-18beta1/contrib/spi/refint.c:414:25: danger: dereference of NULL ‘argtypes + (long unsigned int)i * 4’
#  412|   
#  413|   		if (plan->nplans <= 0)	/* Get typeId of column */
#  414|-> 			argtypes[i] = SPI_gettypeid(tupdesc, fnumber);
#  415|   	}
#  416|   	args_temp = args;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def106]
postgresql-18beta1/contrib/unaccent/unaccent.c:257:41: warning[-Wanalyzer-null-argument]: use of NULL ‘trg’ where non-null expected
postgresql-18beta1/contrib/unaccent/unaccent.c:105:12: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/unaccent/unaccent.c:118:17: branch_true: ...to here
postgresql-18beta1/contrib/unaccent/unaccent.c:120:17: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/contrib/unaccent/unaccent.c:120:17: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/unaccent/unaccent.c:120:17: branch_true: ...to here
postgresql-18beta1/contrib/unaccent/unaccent.c:227:36: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/unaccent/unaccent.c:235:36: branch_false: ...to here
postgresql-18beta1/contrib/unaccent/unaccent.c:235:36: branch_false: following ‘false’ branch (when ‘state != 4’)...
postgresql-18beta1/contrib/unaccent/unaccent.c:239:50: branch_false: ...to here
postgresql-18beta1/contrib/unaccent/unaccent.c:239:36: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/unaccent/unaccent.c:255:61: branch_false: ...to here
postgresql-18beta1/contrib/unaccent/unaccent.c:257:41: danger: argument 2 (‘trg’) NULL where non-null expected
#  255|   					trgstore = (char *) palloc(sizeof(char) * trglen);
#  256|   					trgstorelen = trglen;
#  257|-> 					memcpy(trgstore, trg, trgstorelen);
#  258|   				}
#  259|   

Error: CPPCHECK_WARNING (CWE-457): [#def107]
postgresql-18beta1/postgresql-17.2/contrib/bloom/blvacuum.c:153: warning[uninitvar]: Uninitialized variable: notFullPage
#  151|   
#  152|   	metaData = BloomPageGetMeta(page);
#  153|-> 	memcpy(metaData->notFullPage, notFullPage, sizeof(BlockNumber) * countPage);
#  154|   	metaData->nStart = 0;
#  155|   	metaData->nEnd = countPage;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def108]
postgresql-18beta1/postgresql-17.2/contrib/btree_gist/btree_utils_num.c:90:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘leaf’
postgresql-18beta1/postgresql-17.2/contrib/btree_gist/btree_utils_num.c:18:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/btree_gist/btree_utils_num.c:34:56: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/btree_gist/btree_utils_num.c:90:17: danger: use of uninitialized value ‘leaf’ here
#   88|   		Assert(tinfo->indexsize >= 2 * tinfo->size);
#   89|   
#   90|-> 		memcpy(&r[0], leaf, tinfo->size);
#   91|   		memcpy(&r[tinfo->size], leaf, tinfo->size);
#   92|   		retval = palloc(sizeof(GISTENTRY));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def109]
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:971:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:929:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:935:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:958:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:960:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:969:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:971:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/cube/cubeparse.c:971:9: danger: use of uninitialized value ‘yyss’ here
#  969|           if (! yyptr)
#  970|             YYNOMEM;
#  971|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#  972|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  973|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1582:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1569:21: enter_function: entry to ‘cube_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1573:24: call_function: inlined call to ‘cube_yyalloc’ from ‘cube_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1574:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1577:2: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1582:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1580|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1581|   	 * we need to put in 2 end-of-buffer characters.
# 1582|-> 	 */
# 1583|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1584|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def111]
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1623: warning[nullPointer]: Possible null pointer dereference: b
# 1621|       
# 1622|   	yy_flush_buffer( b );
# 1623|-> 
# 1624|   	b->yy_input_file = file;
# 1625|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def112]
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1624: warning[nullPointer]: Possible null pointer dereference: b
# 1622|   	yy_flush_buffer( b );
# 1623|   
# 1624|-> 	b->yy_input_file = file;
# 1625|   	b->yy_fill_buffer = 1;
# 1626|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1785:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1771:17: enter_function: entry to ‘cube_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1781:24: call_function: inlined call to ‘cube_yyalloc’ from ‘cube_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1782:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1785:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1795:2: call_function: calling ‘cube_yy_switch_to_buffer’ from ‘cube_yy_scan_buffer’
# 1783|   	if ( ! b )
# 1784|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 1785|-> 
# 1786|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 1787|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1837:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1821:17: enter_function: entry to ‘cube_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1830:24: call_function: inlined call to ‘cube_yyalloc’ from ‘cube_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1831:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1831:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/cube/cubescan.c:1839:6: call_function: calling ‘cube_yy_scan_buffer’ from ‘cube_yy_scan_bytes’
# 1835|   	for ( i = 0; i < _yybytes_len; ++i )
# 1836|   		buf[i] = yybytes[i];
# 1837|-> 
# 1838|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1839|   

Error: CPPCHECK_WARNING (CWE-457): [#def115]
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:690: error[legacyUninitvar]: Uninitialized variable: conn
#  688|   
#  689|   	/* async query send */
#  690|-> 	retval = PQsendQuery(conn, sql);
#  691|   	if (retval != 1)
#  692|   		elog(NOTICE, "could not send query: %s", pchomp(PQerrorMessage(conn)));

Error: CPPCHECK_WARNING (CWE-457): [#def116]
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:690: error[legacyUninitvar]: Uninitialized variable: sql
#  688|   
#  689|   	/* async query send */
#  690|-> 	retval = PQsendQuery(conn, sql);
#  691|   	if (retval != 1)
#  692|   		elog(NOTICE, "could not send query: %s", pchomp(PQerrorMessage(conn)));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def117]
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:2767:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:2707:1: enter_function: entry to ‘dblink_res_error’
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:2766:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:2767:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/contrib/dblink/dblink.c:2767:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 2765|   	 */
# 2766|   	va_start(ap, fmt);
# 2767|-> 	vsnprintf(dblink_context_msg, sizeof(dblink_context_msg), fmt, ap);
# 2768|   	va_end(ap);
# 2769|   

Error: CPPCHECK_WARNING (CWE-768): [#def118]
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_io.c:466: error[unknownEvaluationOrder]: Expression '(entry)++->entry' depends on order of evaluation of side effects
#  464|   
#  465|   	for (i = 0; i < pcount; i++)
#  466|-> 		HS_ADDITEM(entry, buf, ptr, pairs[i]);
#  467|   
#  468|   	HS_FINALIZE(out, pcount, buf, ptr);

Error: CPPCHECK_WARNING (CWE-457): [#def119]
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_io.c:466: warning[uninitvar]: Uninitialized variable: pairs.val
#  464|   
#  465|   	for (i = 0; i < pcount; i++)
#  466|-> 		HS_ADDITEM(entry, buf, ptr, pairs[i]);
#  467|   
#  468|   	HS_FINALIZE(out, pcount, buf, ptr);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def120]
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:341:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:292:1: enter_function: entry to ‘hstore_delete_array’
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:307:33: call_function: calling ‘hstoreArrayToPairs’ from ‘hstore_delete_array’
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:307:33: return_function: returning to ‘hstore_delete_array’ from ‘hstoreArrayToPairs’
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:317:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:317:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:331:25: branch_true: following ‘true’ branch (when ‘i < hs_count’)...
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:335:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:335:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:339:59: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/hstore/hstore_op.c:341:40: danger: dereference of NULL ‘hstoreArrayToPairs(pg_detoast_datum((char *)*fcinfo.args[1].value), &nkeys) + (long unsigned int)j * 40’
#  339|   			int			skeylen = HSTORE_KEYLEN(es, i);
#  340|   
#  341|-> 			if (skeylen == key_pairs[j].keylen)
#  342|   				difference = memcmp(HSTORE_KEY(es, ps, i),
#  343|   									key_pairs[j].key,

Error: CPPCHECK_WARNING (CWE-476): [#def121]
postgresql-18beta1/postgresql-17.2/contrib/intarray/_intbig_gist.c:173: warning[nullPointer]: Possible null pointer dereference: ptr
#  171|   		while (num--)
#  172|   		{
#  173|-> 			HASH(GETSIGN(res), *ptr, siglen);
#  174|   			ptr++;
#  175|   		}

Error: CPPCHECK_WARNING (CWE-682): [#def122]
postgresql-18beta1/postgresql-17.2/contrib/intarray/_intbig_gist.c:174: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  172|   		{
#  173|   			HASH(GETSIGN(res), *ptr, siglen);
#  174|-> 			ptr++;
#  175|   		}
#  176|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def123]
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:76:17: warning[-Wanalyzer-null-argument]: use of NULL ‘left’ where non-null expected
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:192:1: enter_function: entry to ‘ltree_union’
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:207:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:240:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:240:12: branch_false: following ‘false’ branch (when ‘isalltrue == 0’)...
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:240:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/ltree/ltree_gist.c:253:18: call_function: calling ‘ltree_gist_alloc’ from ‘ltree_union’
#   74|   		Assert(left);
#   75|   		result->flag = LTG_ONENODE;
#   76|-> 		memcpy(LTG_NODE(result), left, VARSIZE(left));
#   77|   	}
#   78|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2360:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2291:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2302:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2313:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2313:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2314:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2314:32: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2317:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2317:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2360:13: throw: if ‘CloseTransientFile’ throws an exception...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2360:13: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 2358|   	}
# 2359|   
# 2360|-> 	if (CloseTransientFile(fd) != 0)
# 2361|   		ereport(LOG,
# 2362|   				(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2361:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2291:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2302:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2313:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2313:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2314:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2314:32: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2317:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2317:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2360:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2361:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2361:17: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/postgresql-17.2/contrib/pg_stat_statements/pg_stat_statements.c:2361:17: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 2359|   
# 2360|   	if (CloseTransientFile(fd) != 0)
# 2361|-> 		ereport(LOG,
# 2362|   				(errcode_for_file_access(),
# 2363|   				 errmsg("could not close file \"%s\": %m", PGSS_TEXT_FILE)));

Error: CPPCHECK_WARNING (CWE-476): [#def126]
postgresql-18beta1/postgresql-17.2/contrib/pg_trgm/trgm_gin.c:144: warning[nullPointer]: Possible null pointer dereference: (union varattrib_4b*)(trg)
#  142|   	}
#  143|   
#  144|-> 	trglen = ARRNELEM(trg);
#  145|   	*nentries = trglen;
#  146|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
postgresql-18beta1/postgresql-17.2/contrib/pg_trgm/trgm_regexp.c:1999:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/contrib/pg_trgm/trgm_regexp.c:1969:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/pg_trgm/trgm_regexp.c:1969:16: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/pg_trgm/trgm_regexp.c:1999:60: danger: dereference of NULL ‘<unknown>’
# 1997|   				arcs[arcIndex].sourceState = source->snumber;
# 1998|   				arcs[arcIndex].targetState = target->snumber;
# 1999|-> 				arcs[arcIndex].colorTrgm = ctrgm->cnumber;
# 2000|   				arcIndex++;
# 2001|   			}

Error: CPPCHECK_WARNING (CWE-909): [#def128]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/deparse.c:1924: error[uninitStructMember]: Uninitialized struct member: join_sql_o.len
# 1922|   		if (fpinfo->jointype == JOIN_SEMI)
# 1923|   		{
# 1924|-> 			appendBinaryStringInfo(buf, join_sql_o.data, join_sql_o.len);
# 1925|   		}
# 1926|   		else

Error: CPPCHECK_WARNING (CWE-768): [#def129]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:1411: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(retrieved_attrs)}' depends on order of evaluation of side effects
# 1409|   	 * Items in the list must match order in enum FdwScanPrivateIndex.
# 1410|   	 */
# 1411|-> 	fdw_private = list_make3(makeString(sql.data),
# 1412|   							 retrieved_attrs,
# 1413|   							 makeInteger(fpinfo->fetch_size));

Error: CPPCHECK_WARNING (CWE-768): [#def130]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:1411: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(retrieved_attrs)},(union ListCell){.ptr_value=(makeInteger(fpinfo->fetch_size))}' depends on order of evaluation of side effects
# 1409|   	 * Items in the list must match order in enum FdwScanPrivateIndex.
# 1410|   	 */
# 1411|-> 	fdw_private = list_make3(makeString(sql.data),
# 1412|   							 retrieved_attrs,
# 1413|   							 makeInteger(fpinfo->fetch_size));

Error: CPPCHECK_WARNING (CWE-768): [#def131]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:1899: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)}' depends on order of evaluation of side effects
# 1897|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1898|   	 */
# 1899|-> 	return list_make5(makeString(sql.data),
# 1900|   					  targetAttrs,
# 1901|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def132]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:1899: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)},(union ListCell){.ptr_value=(makeInteger(values_end_len))}' depends on order of evaluation of side effects
# 1897|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1898|   	 */
# 1899|-> 	return list_make5(makeString(sql.data),
# 1900|   					  targetAttrs,
# 1901|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def133]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:1899: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)},(union ListCell){.ptr_value=(makeInteger(values_end_len))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))}' depends on order of evaluation of side effects
# 1897|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1898|   	 */
# 1899|-> 	return list_make5(makeString(sql.data),
# 1900|   					  targetAttrs,
# 1901|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def134]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:1899: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(targetAttrs)},(union ListCell){.ptr_value=(makeInteger(values_end_len))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))},(union ListCell){.ptr_value=(retrieved_attrs)}' depends on order of evaluation of side effects
# 1897|   	 * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1898|   	 */
# 1899|-> 	return list_make5(makeString(sql.data),
# 1900|   					  targetAttrs,
# 1901|   					  makeInteger(values_end_len),

Error: CPPCHECK_WARNING (CWE-768): [#def135]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:2608: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))}' depends on order of evaluation of side effects
# 2606|   	 * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2607|   	 */
# 2608|-> 	fscan->fdw_private = list_make4(makeString(sql.data),
# 2609|   									makeBoolean((retrieved_attrs != NIL)),
# 2610|   									retrieved_attrs,

Error: CPPCHECK_WARNING (CWE-768): [#def136]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:2608: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))},(union ListCell){.ptr_value=(retrieved_attrs)}' depends on order of evaluation of side effects
# 2606|   	 * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2607|   	 */
# 2608|-> 	fscan->fdw_private = list_make4(makeString(sql.data),
# 2609|   									makeBoolean((retrieved_attrs != NIL)),
# 2610|   									retrieved_attrs,

Error: CPPCHECK_WARNING (CWE-768): [#def137]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:2608: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(sql.data))},(union ListCell){.ptr_value=(makeBoolean(retrieved_attrs!=((struct List*)NULL)))},(union ListCell){.ptr_value=(retrieved_attrs)},(union ListCell){.ptr_value=(makeBoolean(plan->canSetTag))}' depends on order of evaluation of side effects
# 2606|   	 * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2607|   	 */
# 2608|-> 	fscan->fdw_private = list_make4(makeString(sql.data),
# 2609|   									makeBoolean((retrieved_attrs != NIL)),
# 2610|   									retrieved_attrs,

Error: CPPCHECK_WARNING (CWE-768): [#def138]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:6961: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeBoolean(true))},(union ListCell){.ptr_value=(makeBoolean(false))}' depends on order of evaluation of side effects
# 6959|   	 * Items in the list must match order in enum FdwPathPrivateIndex.
# 6960|   	 */
# 6961|-> 	fdw_private = list_make2(makeBoolean(true), makeBoolean(false));
# 6962|   
# 6963|   	/* Create foreign ordering path */

Error: CPPCHECK_WARNING (CWE-768): [#def139]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:7210: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeBoolean(has_final_sort))},(union ListCell){.ptr_value=(makeBoolean(extra->limit_needed))}' depends on order of evaluation of side effects
# 7208|   	 * Items in the list must match order in enum FdwPathPrivateIndex.
# 7209|   	 */
# 7210|-> 	fdw_private = list_make2(makeBoolean(has_final_sort),
# 7211|   							 makeBoolean(extra->limit_needed));
# 7212|   

Error: CPPCHECK_WARNING (CWE-476): [#def140]
postgresql-18beta1/postgresql-17.2/contrib/postgres_fdw/postgres_fdw.c:7577: warning[nullPointer]: Possible null pointer dereference: fsstate
# 7575|   	{
# 7576|   		Assert(fsstate);
# 7577|-> 		tupdesc = fsstate->ss.ss_ScanTupleSlot->tts_tupleDescriptor;
# 7578|   	}
# 7579|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def141]
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:971:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:929:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:935:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:958:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:960:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:969:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:971:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/seg/segparse.c:971:9: danger: use of uninitialized value ‘yyss’ here
#  969|           if (! yyptr)
#  970|             YYNOMEM;
#  971|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#  972|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  973|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1564:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1551:21: enter_function: entry to ‘seg_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1555:24: call_function: inlined call to ‘seg_yyalloc’ from ‘seg_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1556:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1559:2: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1564:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1562|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1563|   	 * we need to put in 2 end-of-buffer characters.
# 1564|-> 	 */
# 1565|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1566|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def143]
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1605: warning[nullPointer]: Possible null pointer dereference: b
# 1603|       
# 1604|   	yy_flush_buffer( b );
# 1605|-> 
# 1606|   	b->yy_input_file = file;
# 1607|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def144]
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1606: warning[nullPointer]: Possible null pointer dereference: b
# 1604|   	yy_flush_buffer( b );
# 1605|   
# 1606|-> 	b->yy_input_file = file;
# 1607|   	b->yy_fill_buffer = 1;
# 1608|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1767:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1753:17: enter_function: entry to ‘seg_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1763:24: call_function: inlined call to ‘seg_yyalloc’ from ‘seg_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1764:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1767:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1777:2: call_function: calling ‘seg_yy_switch_to_buffer’ from ‘seg_yy_scan_buffer’
# 1765|   	if ( ! b )
# 1766|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 1767|-> 
# 1768|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 1769|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1819:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1803:17: enter_function: entry to ‘seg_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1812:24: call_function: inlined call to ‘seg_yyalloc’ from ‘seg_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1813:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1813:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/seg/segscan.c:1821:6: call_function: calling ‘seg_yy_scan_buffer’ from ‘seg_yy_scan_bytes’
# 1817|   	for ( i = 0; i < _yybytes_len; ++i )
# 1818|   		buf[i] = yybytes[i];
# 1819|-> 
# 1820|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1821|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:160:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argtypes’
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:75:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:80:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:85:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:101:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:105:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:119:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:129:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:133:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:133:21: branch_true: following ‘true’ branch (when ‘i < nkeys’)...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:136:76: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:139:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:146:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:153:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:159:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:159:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:160:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:160:25: danger: dereference of NULL ‘argtypes + (long unsigned int)i * 4’
#  158|   
#  159|   		if (plan->nplans <= 0)	/* Get typeId of column */
#  160|-> 			argtypes[i] = SPI_gettypeid(tupdesc, fnumber);
#  161|   	}
#  162|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def148]
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:407:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argtypes’
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:275:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:280:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:285:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:285:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:290:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:297:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:299:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:306:12: branch_false: following ‘false’ branch (when ‘nargs > 4’)...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:311:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:312:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:315:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:322:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:331:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:339:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:349:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:355:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:355:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:361:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:361:21: branch_true: following ‘true’ branch (when ‘i < nkeys’)...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:364:76: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:367:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:374:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:381:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:392:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:392:20: branch_true: following ‘true’ branch (when ‘newtuple’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:394:46: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:398:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:401:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:402:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:406:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:406:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:407:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/spi/refint.c:407:25: danger: dereference of NULL ‘argtypes + (long unsigned int)i * 4’
#  405|   
#  406|   		if (plan->nplans <= 0)	/* Get typeId of column */
#  407|-> 			argtypes[i] = SPI_gettypeid(tupdesc, fnumber);
#  408|   	}
#  409|   	args_temp = args;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def149]
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:256:41: warning[-Wanalyzer-null-argument]: use of NULL ‘trg’ where non-null expected
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:104:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:117:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:119:17: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:119:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:119:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:226:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:234:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:234:36: branch_false: following ‘false’ branch (when ‘state != 4’)...
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:238:50: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:238:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:254:61: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/unaccent/unaccent.c:256:41: danger: argument 2 (‘trg’) NULL where non-null expected
#  254|   					trgstore = (char *) palloc(sizeof(char) * trglen);
#  255|   					trgstorelen = trglen;
#  256|-> 					memcpy(trgstore, trg, trgstorelen);
#  257|   				}
#  258|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def150]
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:814:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:722:1: enter_function: entry to ‘brin_range_deserialize’
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:790:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:799:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:799:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:801:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:801:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:810:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:810:25: branch_true: following ‘true’ branch (when ‘typlen > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:812:44: call_function: inlined call to ‘PointerGetDatum’ from ‘brin_range_deserialize’
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:814:25: danger: argument 1 (‘dataptr’) NULL where non-null expected
#  812|   			range->values[i] = PointerGetDatum(dataptr);
#  813|   
#  814|-> 			memcpy(dataptr, ptr, typlen);
#  815|   			dataptr += MAXALIGN(typlen);
#  816|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def151]
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:823:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:790:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:799:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:799:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:801:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:810:25: branch_false: following ‘false’ branch (when ‘typlen <= 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:819:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:823:25: danger: argument 1 (‘dataptr’) NULL where non-null expected
#  821|   			range->values[i] = PointerGetDatum(dataptr);
#  822|   
#  823|-> 			memcpy(dataptr, ptr, VARSIZE_ANY(ptr));
#  824|   			dataptr += MAXALIGN(VARSIZE_ANY(ptr));
#  825|   			ptr += VARSIZE_ANY(ptr);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def152]
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:833:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:790:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:799:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:799:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:801:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:801:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:810:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:810:25: branch_false: following ‘false’ branch (when ‘typlen <= 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:819:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:819:25: branch_false: following ‘false’ branch (when ‘typlen != -1’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:827:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:827:25: branch_true: following ‘true’ branch (when ‘typlen == -2’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:829:48: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_minmax_multi.c:833:25: danger: argument 1 (‘dataptr’) NULL where non-null expected
#  831|   			range->values[i] = PointerGetDatum(dataptr);
#  832|   
#  833|-> 			memcpy(dataptr, ptr, slen);
#  834|   			dataptr += MAXALIGN(slen);
#  835|   			ptr += slen;

Error: CPPCHECK_WARNING (CWE-476): [#def153]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:970: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  968|   		len += targetDataLen;
#  969|   
#  970|-> 		*targetMinimalTuple = (MinimalTuple) palloc0(len);
#  971|   		(*targetMinimalTuple)->t_len = len;
#  972|   		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;

Error: CPPCHECK_WARNING (CWE-476): [#def154]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:971: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  969|   
#  970|   		*targetMinimalTuple = (MinimalTuple) palloc0(len);
#  971|-> 		(*targetMinimalTuple)->t_len = len;
#  972|   		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
#  973|   		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;

Error: CPPCHECK_WARNING (CWE-476): [#def155]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:972: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  970|   		*targetMinimalTuple = (MinimalTuple) palloc0(len);
#  971|   		(*targetMinimalTuple)->t_len = len;
#  972|-> 		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
#  973|   		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;
#  974|   		/* Same macro works for MinimalTuples */

Error: CPPCHECK_WARNING (CWE-476): [#def156]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:973: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  971|   		(*targetMinimalTuple)->t_len = len;
#  972|   		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
#  973|-> 		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;
#  974|   		/* Same macro works for MinimalTuples */
#  975|   		HeapTupleHeaderSetNatts(*targetMinimalTuple, natts);

Error: CPPCHECK_WARNING (CWE-476): [#def157]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:975: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  973|   		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;
#  974|   		/* Same macro works for MinimalTuples */
#  975|-> 		HeapTupleHeaderSetNatts(*targetMinimalTuple, natts);
#  976|   		if (targetNullLen > 0)
#  977|   			nullBits = (bits8 *) ((char *) *targetMinimalTuple

Error: CPPCHECK_WARNING (CWE-476): [#def158]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:979: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  977|   			nullBits = (bits8 *) ((char *) *targetMinimalTuple
#  978|   								  + offsetof(MinimalTupleData, t_bits));
#  979|-> 		targetData = (char *) *targetMinimalTuple + hoff;
#  980|   		infoMask = &((*targetMinimalTuple)->t_infomask);
#  981|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def159]
postgresql-18beta1/postgresql-17.2/src/backend/access/common/heaptuple.c:980: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  978|   								  + offsetof(MinimalTupleData, t_bits));
#  979|   		targetData = (char *) *targetMinimalTuple + hoff;
#  980|-> 		infoMask = &((*targetMinimalTuple)->t_infomask);
#  981|   	}
#  982|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def160]
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:576:25: warning[-Wanalyzer-null-argument]: use of NULL ‘newrootpg’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:823:17: call_function: calling ‘ginFinishOldSplit’ from ‘ginInsertValue’
#  574|   			/* Splitting the root, three pages to update */
#  575|   			MarkBufferDirty(lbuffer);
#  576|-> 			memcpy(page, newrootpg, BLCKSZ);
#  577|   			memcpy(BufferGetPage(lbuffer), newlpage, BLCKSZ);
#  578|   			memcpy(BufferGetPage(rbuffer), newrpage, BLCKSZ);

Error: CPPCHECK_WARNING (CWE-457): [#def161]
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginentrypage.c:630: error[legacyUninitvar]: Uninitialized variable: tupstore
#  628|   	 */
#  629|   	maxoff = PageGetMaxOffsetNumber(lpage);
#  630|-> 	ptr = tupstore[0].data;
#  631|   	for (i = FirstOffsetNumber; i <= maxoff; i++)
#  632|   	{

Error: GCC_ANALYZER_WARNING (CWE-457): [#def162]
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1697:61: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘category[<unknown>]’
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1641:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1643:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1645:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1647:54: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1662:40: branch_true: following ‘true’ branch (when ‘StopLow < StopHigh’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1666:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1672:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1677:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1677:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1683:45: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1683:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1691:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1691:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1694:53: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1694:52: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1697:61: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1697:61: danger: use of uninitialized value ‘category[<unknown>]’ here
# 1695|   						{
# 1696|   							/* match anything except NULL_ITEM */
# 1697|-> 							if (category[StopMiddle - 1] == GIN_CAT_NULL_ITEM)
# 1698|   								res = -1;
# 1699|   							else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def163]
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1710:55: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘category[<unknown>]’
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1641:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1643:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1645:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1647:54: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1662:40: branch_true: following ‘true’ branch (when ‘StopLow < StopHigh’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1666:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1672:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1677:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1677:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1683:45: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1683:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1691:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1691:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1710:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginget.c:1710:55: danger: use of uninitialized value ‘category[<unknown>]’ here
# 1708|   					else
# 1709|   					{
# 1710|-> 						res = ginCompareEntries(&so->ginstate,
# 1711|   												entry->attnum,
# 1712|   												entry->queryKey,

Error: CPPCHECK_WARNING (CWE-457): [#def164]
postgresql-18beta1/postgresql-17.2/src/backend/access/gist/gistutil.c:206: error[uninitvar]: Uninitialized variable: &attrsize
#  204|   										giststate->supportCollation[i],
#  205|   										PointerGetDatum(evec),
#  206|-> 										PointerGetDatum(&attrsize));
#  207|   
#  208|   			isnull[i] = false;

Error: CPPCHECK_WARNING (CWE-457): [#def165]
postgresql-18beta1/postgresql-17.2/src/backend/access/gist/gistutil.c:275: error[uninitvar]: Uninitialized variable: &dstsize
#  273|   								 giststate->supportCollation[attno],
#  274|   								 PointerGetDatum(evec),
#  275|-> 								 PointerGetDatum(&dstsize));
#  276|   	}
#  277|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def166]
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1531:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1516:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1521:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1529:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1530:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1531:24: release_memory: using NULL here
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1531:17: danger: argument 1 (‘*rel.rd_amcache’) NULL where non-null expected
# 1529|   		if (rel->rd_amcache == NULL)
# 1530|   			rel->rd_amcache = cache;
# 1531|-> 		memcpy(rel->rd_amcache, HashPageGetMeta(page),
# 1532|   			   sizeof(HashMetaPageData));
# 1533|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def167]
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1531:17: warning[-Wanalyzer-null-argument]: use of NULL ‘*rel.rd_amcache’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1559:1: enter_function: entry to ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1573:17: call_function: calling ‘_hash_getcachedmetap’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1573:17: return_function: returning to ‘_hash_getbucketbuf_from_hashkey’ from ‘_hash_getcachedmetap’
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1592:23: call_function: calling ‘_hash_getbuf’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1592:23: return_function: returning to ‘_hash_getbucketbuf_from_hashkey’ from ‘_hash_getbuf’
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1601:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1605:17: call_function: inlined call to ‘_hash_relbuf’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/postgresql-17.2/src/backend/access/hash/hashpage.c:1606:25: call_function: calling ‘_hash_getcachedmetap’ from ‘_hash_getbucketbuf_from_hashkey’
# 1529|   		if (rel->rd_amcache == NULL)
# 1530|   			rel->rd_amcache = cache;
# 1531|-> 		memcpy(rel->rd_amcache, HashPageGetMeta(page),
# 1532|   			   sizeof(HashMetaPageData));
# 1533|   

Error: CPPCHECK_WARNING (CWE-457): [#def168]
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:5782: error[legacyUninitvar]: Uninitialized variable: status
# 5780|   				}
# 5781|   
# 5782|-> 				result = test_lockmode_for_conflict(status, rawxmax, mode,
# 5783|   													&mytup, &needwait);
# 5784|   

Error: CPPCHECK_WARNING (CWE-457): [#def169]
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:6327: error[legacyUninitvar]: Uninitialized variable: ret
# 6325|   	 * don't bother optimizing that.
# 6326|   	 */
# 6327|-> 	if (!ret)
# 6328|   	{
# 6329|   		UnlockTuple(relation, &oldtup.t_self, InplaceUpdateTupleLock);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def170]
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9969:63: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9843:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9884:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9915:12: branch_true: following ‘true’ branch (when ‘newaction == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9922:27: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9928:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9931:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9931:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9934:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9937:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9944:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9958:20: branch_true: following ‘true’ branch (when ‘prefixlen != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9963:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam.c:9969:63: danger: dereference of NULL ‘oldtup.t_data’
# 9967|   
# 9968|   			/* copy prefix from old tuple */
# 9969|-> 			memcpy(newp, (char *) oldtup.t_data + oldtup.t_data->t_hoff, prefixlen);
# 9970|   			newp += prefixlen;
# 9971|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def171]
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:178:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:162:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:164:35: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:170:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:171:21: branch_true: following ‘true’ branch (when ‘i < maxargs’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:173:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:178:26: throw: if ‘IsBinaryCoercible’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/access/index/amvalidate.c:178:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  176|   			continue;
#  177|   		if (exact ? (argtype != procform->proargtypes.values[i]) :
#  178|-> 			!IsBinaryCoercible(argtype, procform->proargtypes.values[i]))
#  179|   			result = false;
#  180|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def172]
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:1163:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘split’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:934:1: enter_function: entry to ‘_bt_strategy’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:954:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:961:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:961:9: call_function: calling ‘_bt_interval_edges’ from ‘_bt_strategy’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:961:9: return_function: returning to ‘_bt_strategy’ from ‘_bt_interval_edges’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:962:20: release_memory: ‘leftinterval’ is NULL
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:962:20: call_function: calling ‘_bt_split_lastleft’ from ‘_bt_strategy’
# 1161|   	ItemId		itemid;
# 1162|   
# 1163|-> 	if (split->newitemonleft && split->firstrightoff == state->newitemoff)
# 1164|   		return state->newitem;
# 1165|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:1179:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘split’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:934:1: enter_function: entry to ‘_bt_strategy’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:954:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:961:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:961:9: call_function: calling ‘_bt_interval_edges’ from ‘_bt_strategy’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:961:9: return_function: returning to ‘_bt_strategy’ from ‘_bt_interval_edges’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:963:21: release_memory: ‘rightinterval’ is NULL
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtsplitloc.c:963:21: call_function: calling ‘_bt_split_firstright’ from ‘_bt_strategy’
# 1177|   	ItemId		itemid;
# 1178|   
# 1179|-> 	if (!split->newitemonleft && split->firstrightoff == state->newitemoff)
# 1180|   		return state->newitem;
# 1181|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def174]
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgscan.c:123:17: warning[-Wanalyzer-null-argument]: use of NULL ‘distances’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgscan.c:942:1: enter_function: entry to ‘spggetbitmap’
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgscan.c:952:9: call_function: calling ‘spgWalk’ from ‘spggetbitmap’
#  121|   
#  122|   	if (!isnull && so->numberOfNonNullOrderBys > 0)
#  123|-> 		memcpy(item->distances, distances,
#  124|   			   sizeof(item->distances[0]) * so->numberOfNonNullOrderBys);
#  125|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def175]
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:795:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:994:1: enter_function: entry to ‘spgFormInnerTuple’
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1037:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1037:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1037:13: branch_false: following ‘false’ branch (when ‘nNodes <= 8191’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1043:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1049:12: branch_true: following ‘true’ branch (when ‘hasPrefix != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1050:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1050:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1050:17: call_function: inlined call to ‘memcpyInnerDatum’ from ‘spgFormInnerTuple’
#  793|   	if (att->attbyval)
#  794|   	{
#  795|-> 		memcpy(target, &datum, sizeof(Datum));
#  796|   	}
#  797|   	else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def176]
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:800:17: warning[-Wanalyzer-null-argument]: use of NULL ‘target’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:994:1: enter_function: entry to ‘spgFormInnerTuple’
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1037:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1037:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1037:13: branch_false: following ‘false’ branch (when ‘nNodes <= 8191’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1043:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1049:12: branch_true: following ‘true’ branch (when ‘hasPrefix != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1050:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1050:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/spgist/spgutils.c:1050:17: call_function: inlined call to ‘memcpyInnerDatum’ from ‘spgFormInnerTuple’
#  798|   	{
#  799|   		size = (att->attlen > 0) ? att->attlen : VARSIZE_ANY(datum);
#  800|-> 		memcpy(target, DatumGetPointer(datum), size);
#  801|   	}
#  802|   }

Error: CPPCHECK_WARNING (CWE-457): [#def177]
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/commit_ts.c:452: warning[uninitvar]: Uninitialized variable: values
#  450|   	}
#  451|   
#  452|-> 	htup = heap_form_tuple(tupdesc, values, nulls);
#  453|   
#  454|   	PG_RETURN_DATUM(HeapTupleGetDatum(htup));

Error: CPPCHECK_WARNING (CWE-457): [#def178]
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/commit_ts.c:493: warning[uninitvar]: Uninitialized variable: values
#  491|   	}
#  492|   
#  493|-> 	htup = heap_form_tuple(tupdesc, values, nulls);
#  494|   
#  495|   	PG_RETURN_DATUM(HeapTupleGetDatum(htup));

Error: CPPCHECK_WARNING (CWE-476): [#def179]
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/twophase.c:1053: error[ctunullpointer]: Null pointer dereference: data
# 1051|   	}
# 1052|   
# 1053|-> 	memcpy(((char *) records.tail->data) + records.tail->len, data, len);
# 1054|   	records.tail->len += padlen;
# 1055|   	records.bytes_free -= padlen;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def180]
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:6051:76: warning[-Wanalyzer-null-argument]: use of NULL ‘twophase_gid’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:5162:1: enter_function: entry to ‘AbortSubTransaction’
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:5219:9: call_function: calling ‘ShowTransactionState’ from ‘AbortSubTransaction’
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:5219:9: return_function: returning to ‘AbortSubTransaction’ from ‘ShowTransactionState’
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:5255:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:5257:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xact.c:5267:24: call_function: calling ‘RecordTransactionAbort’ from ‘AbortSubTransaction’
# 6049|   		XLogRegisterData((char *) (&xl_twophase), sizeof(xl_xact_twophase));
# 6050|   		if (xl_xinfo.xinfo & XACT_XINFO_HAS_GID)
# 6051|-> 			XLogRegisterData(unconstify(char *, twophase_gid), strlen(twophase_gid) + 1);
# 6052|   	}
# 6053|   

Error: CPPCHECK_WARNING (CWE-682): [#def181]
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xlog.c:1649: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1647|   		Assert(((XLogPageHeader) cachedPos)->xlp_magic == XLOG_PAGE_MAGIC);
# 1648|   		Assert(((XLogPageHeader) cachedPos)->xlp_pageaddr == ptr - (ptr % XLOG_BLCKSZ));
# 1649|-> 		return cachedPos + ptr % XLOG_BLCKSZ;
# 1650|   	}
# 1651|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def182]
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xlogreader.c:78:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xlogreader.c:77:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xlogreader.c:78:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/access/transam/xlogreader.c:78:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   76|   
#   77|   	va_start(args, fmt);
#   78|-> 	vsnprintf(state->errormsg_buf, MAX_ERRORMSG_LEN, fmt, args);
#   79|   	va_end(args);
#   80|   

Error: CPPCHECK_WARNING (CWE-457): [#def183]
postgresql-18beta1/postgresql-17.2/src/backend/backup/basebackup_copy.c:418: warning[uninitvar]: Uninitialized variable: values
#  416|   			nulls[2] = true;
#  417|   
#  418|-> 		do_tup_output(tstate, values, nulls);
#  419|   	}
#  420|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def184]
postgresql-18beta1/postgresql-17.2/src/backend/backup/basebackup_incremental.c:1025:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/backup/basebackup_incremental.c:1024:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/backup/basebackup_incremental.c:1025:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/backup/basebackup_incremental.c:1025:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1023|   
# 1024|   		va_start(ap, fmt);
# 1025|-> 		needed = appendStringInfoVA(&errbuf, fmt, ap);
# 1026|   		va_end(ap);
# 1027|   		if (needed == 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def185]
postgresql-18beta1/postgresql-17.2/src/backend/backup/walsummary.c:332:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/backup/walsummary.c:331:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/backup/walsummary.c:332:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/backup/walsummary.c:332:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  330|   	{
#  331|   		va_start(ap, fmt);
#  332|-> 		needed = appendStringInfoVA(&buf, fmt, ap);
#  333|   		va_end(ap);
#  334|   		if (needed == 0)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def186]
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1142:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1100:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1106:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1129:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1131:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1140:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1142:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootparse.c:1142:9: danger: use of uninitialized value ‘yyss’ here
# 1140|           if (! yyptr)
# 1141|             YYNOMEM;
# 1142|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1143|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1144|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1778:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1765:21: enter_function: entry to ‘boot_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1769:24: call_function: inlined call to ‘boot_yyalloc’ from ‘boot_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1770:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1773:2: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1778:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1776|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1777|   	 * we need to put in 2 end-of-buffer characters.
# 1778|-> 	 */
# 1779|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1780|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def188]
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1819: warning[nullPointer]: Possible null pointer dereference: b
# 1817|       
# 1818|   	yy_flush_buffer( b );
# 1819|-> 
# 1820|   	b->yy_input_file = file;
# 1821|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def189]
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1820: warning[nullPointer]: Possible null pointer dereference: b
# 1818|   	yy_flush_buffer( b );
# 1819|   
# 1820|-> 	b->yy_input_file = file;
# 1821|   	b->yy_fill_buffer = 1;
# 1822|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def190]
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1981:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1967:17: enter_function: entry to ‘boot_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1977:24: call_function: inlined call to ‘boot_yyalloc’ from ‘boot_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1978:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1981:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:1991:2: call_function: calling ‘boot_yy_switch_to_buffer’ from ‘boot_yy_scan_buffer’
# 1979|   	if ( ! b )
# 1980|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 1981|-> 
# 1982|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 1983|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def191]
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:2033:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:2017:17: enter_function: entry to ‘boot_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:2026:24: call_function: inlined call to ‘boot_yyalloc’ from ‘boot_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:2027:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:2027:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/bootstrap/bootscanner.c:2035:6: call_function: calling ‘boot_yy_scan_buffer’ from ‘boot_yy_scan_bytes’
# 2031|   	for ( i = 0; i < _yybytes_len; ++i )
# 2032|   		buf[i] = yybytes[i];
# 2033|-> 
# 2034|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 2035|   

Error: CPPCHECK_WARNING (CWE-768): [#def192]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:2318: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(typename)},((union ListCell){.ptr_value=((list_nth_cell(args,0)->ptr_value))})' depends on order of evaluation of side effects
# 2316|   		case OBJECT_DOMCONSTRAINT:
# 2317|   		case OBJECT_TRANSFORM:
# 2318|-> 			objnode = (Node *) list_make2(typename, linitial(args));
# 2319|   			break;
# 2320|   		case OBJECT_PUBLICATION_REL:

Error: CPPCHECK_WARNING (CWE-768): [#def193]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:2321: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(name)},((union ListCell){.ptr_value=((list_nth_cell(args,0)->ptr_value))})' depends on order of evaluation of side effects
# 2319|   			break;
# 2320|   		case OBJECT_PUBLICATION_REL:
# 2321|-> 			objnode = (Node *) list_make2(name, linitial(args));
# 2322|   			break;
# 2323|   		case OBJECT_PUBLICATION_NAMESPACE:

Error: CPPCHECK_WARNING (CWE-768): [#def194]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:2325: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=((list_nth_cell(name,0)->ptr_value))}),((union ListCell){.ptr_value=((list_nth_cell(args,0)->ptr_value))})' depends on order of evaluation of side effects
# 2323|   		case OBJECT_PUBLICATION_NAMESPACE:
# 2324|   		case OBJECT_USER_MAPPING:
# 2325|-> 			objnode = (Node *) list_make2(linitial(name), linitial(args));
# 2326|   			break;
# 2327|   		case OBJECT_DEFACL:

Error: CPPCHECK_WARNING (CWE-768): [#def195]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:2332: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(name)},(union ListCell){.ptr_value=(args)}' depends on order of evaluation of side effects
# 2330|   		case OBJECT_AMOP:
# 2331|   		case OBJECT_AMPROC:
# 2332|-> 			objnode = (Node *) list_make2(name, args);
# 2333|   			break;
# 2334|   		case OBJECT_FUNCTION:

Error: CPPCHECK_WARNING (CWE-768): [#def196]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:4860: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((coll->collname).data))}' depends on order of evaluation of side effects
# 4858|   																  NameStr(coll->collname)));
# 4859|   				if (objname)
# 4860|-> 					*objname = list_make2(schema,
# 4861|   										  pstrdup(NameStr(coll->collname)));
# 4862|   				ReleaseSysCache(collTup);

Error: CPPCHECK_WARNING (CWE-768): [#def197]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:4934: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((conForm->conname).data))}' depends on order of evaluation of side effects
# 4932|   																  NameStr(conForm->conname)));
# 4933|   				if (objname)
# 4934|-> 					*objname = list_make2(schema,
# 4935|   										  pstrdup(NameStr(conForm->conname)));
# 4936|   				ReleaseSysCache(conTup);

Error: CPPCHECK_WARNING (CWE-768): [#def198]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5040: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(schema)}' depends on order of evaluation of side effects
# 5038|   								 quote_identifier(NameStr(amForm->amname)));
# 5039|   				if (objname)
# 5040|-> 					*objname = list_make3(pstrdup(NameStr(amForm->amname)),
# 5041|   										  schema,
# 5042|   										  pstrdup(NameStr(opcForm->opcname)));

Error: CPPCHECK_WARNING (CWE-768): [#def199]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5040: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((opcForm->opcname).data))}' depends on order of evaluation of side effects
# 5038|   								 quote_identifier(NameStr(amForm->amname)));
# 5039|   				if (objname)
# 5040|-> 					*objname = list_make3(pstrdup(NameStr(amForm->amname)),
# 5041|   										  schema,
# 5042|   										  pstrdup(NameStr(opcForm->opcname)));

Error: CPPCHECK_WARNING (CWE-768): [#def200]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5120: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltype)},(union ListCell){.ptr_value=(rtype)}' depends on order of evaluation of side effects
# 5118|   					*objname = lappend(*objname,
# 5119|   									   psprintf("%d", amopForm->amopstrategy));
# 5120|-> 					*objargs = list_make2(ltype, rtype);
# 5121|   				}
# 5122|   

Error: CPPCHECK_WARNING (CWE-768): [#def201]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5182: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltype)},(union ListCell){.ptr_value=(rtype)}' depends on order of evaluation of side effects
# 5180|   					*objname = lappend(*objname,
# 5181|   									   psprintf("%d", amprocForm->amprocnum));
# 5182|-> 					*objargs = list_make2(ltype, rtype);
# 5183|   				}
# 5184|   

Error: CPPCHECK_WARNING (CWE-768): [#def202]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5302: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formStatistic->stxname).data))}' depends on order of evaluation of side effects
# 5300|   																  NameStr(formStatistic->stxname)));
# 5301|   				if (objname)
# 5302|-> 					*objname = list_make2(schema,
# 5303|   										  pstrdup(NameStr(formStatistic->stxname)));
# 5304|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def203]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5329: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formParser->prsname).data))}' depends on order of evaluation of side effects
# 5327|   																  NameStr(formParser->prsname)));
# 5328|   				if (objname)
# 5329|-> 					*objname = list_make2(schema,
# 5330|   										  pstrdup(NameStr(formParser->prsname)));
# 5331|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def204]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5356: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formDict->dictname).data))}' depends on order of evaluation of side effects
# 5354|   																  NameStr(formDict->dictname)));
# 5355|   				if (objname)
# 5356|-> 					*objname = list_make2(schema,
# 5357|   										  pstrdup(NameStr(formDict->dictname)));
# 5358|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def205]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5383: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formTmpl->tmplname).data))}' depends on order of evaluation of side effects
# 5381|   																  NameStr(formTmpl->tmplname)));
# 5382|   				if (objname)
# 5383|-> 					*objname = list_make2(schema,
# 5384|   										  pstrdup(NameStr(formTmpl->tmplname)));
# 5385|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def206]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5410: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formCfg->cfgname).data))}' depends on order of evaluation of side effects
# 5408|   																  NameStr(formCfg->cfgname)));
# 5409|   				if (objname)
# 5410|-> 					*objname = list_make2(schema,
# 5411|   										  pstrdup(NameStr(formCfg->cfgname)));
# 5412|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def207]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5955: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(pstrdup(schema))}' depends on order of evaluation of side effects
# 5953|   
# 5954|   	if (object)
# 5955|-> 		*object = list_make3(pstrdup(NameStr(amForm->amname)),
# 5956|   							 pstrdup(schema),
# 5957|   							 pstrdup(NameStr(opfForm->opfname)));

Error: CPPCHECK_WARNING (CWE-768): [#def208]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5955: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(pstrdup(schema))},(union ListCell){.ptr_value=(pstrdup((opfForm->opfname).data))}' depends on order of evaluation of side effects
# 5953|   
# 5954|   	if (object)
# 5955|-> 		*object = list_make3(pstrdup(NameStr(amForm->amname)),
# 5956|   							 pstrdup(schema),
# 5957|   							 pstrdup(NameStr(opfForm->opfname)));

Error: CPPCHECK_WARNING (CWE-768): [#def209]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/objectaddress.c:5993: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((relForm->relname).data))}' depends on order of evaluation of side effects
# 5991|   													  NameStr(relForm->relname)));
# 5992|   	if (object)
# 5993|-> 		*object = list_make2(schema, pstrdup(NameStr(relForm->relname)));
# 5994|   
# 5995|   	ReleaseSysCache(relTup);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def210]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:288:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partexprs_item’
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:255:1: enter_function: entry to ‘has_partition_attrs’
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:263:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:270:26: call_function: inlined call to ‘list_head’ from ‘has_partition_attrs’
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:271:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:271:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:273:45: call_function: inlined call to ‘get_partition_col_attnum’ from ‘has_partition_attrs’
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:275:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:288:37: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/catalog/partition.c:288:37: danger: dereference of NULL ‘partexprs_item’
#  286|   		{
#  287|   			/* Arbitrary expression */
#  288|-> 			Node	   *expr = (Node *) lfirst(partexprs_item);
#  289|   			Bitmapset  *expr_attrs = NULL;
#  290|   

Error: COMPILER_WARNING (CWE-704): [#def211]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/pg_type.c: scope_hint: In function ‘makeMultirangeTypeName’
postgresql-18beta1/postgresql-17.2/src/backend/catalog/pg_type.c:959:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  959 |         rangestr = strstr(rangeTypeName, "range");
#      |                  ^
#  957|   	 * "multirange". Otherwise add "_multirange" to the end.
#  958|   	 */
#  959|-> 	rangestr = strstr(rangeTypeName, "range");
#  960|   	if (rangestr)
#  961|   	{

Error: COMPILER_WARNING (CWE-704): [#def212]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/pg_type.c:959:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  957|   	 * "multirange". Otherwise add "_multirange" to the end.
#  958|   	 */
#  959|-> 	rangestr = strstr(rangeTypeName, "range");
#  960|   	if (rangestr)
#  961|   	{

Error: CPPCHECK_WARNING (CWE-768): [#def213]
postgresql-18beta1/postgresql-17.2/src/backend/catalog/toasting.c:324: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=("chunk_id")},(union ListCell){.ptr_value=("chunk_seq")}' depends on order of evaluation of side effects
#  322|   				 InvalidOid, InvalidOid,
#  323|   				 indexInfo,
#  324|-> 				 list_make2("chunk_id", "chunk_seq"),
#  325|   				 BTREE_AM_OID,
#  326|   				 rel->rd_rel->reltablespace,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def214]
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:600:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisdata’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:280:1: enter_function: entry to ‘do_analyze_rel’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:401:29: branch_false: following ‘false’ branch (when ‘i > attr_cnt’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:419:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:419:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:428:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:428:17: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:430:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:440:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:21: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:494:23: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:510:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:519:9: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:519:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:522:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:527:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:537:12: branch_true: following ‘true’ branch (when ‘numrows > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:542:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:550:29: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:579:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:579:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:585:17: call_function: inlined call to ‘MemoryContextSwitchTo’ from ‘do_analyze_rel’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:593:17: call_function: inlined call to ‘update_attstats’ from ‘do_analyze_rel’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:596:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:596:31: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:598:60: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:600:25: danger: dereference of NULL ‘thisdata’
#  598|   			AnlIndexData *thisdata = &indexdata[ind];
#  599|   
#  600|-> 			update_attstats(RelationGetRelid(Irel[ind]), false,
#  601|   							thisdata->attr_cnt, thisdata->vacattrstats);
#  602|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def215]
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:653:47: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisdata’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:401:29: branch_false: following ‘false’ branch (when ‘i > attr_cnt’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:419:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:419:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:428:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:428:17: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:430:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:440:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:21: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:494:23: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:510:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:519:9: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:519:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:522:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:527:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:623:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:627:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:648:31: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:650:60: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:653:47: danger: dereference of NULL ‘thisdata’
#  651|   			double		totalindexrows;
#  652|   
#  653|-> 			totalindexrows = ceil(thisdata->tupleFract * totalrows);
#  654|   			vac_update_relstats(Irel[ind],
#  655|   								RelationGetNumberOfBlocks(Irel[ind]),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def216]
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:848:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisdata’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:280:1: enter_function: entry to ‘do_analyze_rel’
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:401:29: branch_false: following ‘false’ branch (when ‘i > attr_cnt’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:419:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:419:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:428:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:428:17: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:430:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:440:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:21: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:489:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:494:23: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:510:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:519:9: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:519:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:522:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:527:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:537:12: branch_true: following ‘true’ branch (when ‘numrows > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:542:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:550:29: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:579:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:579:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:580:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/analyze.c:580:25: call_function: calling ‘compute_index_stats’ from ‘do_analyze_rel’
#  846|   	{
#  847|   		AnlIndexData *thisdata = &indexdata[ind];
#  848|-> 		IndexInfo  *indexInfo = thisdata->indexInfo;
#  849|   		int			attr_cnt = thisdata->attr_cnt;
#  850|   		TupleTableSlot *slot;

Error: CPPCHECK_WARNING (CWE-457): [#def217]
postgresql-18beta1/postgresql-17.2/src/backend/commands/conversioncmds.c:110: error[uninitvar]: Uninitialized variable: result
#  108|   	 * perform the requested conversion.
#  109|   	 */
#  110|-> 	funcresult = OidFunctionCall6(funcoid,
#  111|   								  Int32GetDatum(from_encoding),
#  112|   								  Int32GetDatum(to_encoding),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def218]
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:300:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:62:1: enter_function: entry to ‘DoCopy’
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:112:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:284:25: call_function: inlined call to ‘newNode’ from ‘DoCopy’
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:293:12: branch_true: following ‘true’ branch (when ‘is_from != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:300:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:300:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:300:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/commands/copy.c:300:38: danger: dereference of NULL ‘rel’
#  298|   
#  299|   		/* check read-only transaction and parallel mode */
#  300|-> 		if (XactReadOnly && !rel->rd_islocaltemp)
#  301|   			PreventCommandIfReadOnly("COPY FROM");
#  302|   

Error: CPPCHECK_WARNING (CWE-476): [#def219]
postgresql-18beta1/postgresql-17.2/src/backend/commands/extension.c:315: error[ctunullpointer]: Null pointer dereference: versionname
#  313|   check_valid_version_name(const char *versionname)
#  314|   {
#  315|-> 	int			namelen = strlen(versionname);
#  316|   
#  317|   	/*

Error: CPPCHECK_WARNING (CWE-476): [#def220]
postgresql-18beta1/postgresql-17.2/src/backend/commands/extension.c:315: warning[nullPointer]: Possible null pointer dereference: versionname
#  313|   check_valid_version_name(const char *versionname)
#  314|   {
#  315|-> 	int			namelen = strlen(versionname);
#  316|   
#  317|   	/*

Error: CPPCHECK_WARNING (CWE-476): [#def221]
postgresql-18beta1/postgresql-17.2/src/backend/commands/extension.c:3097: warning[nullPointer]: Possible null pointer dereference: versionName
# 3095|   	 * If we're already at that version, just say so
# 3096|   	 */
# 3097|-> 	if (strcmp(oldVersionName, versionName) == 0)
# 3098|   	{
# 3099|   		ereport(NOTICE,

Error: CPPCHECK_WARNING (CWE-457): [#def222]
postgresql-18beta1/postgresql-17.2/src/backend/commands/policy.c:128: error[legacyUninitvar]: Uninitialized variable: polcmd
#  126|   		elog(ERROR, "unrecognized policy command");
#  127|   
#  128|-> 	return polcmd;
#  129|   }
#  130|   

Error: CPPCHECK_WARNING (CWE-457): [#def223]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablecmds.c:8690: warning[uninitvar]: Uninitialized variable: repl_val
# 8688|   	repl_repl[Anum_pg_attribute_attstattarget - 1] = true;
# 8689|   	newtuple = heap_modify_tuple(tuple, RelationGetDescr(attrelation),
# 8690|-> 								 repl_val, repl_null, repl_repl);
# 8691|   	CatalogTupleUpdate(attrelation, &tuple->t_self, newtuple);
# 8692|   

Error: CPPCHECK_WARNING (CWE-457): [#def224]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablecmds.c:8764: warning[uninitvar]: Uninitialized variable: repl_val
# 8762|   	repl_repl[Anum_pg_attribute_attoptions - 1] = true;
# 8763|   	newtuple = heap_modify_tuple(tuple, RelationGetDescr(attrelation),
# 8764|-> 								 repl_val, repl_null, repl_repl);
# 8765|   
# 8766|   	/* Update system catalog. */

Error: CPPCHECK_WARNING (CWE-457): [#def225]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablecmds.c:12626: error[legacyUninitvar]: Uninitialized variable: contype
#12624|   	 * the dependency mechanism, so we're done here.
#12625|   	 */
#12626|-> 	if (contype != CONSTRAINT_CHECK &&
#12627|   		rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
#12628|   	{

Error: CPPCHECK_WARNING (CWE-768): [#def226]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablecmds.c:14202: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(get_namespace_name((rel)->rd_rel->relnamespace)))},(union ListCell){.ptr_value=(makeString(pstrdup((rel->rd_rel->relname).data)))}' depends on order of evaluation of side effects
#14200|   		cmd->objtype = OBJECT_TABCONSTRAINT;
#14201|   		cmd->object = (Node *)
#14202|-> 			list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
#14203|   					   makeString(pstrdup(RelationGetRelationName(rel))),
#14204|   					   makeString(pstrdup(conname)));

Error: CPPCHECK_WARNING (CWE-768): [#def227]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablecmds.c:14202: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(get_namespace_name((rel)->rd_rel->relnamespace)))},(union ListCell){.ptr_value=(makeString(pstrdup((rel->rd_rel->relname).data)))},(union ListCell){.ptr_value=(makeString(pstrdup(conname)))}' depends on order of evaluation of side effects
#14200|   		cmd->objtype = OBJECT_TABCONSTRAINT;
#14201|   		cmd->object = (Node *)
#14202|-> 			list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
#14203|   					   makeString(pstrdup(RelationGetRelationName(rel))),
#14204|   					   makeString(pstrdup(conname)));

Error: CPPCHECK_WARNING (CWE-768): [#def228]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablecmds.c:14210: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeTypeNameFromNameList((__typeof__(domname))copyObjectImpl(domname)))},(union ListCell){.ptr_value=(makeString(pstrdup(conname)))}' depends on order of evaluation of side effects
#14208|   		cmd->objtype = OBJECT_DOMCONSTRAINT;
#14209|   		cmd->object = (Node *)
#14210|-> 			list_make2(makeTypeNameFromNameList(copyObject(domname)),
#14211|   					   makeString(pstrdup(conname)));
#14212|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def229]
postgresql-18beta1/postgresql-17.2/src/backend/commands/tablespace.c:1068: warning[uninitvar]: Uninitialized variable: repl_val
# 1066|   		repl_null[Anum_pg_tablespace_spcoptions - 1] = true;
# 1067|   	repl_repl[Anum_pg_tablespace_spcoptions - 1] = true;
# 1068|-> 	newtuple = heap_modify_tuple(tup, RelationGetDescr(rel), repl_val,
# 1069|   								 repl_null, repl_repl);
# 1070|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def230]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:176:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘t’
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:137:1: enter_function: entry to ‘ExecInitJunkFilterConversion’
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:166:12: branch_true: following ‘true’ branch (when ‘cleanLength > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:168:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:169:21: call_function: inlined call to ‘list_head’ from ‘ExecInitJunkFilterConversion’
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:170:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:170:29: branch_true: following ‘true’ branch (when ‘i < cleanLength’)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:172:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/execJunk.c:176:46: danger: dereference of NULL ‘t’
#  174|   			for (;;)
#  175|   			{
#  176|-> 				TargetEntry *tle = lfirst(t);
#  177|   
#  178|   				t = lnext(targetList, t);

Error: CPPCHECK_WARNING (CWE-476): [#def231]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execProcnode.c:391: warning[nullPointer]: Possible null pointer dereference: result
#  389|   	}
#  390|   
#  391|-> 	ExecSetExecProcNode(result, result->ExecProcNode);
#  392|   
#  393|   	/*

Error: CPPCHECK_WARNING (CWE-476): [#def232]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execProcnode.c:407: warning[nullPointer]: Possible null pointer dereference: result
#  405|   		subps = lappend(subps, sstate);
#  406|   	}
#  407|-> 	result->initPlan = subps;
#  408|   
#  409|   	/* Set up instrumentation for this node if requested */

Error: CPPCHECK_WARNING (CWE-476): [#def233]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execProcnode.c:433: error[ctunullpointer]: Null pointer dereference: node
#  431|   	 * means we'll superfluously execute ExecProcNodeFirst, but that seems ok.
#  432|   	 */
#  433|-> 	node->ExecProcNodeReal = function;
#  434|   	node->ExecProcNode = ExecProcNodeFirst;
#  435|   }

Error: CPPCHECK_WARNING (CWE-476): [#def234]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execProcnode.c:433: warning[nullPointer]: Possible null pointer dereference: node
#  431|   	 * means we'll superfluously execute ExecProcNodeFirst, but that seems ok.
#  432|   	 */
#  433|-> 	node->ExecProcNodeReal = function;
#  434|   	node->ExecProcNode = ExecProcNodeFirst;
#  435|   }

Error: CPPCHECK_WARNING (CWE-476): [#def235]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execProcnode.c:434: warning[nullPointer]: Possible null pointer dereference: node
#  432|   	 */
#  433|   	node->ExecProcNodeReal = function;
#  434|-> 	node->ExecProcNode = ExecProcNodeFirst;
#  435|   }
#  436|   

Error: CPPCHECK_WARNING (CWE-457): [#def236]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execScan.c:337: error[legacyUninitvar]: Uninitialized variable: relids
#  335|   					 (int) nodeTag(node->ps.plan));
#  336|   
#  337|-> 			while ((rtindex = bms_next_member(relids, rtindex)) >= 0)
#  338|   			{
#  339|   				Assert(rtindex > 0);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def237]
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2372:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘isnull’
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2390:1: enter_function: entry to ‘do_text_output_multiline’
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2395:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2400:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2401:20: branch_true: following ‘true’ branch (when ‘eol’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2403:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/execTuples.c:2413:17: call_function: calling ‘do_tup_output’ from ‘do_text_output_multiline’
# 2370|   	/* insert data */
# 2371|   	memcpy(slot->tts_values, values, natts * sizeof(Datum));
# 2372|-> 	memcpy(slot->tts_isnull, isnull, natts * sizeof(bool));
# 2373|   
# 2374|   	/* mark slot as containing a virtual tuple */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def238]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1210:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1191:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1197:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1210:31: danger: dereference of NULL ‘leftop’
# 1208|   			Assert(leftop != NULL);
# 1209|   
# 1210|-> 			if (!(IsA(leftop, Var) &&
# 1211|   				  ((Var *) leftop)->varno == INDEX_VAR))
# 1212|   				elog(ERROR, "indexqual doesn't have key on left side");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def239]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1242:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1135:1: enter_function: entry to ‘ExecIndexBuildScanKeys’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1191:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1197:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1203:43: call_function: inlined call to ‘get_leftop’ from ‘ExecIndexBuildScanKeys’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1205:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1205:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1210:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1211:35: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1210:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1214:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1215:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1242:29: danger: dereference of NULL ‘rightop’
# 1240|   			Assert(rightop != NULL);
# 1241|   
# 1242|-> 			if (IsA(rightop, Const))
# 1243|   			{
# 1244|   				/* OK, simple constant comparison value */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def240]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1327:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1306:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1327:39: danger: dereference of NULL ‘leftop’
# 1325|   				Assert(leftop != NULL);
# 1326|   
# 1327|-> 				if (!(IsA(leftop, Var) &&
# 1328|   					  ((Var *) leftop)->varno == INDEX_VAR))
# 1329|   					elog(ERROR, "indexqual doesn't have key on left side");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1366:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1306:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1322:36: branch_true: following ‘true’ branch (when ‘leftop’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1322:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1327:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1328:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1327:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1331:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1337:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1337:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1340:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1347:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1350:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1354:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1361:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1366:37: danger: dereference of NULL ‘rightop’
# 1364|   				Assert(rightop != NULL);
# 1365|   
# 1366|-> 				if (IsA(rightop, Const))
# 1367|   				{
# 1368|   					/* OK, simple constant comparison value */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def242]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1451:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1288:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1428:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1428:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1438:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1446:28: branch_false: following ‘false’ branch (when ‘leftop’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1451:31: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1451:31: danger: dereference of NULL ‘leftop’
# 1449|   			Assert(leftop != NULL);
# 1450|   
# 1451|-> 			if (!(IsA(leftop, Var) &&
# 1452|   				  ((Var *) leftop)->varno == INDEX_VAR))
# 1453|   				elog(ERROR, "indexqual doesn't have key on left side");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def243]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1484:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1288:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1428:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1428:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1438:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1446:28: branch_true: following ‘true’ branch (when ‘leftop’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1446:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1451:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1452:35: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1451:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1455:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1456:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1475:28: branch_false: following ‘false’ branch (when ‘rightop’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1480:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1480:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1484:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1484:37: danger: dereference of NULL ‘rightop’
# 1482|   				/* Index AM will handle this like a simple operator */
# 1483|   				flags |= SK_SEARCHARRAY;
# 1484|-> 				if (IsA(rightop, Const))
# 1485|   				{
# 1486|   					/* OK, simple constant comparison value */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def244]
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1565:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1175:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1288:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1428:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1428:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1547:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1547:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1558:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1560:28: branch_false: following ‘false’ branch (when ‘leftop’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1565:31: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/executor/nodeIndexscan.c:1565:31: danger: dereference of NULL ‘leftop’
# 1563|   			Assert(leftop != NULL);
# 1564|   
# 1565|-> 			if (!(IsA(leftop, Var) &&
# 1566|   				  ((Var *) leftop)->varno == INDEX_VAR))
# 1567|   				elog(ERROR, "NullTest indexqual has wrong key");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
postgresql-18beta1/postgresql-17.2/src/backend/lib/pairingheap.c:275:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pairs’
postgresql-18beta1/postgresql-17.2/src/backend/lib/pairingheap.c:251:20: branch_true: following ‘true’ branch (when ‘next’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/lib/pairingheap.c:275:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/lib/pairingheap.c:275:9: danger: dereference of NULL ‘pairs’
#  273|   	 */
#  274|   	newroot = pairs;
#  275|-> 	next = pairs->next_sibling;
#  276|   	while (next)
#  277|   	{

Error: CPPCHECK_WARNING (CWE-457): [#def246]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth-scram.c:1174: warning[uninitvar]: Uninitialized variable: ClientKey
# 1172|   
# 1173|   	/* Hash it one more time, and compare with StoredKey */
# 1174|-> 	if (scram_H(ClientKey, state->hash_type, state->key_length,
# 1175|   				client_StoredKey, &errstr) < 0)
# 1176|   		elog(ERROR, "could not hash stored key: %s", errstr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:680:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  678|   	StringInfoData buf;
#  679|   
#  680|-> 	CHECK_FOR_INTERRUPTS();
#  681|   
#  682|   	pq_beginmessage(&buf, PqMsg_AuthenticationRequest);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:682:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  680|   	CHECK_FOR_INTERRUPTS();
#  681|   
#  682|-> 	pq_beginmessage(&buf, PqMsg_AuthenticationRequest);
#  683|   	pq_sendint32(&buf, (int32) areq);
#  684|   	if (extralen > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def249]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:687:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  685|   		pq_sendbytes(&buf, extradata, extralen);
#  686|   
#  687|-> 	pq_endmessage(&buf);
#  688|   
#  689|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def250]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:695:17: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  693|   	 */
#  694|   	if (areq != AUTH_REQ_OK && areq != AUTH_REQ_SASL_FIN)
#  695|-> 		pq_flush();
#  696|   
#  697|   	CHECK_FOR_INTERRUPTS();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:697:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  695|   		pq_flush();
#  696|   
#  697|-> 	CHECK_FOR_INTERRUPTS();
#  698|   }
#  699|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def252]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:711:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1970:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  709|   	int			mtype;
#  710|   
#  711|-> 	pq_startmsgread();
#  712|   
#  713|   	/* Expect 'p' message type */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:714:17: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1970:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  712|   
#  713|   	/* Expect 'p' message type */
#  714|-> 	mtype = pq_getbyte();
#  715|   	if (mtype != PqMsg_PasswordMessage)
#  716|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def254]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:723:25: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1970:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  721|   		 */
#  722|   		if (mtype != EOF)
#  723|-> 			ereport(ERROR,
#  724|   					(errcode(ERRCODE_PROTOCOL_VIOLATION),
#  725|   					 errmsg("expected password response, got message type %d",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:730:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1970:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  728|   	}
#  729|   
#  730|-> 	initStringInfo(&buf);
#  731|   	if (pq_getmessage(&buf, PG_MAX_AUTH_TOKEN_LENGTH))	/* receive password */
#  732|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:731:13: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1970:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  729|   
#  730|   	initStringInfo(&buf);
#  731|-> 	if (pq_getmessage(&buf, PG_MAX_AUTH_TOKEN_LENGTH))	/* receive password */
#  732|   	{
#  733|   		/* EOF - pq_getmessage already logged a suitable message */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1987:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1982:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1982:54: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1982:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1984:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1987:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1987:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
# 1985|   				break;
# 1986|   			case PAM_ERROR_MSG:
# 1987|-> 				ereport(LOG,
# 1988|   						(errmsg("error from underlying PAM layer: %s",
# 1989|   								msg[i]->msg)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def258]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1987:33: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1987:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1987:33: danger: ‘reply’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1985|   				break;
# 1986|   			case PAM_ERROR_MSG:
# 1987|-> 				ereport(LOG,
# 1988|   						(errmsg("error from underlying PAM layer: %s",
# 1989|   								msg[i]->msg)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1998:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1982:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1982:54: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1982:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1984:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1998:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1998:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/10)
# 1996|   				break;
# 1997|   			default:
# 1998|-> 				ereport(LOG,
# 1999|   						(errmsg("unsupported PAM conversation %d/\"%s\"",
# 2000|   								msg[i]->msg_style,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def260]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1998:33: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1998:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1998:33: danger: ‘reply’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1996|   				break;
# 1997|   			default:
# 1998|-> 				ereport(LOG,
# 1999|   						(errmsg("unsupported PAM conversation %d/\"%s\"",
# 2000|   								msg[i]->msg_style,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def261]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:2834:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:2934:1: enter_function: entry to ‘PerformRadiusTransaction’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:2974:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:2988:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:2995:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:3012:21: branch_false: following ‘false’ branch (when ‘i >= encryptedpasswordlen’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:3043:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:3045:9: call_function: calling ‘radius_add_attribute’ from ‘PerformRadiusTransaction’
# 2832|   	attr->attribute = type;
# 2833|   	attr->length = len + 2;		/* total size includes type and length */
# 2834|-> 	memcpy(attr->data, data, len);
# 2835|   	packet->length += attr->length;
# 2836|   }

Error: CPPCHECK_WARNING (CWE-457): [#def262]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:3045: warning[uninitvar]: Uninitialized variable: encryptedpassword
# 3043|   	pfree(cryptvector);
# 3044|   
# 3045|-> 	radius_add_attribute(packet, RADIUS_PASSWORD, encryptedpassword, encryptedpasswordlen);
# 3046|   
# 3047|   	/* Length needs to be in network order on the wire */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def263]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:1347:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:1322:1: enter_function: entry to ‘parse_hba_line’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:1346:17: call_function: inlined call to ‘list_head’ from ‘parse_hba_line’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:1347:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:1347:9: danger: dereference of NULL ‘<unknown>’
# 1345|   	Assert(tok_line->fields != NIL);
# 1346|   	field = list_head(tok_line->fields);
# 1347|-> 	tokens = lfirst(field);
# 1348|   	if (tokens->length > 1)
# 1349|   	{

Error: GCC_ANALYZER_WARNING (CWE-476): [#def264]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:2706:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:2689:1: enter_function: entry to ‘parse_ident_line’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:2700:17: call_function: inlined call to ‘list_head’ from ‘parse_ident_line’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:2702:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/hba.c:2706:9: danger: dereference of NULL ‘<unknown>’
# 2704|   
# 2705|   	/* Get the map token (must exist) */
# 2706|-> 	tokens = lfirst(field);
# 2707|   	IDENT_MULTI_VALUE(tokens);
# 2708|   	token = linitial(tokens);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def265]
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:552:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:446:12: branch_true: following ‘true’ branch (when ‘family == 1’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:452:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:453:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:461:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:472:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:487:28: branch_true: following ‘true’ branch (when ‘addr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:489:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:489:20: branch_false: following ‘false’ branch (when ‘family == 1’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:499:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:499:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:508:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:528:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:540:27: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:540:27: acquire_resource: stream socket created here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:540:20: branch_false: following ‘false’ branch (when ‘fd != -1’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:552:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:552:21: throw: if ‘fcntl’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/pqcomm.c:552:21: danger: ‘fd’ leaks here
#  550|   #ifndef WIN32
#  551|   		/* Don't give the listen socket to any subprograms we execute. */
#  552|-> 		if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
#  553|   			elog(FATAL, "fcntl(F_SETFD) failed on socket: %m");
#  554|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def266]
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:194:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(get_user_name_or_exit(progname))’
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:145:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:150:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:183:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:183:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:183:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:185:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:185:18: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:191:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:191:18: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:193:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:193:18: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:195:60: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:195:60: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/main/main.c:194:17: danger: ‘strdup(get_user_name_or_exit(progname))’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#  192|   		GucInfoMain();
#  193|   	else if (argc > 1 && strcmp(argv[1], "--single") == 0)
#  194|-> 		PostgresSingleUserMain(argc, argv,
#  195|   							   strdup(get_user_name_or_exit(progname)));
#  196|   	else

Error: CPPCHECK_WARNING (CWE-768): [#def267]
postgresql-18beta1/postgresql-17.2/src/backend/nodes/makefuncs.c:641: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},(union ListCell){.ptr_value=(rightop)}' depends on order of evaluation of side effects
#  639|   	expr->inputcollid = inputcollid;
#  640|   	if (rightop)
#  641|-> 		expr->args = list_make2(leftop, rightop);
#  642|   	else
#  643|   		expr->args = list_make1(leftop);

Error: CPPCHECK_WARNING (CWE-768): [#def268]
postgresql-18beta1/postgresql-17.2/src/backend/nodes/makefuncs.c:713: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(qual1)},(union ListCell){.ptr_value=(qual2)}' depends on order of evaluation of side effects
#  711|   	if (qual2 == NULL)
#  712|   		return qual1;
#  713|-> 	return (Node *) make_andclause(list_make2(qual1, qual2));
#  714|   }
#  715|   

Error: CPPCHECK_WARNING (CWE-768): [#def269]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:3209: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(rightop)},(union ListCell){.ptr_value=(leftop)}' depends on order of evaluation of side effects
# 3207|   		newclause->opno = expr_op;
# 3208|   		newclause->opfuncid = InvalidOid;
# 3209|-> 		newclause->args = list_make2(rightop, leftop);
# 3210|   
# 3211|   		clause = (Expr *) newclause;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def270]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/analyzejoins.c:1112:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/analyzejoins.c:861:1: enter_function: entry to ‘rel_is_distinct_for’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/analyzejoins.c:939:21: call_function: calling ‘query_is_distinct_for’ from ‘rel_is_distinct_for’
# 1110|   				/* non-resjunk columns should have grouping clauses */
# 1111|   				Assert(lg != NULL);
# 1112|-> 				sgc = (SortGroupClause *) lfirst(lg);
# 1113|   				lg = lnext(topop->groupClauses, lg);
# 1114|   

Error: CPPCHECK_WARNING (CWE-768): [#def271]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/initsplan.c:1073: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftjoinlist)},(union ListCell){.ptr_value=(rightjoinlist)}' depends on order of evaluation of side effects
# 1071|   		{
# 1072|   			/* force the join order exactly at this node */
# 1073|-> 			joinlist = list_make1(list_make2(leftjoinlist, rightjoinlist));
# 1074|   		}
# 1075|   		else if (list_length(leftjoinlist) + list_length(rightjoinlist) <=

Error: CPPCHECK_WARNING (CWE-768): [#def272]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/initsplan.c:1096: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftpart)},(union ListCell){.ptr_value=(rightpart)}' depends on order of evaluation of side effects
# 1094|   			else
# 1095|   				rightpart = (Node *) rightjoinlist;
# 1096|-> 			joinlist = list_make2(leftpart, rightpart);
# 1097|   		}
# 1098|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4078:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partially_grouped_rel’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4044:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4065:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4065:9: release_memory: ‘partially_grouped_rel’ is NULL
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4068:12: branch_false: following ‘false’ branch (when ‘patype == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4074:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4074:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4078:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:4078:21: danger: dereference of NULL ‘partially_grouped_rel’
# 4076|   		Assert(partially_grouped_rel);
# 4077|   
# 4078|-> 		if (partially_grouped_rel->pathlist)
# 4079|   			set_cheapest(partially_grouped_rel);
# 4080|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def274]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5686:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘orig_tlist_item’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5671:1: enter_function: entry to ‘postprocess_setop_tlist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5674:39: call_function: inlined call to ‘list_head’ from ‘postprocess_setop_tlist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5676:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5676:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5682:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5686:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:5686:17: danger: dereference of NULL ‘orig_tlist_item’
# 5684|   
# 5685|   		Assert(orig_tlist_item != NULL);
# 5686|-> 		orig_tle = lfirst_node(TargetEntry, orig_tlist_item);
# 5687|   		orig_tlist_item = lnext(orig_tlist, orig_tlist_item);
# 5688|   		if (orig_tle->resjunk)	/* should not happen */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def275]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8109:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8091:1: enter_function: entry to ‘generate_setop_child_grouplist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8097:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8098:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8098:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8104:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8109:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:8109:17: danger: dereference of NULL ‘lg’
# 8107|   		/* we expect every non-resjunk target to have a SortGroupClause */
# 8108|   		Assert(lg != NULL);
# 8109|-> 		sgc = (SortGroupClause *) lfirst(lg);
# 8110|   		lg = lnext(grouplist, lg);
# 8111|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def276]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:2028:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*root.grouping_map’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3541:1: enter_function: entry to ‘extract_query_dependencies’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3561:16: call_function: calling ‘extract_query_dependencies_walker’ from ‘extract_query_dependencies’
# 2026|   	{
# 2027|   		GroupingFunc *g = (GroupingFunc *) node;
# 2028|-> 		AttrNumber *grouping_map = root->grouping_map;
# 2029|   
# 2030|   		/* If there are no grouping sets, we don't need this. */

Error: CPPCHECK_WARNING (CWE-476): [#def277]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:2124: warning[nullPointer]: Possible null pointer dereference: bestplan
# 2122|   
# 2123|   	/* Mark the subplan we selected */
# 2124|-> 	root->isUsedSubplan[bestplan->plan_id - 1] = true;
# 2125|   
# 2126|   	return (Node *) bestplan;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:2124:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bestplan’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3043:1: enter_function: entry to ‘fix_join_expr_mutator’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3047:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3049:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3049:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3090:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3136:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3138:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3138:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3139:24: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/setrefs.c:3139:24: call_function: calling ‘fix_alternative_subplan’ from ‘fix_join_expr_mutator’
# 2122|   
# 2123|   	/* Mark the subplan we selected */
# 2124|-> 	root->isUsedSubplan[bestplan->plan_id - 1] = true;
# 2125|   
# 2126|   	return (Node *) bestplan;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def279]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:119:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘target_rte’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:78:12: branch_false: following ‘false’ branch (when ‘result_relation == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:104:12: branch_false: following ‘false’ branch (when ‘command_type != 3’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:106:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:106:17: branch_false: following ‘false’ branch (when ‘command_type != 2’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:117:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:119:18: danger: dereference of NULL ‘target_rte’
#  117|   	if ((command_type == CMD_UPDATE || command_type == CMD_DELETE ||
#  118|   		 command_type == CMD_MERGE) &&
#  119|-> 		!target_rte->inh)
#  120|   	{
#  121|   		/* row-identity logic expects to add stuff to processed_tlist */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def280]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:395:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:62:1: enter_function: entry to ‘preprocess_targetlist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:78:12: branch_false: following ‘false’ branch (when ‘result_relation == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:104:12: branch_true: following ‘true’ branch (when ‘command_type == 3’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:105:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/preptlist.c:105:25: call_function: calling ‘expand_insert_targetlist’ from ‘preprocess_targetlist’
#  393|   	 * sure we have all the user attributes in the right order.
#  394|   	 */
#  395|-> 	numattrs = RelationGetNumberOfAttributes(rel);
#  396|   
#  397|   	for (attrno = 1; attrno <= numattrs; attrno++)

Error: CPPCHECK_WARNING (CWE-768): [#def281]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:440: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lpath_tlist)},(union ListCell){.ptr_value=(rpath_tlist)}' depends on order of evaluation of side effects
#  438|   	 */
#  439|   	tlist = generate_append_tlist(setOp->colTypes, setOp->colCollations, false,
#  440|-> 								  list_make2(lpath_tlist, rpath_tlist),
#  441|   								  refnames_tlist);
#  442|   

Error: CPPCHECK_WARNING (CWE-768): [#def282]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1089: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lpath)},(union ListCell){.ptr_value=(rpath)}' depends on order of evaluation of side effects
# 1087|   	if (op->op == SETOP_EXCEPT || dLeftGroups <= dRightGroups)
# 1088|   	{
# 1089|-> 		pathlist = list_make2(lpath, rpath);
# 1090|   		tlist_list = list_make2(lpath_tlist, rpath_tlist);
# 1091|   		firstFlag = 0;

Error: CPPCHECK_WARNING (CWE-768): [#def283]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1090: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lpath_tlist)},(union ListCell){.ptr_value=(rpath_tlist)}' depends on order of evaluation of side effects
# 1088|   	{
# 1089|   		pathlist = list_make2(lpath, rpath);
# 1090|-> 		tlist_list = list_make2(lpath_tlist, rpath_tlist);
# 1091|   		firstFlag = 0;
# 1092|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def284]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1095: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(rpath)},(union ListCell){.ptr_value=(lpath)}' depends on order of evaluation of side effects
# 1093|   	else
# 1094|   	{
# 1095|-> 		pathlist = list_make2(rpath, lpath);
# 1096|   		tlist_list = list_make2(rpath_tlist, lpath_tlist);
# 1097|   		firstFlag = 1;

Error: CPPCHECK_WARNING (CWE-768): [#def285]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1096: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(rpath_tlist)},(union ListCell){.ptr_value=(lpath_tlist)}' depends on order of evaluation of side effects
# 1094|   	{
# 1095|   		pathlist = list_make2(rpath, lpath);
# 1096|-> 		tlist_list = list_make2(rpath_tlist, lpath_tlist);
# 1097|   		firstFlag = 1;
# 1098|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def286]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1584:64: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘curColType’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1570:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1577:17: branch_true: following ‘true’ branch (when ‘subtlist’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1577:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1584:64: danger: dereference of NULL ‘curColType’
# 1582|   				continue;
# 1583|   			Assert(curColType != NULL);
# 1584|-> 			if (exprType((Node *) subtle->expr) == lfirst_oid(curColType))
# 1585|   			{
# 1586|   				/* If first subplan, copy the typmod; else compare */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def287]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1698:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1674:1: enter_function: entry to ‘generate_setop_grouplist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1680:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_grouplist’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1686:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1698:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/prep/prepunion.c:1698:17: danger: dereference of NULL ‘lg’
# 1696|   		/* non-resjunk columns should have grouping clauses */
# 1697|   		Assert(lg != NULL);
# 1698|-> 		sgc = (SortGroupClause *) lfirst(lg);
# 1699|   		lg = lnext(grouplist, lg);
# 1700|   		Assert(sgc->tleSortGroupRef == 0);

Error: COMPILER_WARNING (CWE-457): [#def288]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/util/clauses.c: scope_hint: In function ‘recheck_cast_function_args.isra.0’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/util/clauses.c:4400:19: warning[-Wmaybe-uninitialized]: ‘actual_arg_types’ may be used uninitialized
# 4400 |         rettype = enforce_generic_type_consistency(actual_arg_types,
#      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4401 |                                                                                            declared_arg_types,
#      |                                                                                            ~~~~~~~~~~~~~~~~~~~
# 4402 |                                                                                            nargs,
#      |                                                                                            ~~~~~~
# 4403 |                                                                                            funcform->prorettype,
#      |                                                                                            ~~~~~~~~~~~~~~~~~~~~~
# 4404 |                                                                                            false);
#      |                                                                                            ~~~~~~
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/util/clauses.c:42: included_from: Included from here.
postgresql-18beta1/postgresql-17.2/src/include/parser/parse_coerce.h:82:17: note: by argument 1 of type ‘const Oid *’ to ‘enforce_generic_type_consistency’ declared here
#   82 | extern Oid      enforce_generic_type_consistency(const Oid *actual_arg_types,
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/util/clauses.c:4386:33: note: ‘actual_arg_types’ declared here
# 4386 |         Oid                     actual_arg_types[FUNC_MAX_ARGS];
#      |                                 ^~~~~~~~~~~~~~~~
# 4398|   	Assert(nargs == pronargs);
# 4399|   	memcpy(declared_arg_types, proargtypes, pronargs * sizeof(Oid));
# 4400|-> 	rettype = enforce_generic_type_consistency(actual_arg_types,
# 4401|   											   declared_arg_types,
# 4402|   											   nargs,

Error: CPPCHECK_WARNING (CWE-768): [#def289]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/util/relnode.c:2408: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(larg)},(union ListCell){.ptr_value=(rarg)}' depends on order of evaluation of side effects
# 2406|   						c->coalescetype = exprType(larg);
# 2407|   						c->coalescecollid = exprCollation(larg);
# 2408|-> 						c->args = list_make2(larg, rarg);
# 2409|   						c->location = -1;
# 2410|   						nullable_partexpr = lappend(nullable_partexpr, c);

Error: CPPCHECK_WARNING (CWE-768): [#def290]
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/util/restrictinfo.c:374: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=((list_nth_cell(clause->args,1)->ptr_value))}),((union ListCell){.ptr_value=((list_nth_cell(clause->args,0)->ptr_value))})' depends on order of evaluation of side effects
#  372|   	newclause->opno = comm_op;
#  373|   	newclause->opfuncid = InvalidOid;
#  374|-> 	newclause->args = list_make2(lsecond(clause->args),
#  375|   								 linitial(clause->args));
#  376|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def291]
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:283:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘stmt’
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:3013:1: enter_function: entry to ‘transformCreateTableAsStmt’
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:3019:17: call_function: calling ‘transformStmt’ from ‘transformCreateTableAsStmt’
#  281|   		Assert(stmt && IsA(stmt, SelectStmt) && stmt->larg == NULL);
#  282|   
#  283|-> 		if (stmt->intoClause)
#  284|   		{
#  285|   			CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def292]
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:1741:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftmostSelect’
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:3013:1: enter_function: entry to ‘transformCreateTableAsStmt’
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:3019:17: call_function: calling ‘transformStmt’ from ‘transformCreateTableAsStmt’
# 1739|   	Assert(leftmostSelect && IsA(leftmostSelect, SelectStmt) &&
# 1740|   		   leftmostSelect->larg == NULL);
# 1741|-> 	if (leftmostSelect->intoClause)
# 1742|   		ereport(ERROR,
# 1743|   				(errcode(ERRCODE_SYNTAX_ERROR),

Error: CPPCHECK_WARNING (CWE-768): [#def293]
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:2205: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2203|   			/* select common type, same as CASE et al */
# 2204|   			rescoltype = select_common_type(pstate,
# 2205|-> 											list_make2(lcolnode, rcolnode),
# 2206|   											context,
# 2207|   											&bestexpr);

Error: CPPCHECK_WARNING (CWE-768): [#def294]
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:2260: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2258|   
# 2259|   			rescoltypmod = select_common_typmod(pstate,
# 2260|-> 												list_make2(lcolnode, rcolnode),
# 2261|   												rescoltype);
# 2262|   

Error: CPPCHECK_WARNING (CWE-768): [#def295]
postgresql-18beta1/postgresql-17.2/src/backend/parser/analyze.c:2273: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2271|   			 */
# 2272|   			rescolcoll = select_common_collation(pstate,
# 2273|-> 												 list_make2(lcolnode, rcolnode),
# 2274|   												 (op->op == SETOP_UNION && op->all));
# 2275|   

Error: CPPCHECK_WARNING (CWE-768): [#def296]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:1870: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(0x7FFF,-1))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-2].ival,yylsp[-2]))})' depends on order of evaluation of side effects
# 1868|   					TypeName   *t = $1;
# 1869|   
# 1870|-> 					t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
# 1871|   											makeIntConst($3, @3));
# 1872|   					$$ = makeStringConstCast($5, @5, t);

Error: CPPCHECK_WARNING (CWE-768): [#def297]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:4362: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].ielem)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
# 4360|   ExclusionConstraintElem: index_elem WITH any_operator
# 4361|   			{
# 4362|-> 				$$ = list_make2($1, $3);
# 4363|   			}
# 4364|   			/* allow OPERATOR() decoration for the benefit of ruleutils.c */

Error: CPPCHECK_WARNING (CWE-768): [#def298]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:4367: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-5].ielem)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
# 4365|   			| index_elem WITH OPERATOR '(' any_operator ')'
# 4366|   			{
# 4367|-> 				$$ = list_make2($1, $5);
# 4368|   			}
# 4369|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def299]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5234: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(yyvsp[-1].typnam)}' depends on order of evaluation of side effects
# 5232|   					n->action = $4;
# 5233|   					n->objtype = OBJECT_CAST;
# 5234|-> 					n->object = (Node *) list_make2($7, $9);
# 5235|   					$$ = (Node *) n;
# 5236|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def300]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5314: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].typnam)},(union ListCell){.ptr_value=(makeString(yyvsp[0].str))}' depends on order of evaluation of side effects
# 5312|   					n->action = $4;
# 5313|   					n->objtype = OBJECT_TRANSFORM;
# 5314|-> 					n->object = (Node *) list_make2($7, makeString($9));
# 5315|   					$$ = (Node *) n;
# 5316|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def301]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5980: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(events1|events2))},((union ListCell){.ptr_value=(list_concat(columns1,columns2))})' depends on order of evaluation of side effects
# 5978|   					 * should just ignore the columns for non-UPDATE events.
# 5979|   					 */
# 5980|-> 					$$ = list_make2(makeInteger(events1 | events2),
# 5981|   									list_concat(columns1, columns2));
# 5982|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def302]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5987: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<2))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 5985|   TriggerOneEvent:
# 5986|   			INSERT
# 5987|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
# 5988|   			| DELETE_P
# 5989|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }

Error: CPPCHECK_WARNING (CWE-768): [#def303]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5989: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<3))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 5987|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
# 5988|   			| DELETE_P
# 5989|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
# 5990|   			| UPDATE
# 5991|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }

Error: CPPCHECK_WARNING (CWE-768): [#def304]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5991: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<4))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 5989|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
# 5990|   			| UPDATE
# 5991|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
# 5992|   			| UPDATE OF columnList
# 5993|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }

Error: CPPCHECK_WARNING (CWE-768): [#def305]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5993: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<4))},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
# 5991|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
# 5992|   			| UPDATE OF columnList
# 5993|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
# 5994|   			| TRUNCATE
# 5995|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }

Error: CPPCHECK_WARNING (CWE-768): [#def306]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:5995: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<5))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 5993|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
# 5994|   			| TRUNCATE
# 5995|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }
# 5996|   		;
# 5997|   

Error: CPPCHECK_WARNING (CWE-768): [#def307]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:7141: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeTypeNameFromNameList(yyvsp[-2].list))},(union ListCell){.ptr_value=(makeString(yyvsp[-5].str))}' depends on order of evaluation of side effects
# 7139|   					 * up here.
# 7140|   					 */
# 7141|-> 					n->object = (Node *) list_make2(makeTypeNameFromNameList($7), makeString($4));
# 7142|   					n->comment = $9;
# 7143|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def308]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:7177: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].typnam)},(union ListCell){.ptr_value=(makeString(yyvsp[-2].str))}' depends on order of evaluation of side effects
# 7175|   
# 7176|   					n->objtype = OBJECT_TRANSFORM;
# 7177|-> 					n->object = (Node *) list_make2($5, makeString($7));
# 7178|   					n->comment = $9;
# 7179|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def309]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:7213: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-5].typnam)},(union ListCell){.ptr_value=(yyvsp[-3].typnam)}' depends on order of evaluation of side effects
# 7211|   
# 7212|   					n->objtype = OBJECT_CAST;
# 7213|-> 					n->object = (Node *) list_make2($5, $7);
# 7214|   					n->comment = $10;
# 7215|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def310]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:8566: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((struct List*)NULL)},(union ListCell){.ptr_value=(makeInteger(-1))}' depends on order of evaluation of side effects
# 8564|   aggr_args:	'(' '*' ')'
# 8565|   				{
# 8566|-> 					$$ = list_make2(NIL, makeInteger(-1));
# 8567|   				}
# 8568|   			| '(' aggr_args_list ')'

Error: CPPCHECK_WARNING (CWE-768): [#def311]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:8570: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].list)},(union ListCell){.ptr_value=(makeInteger(-1))}' depends on order of evaluation of side effects
# 8568|   			| '(' aggr_args_list ')'
# 8569|   				{
# 8570|-> 					$$ = list_make2($2, makeInteger(-1));
# 8571|   				}
# 8572|   			| '(' ORDER BY aggr_args_list ')'

Error: CPPCHECK_WARNING (CWE-768): [#def312]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:8574: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].list)},(union ListCell){.ptr_value=(makeInteger(0))}' depends on order of evaluation of side effects
# 8572|   			| '(' ORDER BY aggr_args_list ')'
# 8573|   				{
# 8574|-> 					$$ = list_make2($4, makeInteger(0));
# 8575|   				}
# 8576|   			| '(' aggr_args_list ORDER BY aggr_args_list ')'

Error: CPPCHECK_WARNING (CWE-768): [#def313]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:8718: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(yyvsp[-2].str))},(union ListCell){.ptr_value=(makeString(yyvsp[0].str))}' depends on order of evaluation of side effects
# 8716|   			| Sconst ',' Sconst
# 8717|   				{
# 8718|-> 					$$ = list_make2(makeString($1), makeString($3));
# 8719|   				}
# 8720|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def314]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:8997: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(yyvsp[-1].typnam)}' depends on order of evaluation of side effects
# 8995|   				}
# 8996|   			| '(' Typename ',' Typename ')'
# 8997|-> 					{ $$ = list_make2($2, $4); }
# 8998|   			| '(' NONE ',' Typename ')'					/* left unary */
# 8999|   					{ $$ = list_make2(NULL, $4); }

Error: CPPCHECK_WARNING (CWE-768): [#def315]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:8999: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[-1].typnam)}' depends on order of evaluation of side effects
# 8997|   					{ $$ = list_make2($2, $4); }
# 8998|   			| '(' NONE ',' Typename ')'					/* left unary */
# 8999|-> 					{ $$ = list_make2(NULL, $4); }
# 9000|   			| '(' Typename ',' NONE ')'					/* right unary */
# 9001|   					{ $$ = list_make2($2, NULL); }

Error: CPPCHECK_WARNING (CWE-768): [#def316]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9001: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
# 8999|   					{ $$ = list_make2(NULL, $4); }
# 9000|   			| '(' Typename ',' NONE ')'					/* right unary */
# 9001|-> 					{ $$ = list_make2($2, NULL); }
# 9002|   		;
# 9003|   

Error: CPPCHECK_WARNING (CWE-768): [#def317]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9117: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].typnam)},(union ListCell){.ptr_value=(yyvsp[-2].typnam)}' depends on order of evaluation of side effects
# 9115|   
# 9116|   					n->removeType = OBJECT_CAST;
# 9117|-> 					n->objects = list_make1(list_make2($5, $7));
# 9118|   					n->behavior = $9;
# 9119|   					n->missing_ok = $3;

Error: CPPCHECK_WARNING (CWE-768): [#def318]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9151: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].objwithargs)},(union ListCell){.ptr_value=(yyvsp[0].objwithargs)}' depends on order of evaluation of side effects
# 9149|   transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes
# 9150|   				{
# 9151|-> 					$$ = list_make2($5, $11);
# 9152|   				}
# 9153|   				| TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes

Error: CPPCHECK_WARNING (CWE-768): [#def319]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9155: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].objwithargs)},(union ListCell){.ptr_value=(yyvsp[-6].objwithargs)}' depends on order of evaluation of side effects
# 9153|   				| TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes
# 9154|   				{
# 9155|-> 					$$ = list_make2($11, $5);
# 9156|   				}
# 9157|   				| FROM SQL_P WITH FUNCTION function_with_argtypes

Error: CPPCHECK_WARNING (CWE-768): [#def320]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9159: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].objwithargs)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
# 9157|   				| FROM SQL_P WITH FUNCTION function_with_argtypes
# 9158|   				{
# 9159|-> 					$$ = list_make2($5, NULL);
# 9160|   				}
# 9161|   				| TO SQL_P WITH FUNCTION function_with_argtypes

Error: CPPCHECK_WARNING (CWE-768): [#def321]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9163: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[0].objwithargs)}' depends on order of evaluation of side effects
# 9161|   				| TO SQL_P WITH FUNCTION function_with_argtypes
# 9162|   				{
# 9163|-> 					$$ = list_make2(NULL, $5);
# 9164|   				}
# 9165|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def322]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:9173: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(makeString(yyvsp[-1].str))}' depends on order of evaluation of side effects
# 9171|   
# 9172|   					n->removeType = OBJECT_TRANSFORM;
# 9173|-> 					n->objects = list_make1(list_make2($5, makeString($7)));
# 9174|   					n->behavior = $8;
# 9175|   					n->missing_ok = $3;

Error: CPPCHECK_WARNING (CWE-768): [#def323]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:11651: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
#11649|   					n->cfgname = $5;
#11650|   					n->tokentype = NIL;
#11651|-> 					n->dicts = list_make2($9,$11);
#11652|   					n->override = false;
#11653|   					n->replace = true;

Error: CPPCHECK_WARNING (CWE-768): [#def324]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:11663: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
#11661|   					n->cfgname = $5;
#11662|   					n->tokentype = $9;
#11663|-> 					n->dicts = list_make2($11,$13);
#11664|   					n->override = false;
#11665|   					n->replace = true;

Error: CPPCHECK_WARNING (CWE-768): [#def325]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13697: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].alias)},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
#13695|   			alias_clause
#13696|   				{
#13697|-> 					$$ = list_make2($1, NIL);
#13698|   				}
#13699|   			| AS '(' TableFuncElementList ')'

Error: CPPCHECK_WARNING (CWE-768): [#def326]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13701: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
#13699|   			| AS '(' TableFuncElementList ')'
#13700|   				{
#13701|-> 					$$ = list_make2(NULL, $3);
#13702|   				}
#13703|   			| AS ColId '(' TableFuncElementList ')'

Error: CPPCHECK_WARNING (CWE-768): [#def327]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13708: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(a)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
#13706|   
#13707|   					a->aliasname = $2;
#13708|-> 					$$ = list_make2(a, $4);
#13709|   				}
#13710|   			| ColId '(' TableFuncElementList ')'

Error: CPPCHECK_WARNING (CWE-768): [#def328]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13715: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(a)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
#13713|   
#13714|   					a->aliasname = $1;
#13715|-> 					$$ = list_make2(a, $3);
#13716|   				}
#13717|   			| /*EMPTY*/

Error: CPPCHECK_WARNING (CWE-768): [#def329]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13719: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
#13717|   			| /*EMPTY*/
#13718|   				{
#13719|-> 					$$ = list_make2(NULL, NIL);
#13720|   				}
#13721|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def330]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13748: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[0].alias)}' depends on order of evaluation of side effects
#13746|   join_qual: USING '(' name_list ')' opt_alias_clause_for_join_using
#13747|   				{
#13748|-> 					$$ = (Node *) list_make2($3, $5);
#13749|   				}
#13750|   			| ON a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def331]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13874: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].node)},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
#13872|   					n->ordinality = $2;
#13873|   					n->is_rowsfrom = false;
#13874|-> 					n->functions = list_make1(list_make2($1, NIL));
#13875|   					/* alias and coldeflist are set by table_ref production */
#13876|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def332]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:13892: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].node)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
#13890|   
#13891|   rowsfrom_item: func_expr_windowless opt_col_def_list
#13892|-> 				{ $$ = list_make2($1, $2); }
#13893|   		;
#13894|   

Error: CPPCHECK_WARNING (CWE-768): [#def333]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14346: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(0x7FFF,-1))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-1].ival,yylsp[-1]))})' depends on order of evaluation of side effects
#14344|   				{
#14345|   					$$ = $1;
#14346|-> 					$$->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
#14347|   											 makeIntConst($3, @3));
#14348|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def334]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14732: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(1<<12,yylsp[-3]))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-1].ival,yylsp[-1]))})' depends on order of evaluation of side effects
#14730|   			| SECOND_P '(' Iconst ')'
#14731|   				{
#14732|-> 					$$ = list_make2(makeIntConst(INTERVAL_MASK(SECOND), @1),
#14733|   									makeIntConst($3, @3));
#14734|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def335]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14788: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)}' depends on order of evaluation of side effects
#14786|   				{
#14787|   					$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
#14788|-> 											   list_make2($5, $1),
#14789|   											   COERCE_SQL_SYNTAX,
#14790|   											   @2);

Error: CPPCHECK_WARNING (CWE-768): [#def336]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14859: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#14857|   				{
#14858|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#14859|-> 												 list_make2($3, $5),
#14860|   												 COERCE_EXPLICIT_CALL,
#14861|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def337]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14873: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#14871|   				{
#14872|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#14873|-> 												 list_make2($4, $6),
#14874|   												 COERCE_EXPLICIT_CALL,
#14875|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def338]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14887: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#14885|   				{
#14886|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#14887|-> 												 list_make2($3, $5),
#14888|   												 COERCE_EXPLICIT_CALL,
#14889|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def339]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14901: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#14899|   				{
#14900|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#14901|-> 												 list_make2($4, $6),
#14902|   												 COERCE_EXPLICIT_CALL,
#14903|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def340]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14920: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#14918|   				{
#14919|   					FuncCall   *n = makeFuncCall(SystemFuncName("similar_to_escape"),
#14920|-> 												 list_make2($4, $6),
#14921|   												 COERCE_EXPLICIT_CALL,
#14922|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def341]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:14938: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#14936|   				{
#14937|   					FuncCall   *n = makeFuncCall(SystemFuncName("similar_to_escape"),
#14938|-> 												 list_make2($5, $7),
#14939|   												 COERCE_EXPLICIT_CALL,
#14940|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def342]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15074: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15072|   												   "BETWEEN",
#15073|   												   $1,
#15074|-> 												   (Node *) list_make2($4, $6),
#15075|   												   @2);
#15076|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def343]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15082: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15080|   												   "NOT BETWEEN",
#15081|   												   $1,
#15082|-> 												   (Node *) list_make2($5, $7),
#15083|   												   @2);
#15084|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def344]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15090: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15088|   												   "BETWEEN SYMMETRIC",
#15089|   												   $1,
#15090|-> 												   (Node *) list_make2($4, $6),
#15091|   												   @2);
#15092|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def345]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15098: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15096|   												   "NOT BETWEEN SYMMETRIC",
#15097|   												   $1,
#15098|-> 												   (Node *) list_make2($5, $7),
#15099|   												   @2);
#15100|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def346]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15201: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].node)},((union ListCell){.ptr_value=(makeStringConst(yyvsp[-1].str,yylsp[-1]))})' depends on order of evaluation of side effects
#15199|   				{
#15200|   					$$ = (Node *) makeFuncCall(SystemFuncName("is_normalized"),
#15201|-> 											   list_make2($1, makeStringConst($3, @3)),
#15202|   											   COERCE_SQL_SYNTAX,
#15203|   											   @2);

Error: CPPCHECK_WARNING (CWE-768): [#def347]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15216: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},((union ListCell){.ptr_value=(makeStringConst(yyvsp[-1].str,yylsp[-1]))})' depends on order of evaluation of side effects
#15214|   				{
#15215|   					$$ = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"),
#15216|-> 														   list_make2($1, makeStringConst($4, @4)),
#15217|   														   COERCE_SQL_SYNTAX,
#15218|   														   @2),

Error: CPPCHECK_WARNING (CWE-768): [#def348]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15733: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].node)},((union ListCell){.ptr_value=(makeStringConst(yyvsp[-1].str,yylsp[-1]))})' depends on order of evaluation of side effects
#15731|   				{
#15732|   					$$ = (Node *) makeFuncCall(SystemFuncName("normalize"),
#15733|-> 											   list_make2($3, makeStringConst($5, @5)),
#15734|   											   COERCE_SQL_SYNTAX,
#15735|   											   @1);

Error: CPPCHECK_WARNING (CWE-768): [#def349]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15892: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[-1].node)}' depends on order of evaluation of side effects
#15890|   					 * converted to xmlexists(A, B)*/
#15891|   					$$ = (Node *) makeFuncCall(SystemFuncName("xmlexists"),
#15892|-> 											   list_make2($3, $4),
#15893|   											   COERCE_SQL_SYNTAX,
#15894|   											   @1);

Error: CPPCHECK_WARNING (CWE-768): [#def350]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15904: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},((union ListCell){.ptr_value=(makeBoolAConst(yyvsp[-1].boolean,-1))})' depends on order of evaluation of side effects
#15902|   					XmlExpr *x = (XmlExpr *)
#15903|   						makeXmlExpr(IS_XMLPARSE, NULL, NIL,
#15904|-> 									list_make2($4, makeBoolAConst($5, -1)),
#15905|   									@1);
#15906|   

Error: CPPCHECK_WARNING (CWE-768): [#def351]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15921: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#15919|   				{
#15920|   					$$ = makeXmlExpr(IS_XMLROOT, NULL, NIL,
#15921|-> 									 list_make3($3, $5, $6), @1);
#15922|   				}
#15923|   			| XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'

Error: CPPCHECK_WARNING (CWE-768): [#def352]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:15921: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[-1].node)}' depends on order of evaluation of side effects
#15919|   				{
#15920|   					$$ = makeXmlExpr(IS_XMLROOT, NULL, NIL,
#15921|-> 									 list_make3($3, $5, $6), @1);
#15922|   				}
#15923|   			| XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'

Error: CPPCHECK_WARNING (CWE-768): [#def353]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16598: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeStringConst(yyvsp[-2].str,yylsp[-2]))}),(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16596|   			extract_arg FROM a_expr
#16597|   				{
#16598|-> 					$$ = list_make2(makeStringConst($1, @1), $3);
#16599|   				}
#16600|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def354]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16628: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)}' depends on order of evaluation of side effects
#16626|   				{
#16627|   					/* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16628|-> 					$$ = list_make4($1, $3, $5, $7);
#16629|   				}
#16630|   			| a_expr PLACING a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def355]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16628: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16626|   				{
#16627|   					/* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16628|-> 					$$ = list_make4($1, $3, $5, $7);
#16629|   				}
#16630|   			| a_expr PLACING a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def356]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16628: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16626|   				{
#16627|   					/* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16628|-> 					$$ = list_make4($1, $3, $5, $7);
#16629|   				}
#16630|   			| a_expr PLACING a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def357]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16633: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16631|   				{
#16632|   					/* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */
#16633|-> 					$$ = list_make3($1, $3, $5);
#16634|   				}
#16635|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def358]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16633: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16631|   				{
#16632|   					/* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */
#16633|-> 					$$ = list_make3($1, $3, $5);
#16634|   				}
#16635|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def359]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16639: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16637|   /* position_list uses b_expr not a_expr to avoid conflict with general IN */
#16638|   position_list:
#16639|-> 			b_expr IN_P b_expr						{ $$ = list_make2($3, $1); }
#16640|   		;
#16641|   

Error: CPPCHECK_WARNING (CWE-768): [#def360]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16662: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16660|   			a_expr FROM a_expr FOR a_expr
#16661|   				{
#16662|-> 					$$ = list_make3($1, $3, $5);
#16663|   				}
#16664|   			| a_expr FOR a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def361]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16662: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16660|   			a_expr FROM a_expr FOR a_expr
#16661|   				{
#16662|-> 					$$ = list_make3($1, $3, $5);
#16663|   				}
#16664|   			| a_expr FOR a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def362]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16667: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16665|   				{
#16666|   					/* not legal per SQL, but might as well allow it */
#16667|-> 					$$ = list_make3($1, $5, $3);
#16668|   				}
#16669|   			| a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def363]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16667: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[0].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16665|   				{
#16666|   					/* not legal per SQL, but might as well allow it */
#16667|-> 					$$ = list_make3($1, $5, $3);
#16668|   				}
#16669|   			| a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def364]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16678: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16676|   					 * such a call in regular function call syntax.
#16677|   					 */
#16678|-> 					$$ = list_make2($1, $3);
#16679|   				}
#16680|   			| a_expr FOR a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def365]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16693: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},((union ListCell){.ptr_value=(makeIntConst(1,-1))})' depends on order of evaluation of side effects
#16691|   					 * is unknown or doesn't have an implicit cast to int4.
#16692|   					 */
#16693|-> 					$$ = list_make3($1, makeIntConst(1, -1),
#16694|   									makeTypeCast($3,
#16695|   												 SystemTypeName("int4"), -1));

Error: CPPCHECK_WARNING (CWE-768): [#def366]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16693: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},((union ListCell){.ptr_value=(makeIntConst(1,-1))}),((union ListCell){.ptr_value=(makeTypeCast(yyvsp[0].node,SystemTypeName("int4"),-1))})' depends on order of evaluation of side effects
#16691|   					 * is unknown or doesn't have an implicit cast to int4.
#16692|   					 */
#16693|-> 					$$ = list_make3($1, makeIntConst(1, -1),
#16694|   									makeTypeCast($3,
#16695|   												 SystemTypeName("int4"), -1));

Error: CPPCHECK_WARNING (CWE-768): [#def367]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16699: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16697|   			| a_expr SIMILAR a_expr ESCAPE a_expr
#16698|   				{
#16699|-> 					$$ = list_make3($1, $3, $5);
#16700|   				}
#16701|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def368]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16699: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16697|   			| a_expr SIMILAR a_expr ESCAPE a_expr
#16698|   				{
#16699|-> 					$$ = list_make3($1, $3, $5);
#16700|   				}
#16701|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def369]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16880: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
#16878|   json_behavior_clause_opt:
#16879|   			json_behavior ON EMPTY_P
#16880|-> 				{ $$ = list_make2($1, NULL); }
#16881|   			| json_behavior ON ERROR_P
#16882|   				{ $$ = list_make2(NULL, $1); }

Error: CPPCHECK_WARNING (CWE-768): [#def370]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16882: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16880|   				{ $$ = list_make2($1, NULL); }
#16881|   			| json_behavior ON ERROR_P
#16882|-> 				{ $$ = list_make2(NULL, $1); }
#16883|   			| json_behavior ON EMPTY_P json_behavior ON ERROR_P
#16884|   				{ $$ = list_make2($1, $4); }

Error: CPPCHECK_WARNING (CWE-768): [#def371]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16884: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-5].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16882|   				{ $$ = list_make2(NULL, $1); }
#16883|   			| json_behavior ON EMPTY_P json_behavior ON ERROR_P
#16884|-> 				{ $$ = list_make2($1, $4); }
#16885|   			| /* EMPTY */
#16886|   				{ $$ = list_make2(NULL, NULL); }

Error: CPPCHECK_WARNING (CWE-768): [#def372]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16886: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
#16884|   				{ $$ = list_make2($1, $4); }
#16885|   			| /* EMPTY */
#16886|-> 				{ $$ = list_make2(NULL, NULL); }
#16887|   		;
#16888|   

Error: CPPCHECK_WARNING (CWE-457): [#def373]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:16921: error[legacyUninitvar]: Uninitialized variable: encoding
#16919|   								errmsg("unrecognized JSON encoding: %s", $4));
#16920|   
#16921|-> 					$$ = (Node *) makeJsonFormat(JS_FORMAT_JSON, encoding, @1);
#16922|   				}
#16923|   			| FORMAT_LA JSON

Error: CPPCHECK_WARNING (CWE-768): [#def374]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:17271: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(0x7FFF,-1))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-2].ival,yylsp[-2]))})' depends on order of evaluation of side effects
#17269|   					TypeName   *t = $1;
#17270|   
#17271|-> 					t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
#17272|   											makeIntConst($3, @3));
#17273|   					$$ = makeStringConstCast($5, @5, t);

Error: CPPCHECK_WARNING (CWE-457): [#def375]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:17365: error[legacyUninitvar]: Uninitialized variable: n
#17363|   						n->rolename = pstrdup($1);
#17364|   					}
#17365|-> 					$$ = n;
#17366|   				}
#17367|   			| CURRENT_ROLE

Error: CPPCHECK_WARNING (CWE-768): [#def376]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:18846: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(list_concat(directargs,orderedargs))}),(union ListCell){.ptr_value=(ndirectargs)}' depends on order of evaluation of side effects
#18844|   	ndirectargs = makeInteger(list_length(directargs));
#18845|   
#18846|-> 	return list_make2(list_concat(directargs, orderedargs),
#18847|   					  ndirectargs);
#18848|   }

Error: CPPCHECK_WARNING (CWE-768): [#def377]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:18953: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString("pg_catalog"))},(union ListCell){.ptr_value=(makeString(name))}' depends on order of evaluation of side effects
#18951|   SystemFuncName(char *name)
#18952|   {
#18953|-> 	return list_make2(makeString("pg_catalog"), makeString(name));
#18954|   }
#18955|   

Error: CPPCHECK_WARNING (CWE-768): [#def378]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:18965: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString("pg_catalog"))},(union ListCell){.ptr_value=(makeString(name))}' depends on order of evaluation of side effects
#18963|   SystemTypeName(char *name)
#18964|   {
#18965|-> 	return makeTypeNameFromNameList(list_make2(makeString("pg_catalog"),
#18966|   											   makeString(name)));
#18967|   }

Error: CPPCHECK_WARNING (CWE-768): [#def379]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:19034: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lexpr)},(union ListCell){.ptr_value=(rexpr)}' depends on order of evaluation of side effects
#19032|   		}
#19033|   	}
#19034|-> 	return (Node *) makeBoolExpr(AND_EXPR, list_make2(lexpr, rexpr), location);
#19035|   }
#19036|   

Error: CPPCHECK_WARNING (CWE-768): [#def380]
postgresql-18beta1/postgresql-17.2/src/backend/parser/gram.y:19051: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lexpr)},(union ListCell){.ptr_value=(rexpr)}' depends on order of evaluation of side effects
#19049|   		}
#19050|   	}
#19051|-> 	return (Node *) makeBoolExpr(OR_EXPR, list_make2(lexpr, rexpr), location);
#19052|   }
#19053|   

Error: CPPCHECK_WARNING (CWE-768): [#def381]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_agg.c:2117: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(make_agg_arg(17,(unsigned int)0))}),((union ListCell){.ptr_value=(make_agg_arg(2281,(unsigned int)0))})' depends on order of evaluation of side effects
# 2115|   
# 2116|   	/* deserialfn always takes BYTEA, INTERNAL and returns INTERNAL */
# 2117|-> 	args = list_make2(make_agg_arg(BYTEAOID, InvalidOid),
# 2118|   					  make_agg_arg(INTERNALOID, InvalidOid));
# 2119|   

Error: CPPCHECK_WARNING (CWE-768): [#def382]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_clause.c:1676: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(l_colvar)},(union ListCell){.ptr_value=(r_colvar)}' depends on order of evaluation of side effects
# 1674|   
# 1675|   	outcoltype = select_common_type(pstate,
# 1676|-> 									list_make2(l_colvar, r_colvar),
# 1677|   									"JOIN/USING",
# 1678|   									NULL);

Error: CPPCHECK_WARNING (CWE-768): [#def383]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_clause.c:1680: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(l_colvar)},(union ListCell){.ptr_value=(r_colvar)}' depends on order of evaluation of side effects
# 1678|   									NULL);
# 1679|   	outcoltypmod = select_common_typmod(pstate,
# 1680|-> 										list_make2(l_colvar, r_colvar),
# 1681|   										outcoltype);
# 1682|   

Error: CPPCHECK_WARNING (CWE-768): [#def384]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_clause.c:1748: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(l_node)},(union ListCell){.ptr_value=(r_node)}' depends on order of evaluation of side effects
# 1746|   				c->coalescetype = outcoltype;
# 1747|   				/* coalescecollid will get set below */
# 1748|-> 				c->args = list_make2(l_node, r_node);
# 1749|   				c->location = -1;
# 1750|   				res_node = (Node *) c;

Error: CPPCHECK_WARNING (CWE-768): [#def385]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:377: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(le)},(union ListCell){.ptr_value=(re)}' depends on order of evaluation of side effects
#  375|   
#  376|   					coll = select_common_collation(context->pstate,
#  377|-> 												   list_make2(le, re),
#  378|   												   true);
#  379|   					colls = lappend_oid(colls, coll);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def386]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:972:58: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘h_cell’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:955:1: enter_function: entry to ‘assign_hypothetical_collations’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:958:30: call_function: inlined call to ‘list_head’ from ‘assign_hypothetical_collations’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:959:40: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:959:30: call_function: inlined call to ‘list_head’ from ‘assign_hypothetical_collations’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:964:34: call_function: inlined call to ‘list_length’ from ‘assign_hypothetical_collations’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:970:16: branch_true: following ‘true’ branch (when ‘extra_args > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:972:58: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_collate.c:972:58: danger: dereference of NULL ‘h_cell’
#  970|   	while (extra_args-- > 0)
#  971|   	{
#  972|-> 		(void) assign_collations_walker((Node *) lfirst(h_cell), loccontext);
#  973|   		h_cell = lnext(aggref->aggdirectargs, h_cell);
#  974|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def387]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_cte.c:270: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_clause->cycle_mark_value)},(union ListCell){.ptr_value=(cycle_clause->cycle_mark_default)}' depends on order of evaluation of side effects
#  268|   		cycle_clause->cycle_mark_type =
#  269|   			select_common_type(pstate,
#  270|-> 							   list_make2(cycle_clause->cycle_mark_value,
#  271|   										  cycle_clause->cycle_mark_default),
#  272|   							   "CYCLE", NULL);

Error: CPPCHECK_WARNING (CWE-768): [#def388]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_cte.c:286: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_clause->cycle_mark_value)},(union ListCell){.ptr_value=(cycle_clause->cycle_mark_default)}' depends on order of evaluation of side effects
#  284|   		cycle_clause->cycle_mark_typmod =
#  285|   			select_common_typmod(pstate,
#  286|-> 								 list_make2(cycle_clause->cycle_mark_value,
#  287|   											cycle_clause->cycle_mark_default),
#  288|   								 cycle_clause->cycle_mark_type);

Error: CPPCHECK_WARNING (CWE-768): [#def389]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_cte.c:292: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_clause->cycle_mark_value)},(union ListCell){.ptr_value=(cycle_clause->cycle_mark_default)}' depends on order of evaluation of side effects
#  290|   		cycle_clause->cycle_mark_collation =
#  291|   			select_common_collation(pstate,
#  292|-> 									list_make2(cycle_clause->cycle_mark_value,
#  293|   											   cycle_clause->cycle_mark_default),
#  294|   									true);

Error: CPPCHECK_WARNING (CWE-768): [#def390]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1276: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(result)},(union ListCell){.ptr_value=(cmp)}' depends on order of evaluation of side effects
# 1274|   		else
# 1275|   			result = (Node *) makeBoolExpr(useOr ? OR_EXPR : AND_EXPR,
# 1276|-> 										   list_make2(result, cmp),
# 1277|   										   a->location);
# 1278|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def391]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1315: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">=",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<=",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1313|   	{
# 1314|   		case AEXPR_BETWEEN:
# 1315|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1316|   											   aexpr, bexpr,
# 1317|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def392]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1324: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1322|   			break;
# 1323|   		case AEXPR_NOT_BETWEEN:
# 1324|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1325|   											   aexpr, bexpr,
# 1326|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def393]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1333: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">=",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<=",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1331|   			break;
# 1332|   		case AEXPR_BETWEEN_SYM:
# 1333|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1334|   											   aexpr, bexpr,
# 1335|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def394]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1340: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">=",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(cexpr))copyObjectImpl(cexpr),a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<=",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(bexpr))copyObjectImpl(bexpr),a->location))})' depends on order of evaluation of side effects
# 1338|   											   a->location));
# 1339|   			sub1 = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1340|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1341|   											   copyObject(aexpr), copyObject(cexpr),
# 1342|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def395]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1347: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sub1)},(union ListCell){.ptr_value=(sub2)}' depends on order of evaluation of side effects
# 1345|   											   a->location));
# 1346|   			sub2 = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1347|-> 			args = list_make2(sub1, sub2);
# 1348|   			result = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1349|   			break;

Error: CPPCHECK_WARNING (CWE-768): [#def396]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1351: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1349|   			break;
# 1350|   		case AEXPR_NOT_BETWEEN_SYM:
# 1351|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1352|   											   aexpr, bexpr,
# 1353|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def397]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1358: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(cexpr))copyObjectImpl(cexpr),a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(bexpr))copyObjectImpl(bexpr),a->location))})' depends on order of evaluation of side effects
# 1356|   											   a->location));
# 1357|   			sub1 = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1358|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1359|   											   copyObject(aexpr), copyObject(cexpr),
# 1360|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def398]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:1365: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sub1)},(union ListCell){.ptr_value=(sub2)}' depends on order of evaluation of side effects
# 1363|   											   a->location));
# 1364|   			sub2 = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1365|-> 			args = list_make2(sub1, sub2);
# 1366|   			result = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1367|   			break;

Error: CPPCHECK_WARNING (CWE-768): [#def399]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:3037: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(result)},(union ListCell){.ptr_value=(cmp)}' depends on order of evaluation of side effects
# 3035|   		else
# 3036|   			result = (Node *) makeBoolExpr(OR_EXPR,
# 3037|-> 										   list_make2(result, cmp),
# 3038|   										   location);
# 3039|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def400]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:3262: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(expr)},(union ListCell){.ptr_value=(encoding)}' depends on order of evaluation of side effects
# 3260|   	Const	   *encoding = getJsonEncodingConst(format);
# 3261|   	FuncExpr   *fexpr = makeFuncExpr(F_CONVERT_FROM, TEXTOID,
# 3262|-> 									 list_make2(expr, encoding),
# 3263|   									 InvalidOid, InvalidOid,
# 3264|   									 COERCE_EXPLICIT_CALL);

Error: CPPCHECK_WARNING (CWE-768): [#def401]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:3607: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(texpr)},(union ListCell){.ptr_value=(enc)}' depends on order of evaluation of side effects
# 3605|   		Const	   *enc = getJsonEncodingConst(returning->format);
# 3606|   		FuncExpr   *fexpr = makeFuncExpr(F_CONVERT_TO, BYTEAOID,
# 3607|-> 										 list_make2(texpr, enc),
# 3608|   										 InvalidOid, InvalidOid,
# 3609|   										 COERCE_EXPLICIT_CALL);

Error: CPPCHECK_WARNING (CWE-768): [#def402]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:3769: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(pstrdup("q")))},(union ListCell){.ptr_value=(makeString(pstrdup("a")))}' depends on order of evaluation of side effects
# 3767|   	free_parsestate(qpstate);
# 3768|   
# 3769|-> 	colref->fields = list_make2(makeString(pstrdup("q")),
# 3770|   								makeString(pstrdup("a")));
# 3771|   	colref->location = ctor->location;

Error: CPPCHECK_WARNING (CWE-768): [#def403]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_expr.c:3914: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(key)},(union ListCell){.ptr_value=(val)}' depends on order of evaluation of side effects
# 3912|   								 JS_FORMAT_DEFAULT,
# 3913|   								 InvalidOid, false);
# 3914|-> 	args = list_make2(key, val);
# 3915|   
# 3916|   	returning = transformJsonConstructorOutput(pstate, agg->constructor->output,

Error: CPPCHECK_WARNING (CWE-768): [#def404]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:1780: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((aarg)->ptr_value)},(union ListCell){.ptr_value=((harg)->ptr_value)}' depends on order of evaluation of side effects
# 1778|   		 */
# 1779|   		commontype = select_common_type(pstate,
# 1780|-> 										list_make2(lfirst(aarg), lfirst(harg)),
# 1781|   										"WITHIN GROUP",
# 1782|   										NULL);

Error: CPPCHECK_WARNING (CWE-768): [#def405]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:1784: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((aarg)->ptr_value)},(union ListCell){.ptr_value=((harg)->ptr_value)}' depends on order of evaluation of side effects
# 1782|   										NULL);
# 1783|   		commontypmod = select_common_typmod(pstate,
# 1784|-> 											list_make2(lfirst(aarg), lfirst(harg)),
# 1785|   											commontype);
# 1786|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def406]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2014:70: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lc’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2008:21: branch_true: following ‘true’ branch (when ‘i < nargs’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2010:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2010:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2012:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2012:20: branch_true: following ‘true’ branch (when ‘i >= numposargs’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2014:70: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2008:21: branch_true: following ‘true’ branch (when ‘i < nargs’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2010:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2012:20: branch_true: following ‘true’ branch (when ‘i >= numposargs’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2014:70: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2014:70: danger: dereference of NULL ‘lc’
# 2012|   		if (i >= numposargs)
# 2013|   		{
# 2014|-> 			appendStringInfo(&argbuf, "%s => ", (char *) lfirst(lc));
# 2015|   			lc = lnext(argnames, lc);
# 2016|   		}

Error: CPPCHECK_WARNING (CWE-457): [#def407]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_func.c:2271: warning[uninitvar]: Uninitialized variable: argoids
# 2269|   	 */
# 2270|   	oid = LookupFuncNameInternal(func->args_unspecified ? objtype : OBJECT_ROUTINE,
# 2271|-> 								 func->objname, nargs, argoids,
# 2272|   								 false, missing_ok,
# 2273|   								 &lookupError);

Error: CPPCHECK_WARNING (CWE-768): [#def408]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_oper.c:720: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltree)},(union ListCell){.ptr_value=(rtree)}' depends on order of evaluation of side effects
#  718|   	{
#  719|   		/* otherwise, binary operator */
#  720|-> 		args = list_make2(ltree, rtree);
#  721|   		actual_arg_types[0] = ltypeId;
#  722|   		actual_arg_types[1] = rtypeId;

Error: CPPCHECK_WARNING (CWE-768): [#def409]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_oper.c:821: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltree)},(union ListCell){.ptr_value=(rtree)}' depends on order of evaluation of side effects
#  819|   				 parser_errposition(pstate, location)));
#  820|   
#  821|-> 	args = list_make2(ltree, rtree);
#  822|   	actual_arg_types[0] = ltypeId;
#  823|   	actual_arg_types[1] = rtypeId;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def410]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2966:77: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘aliasp_item’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2659:1: enter_function: entry to ‘expandRTE’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2665:12: branch_true: following ‘true’ branch (when ‘colnames’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2666:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2667:12: branch_false: following ‘false’ branch (when ‘colvars’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2670:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2945:59: call_function: inlined call to ‘list_head’ from ‘expandRTE’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2951:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2951:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2961:44: branch_true: following ‘true’ branch (when ‘colnames’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2964:52: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2964:52: branch_true: following ‘true’ branch (when ‘coltype != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2966:77: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_relation.c:2966:77: danger: dereference of NULL ‘aliasp_item’
# 2964|   						if (OidIsValid(coltype))
# 2965|   						{
# 2966|-> 							char	   *label = strVal(lfirst(aliasp_item));
# 2967|   
# 2968|   							*colnames = lappend(*colnames,

Error: CPPCHECK_WARNING (CWE-768): [#def411]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:538: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(snamespace))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))}' depends on order of evaluation of side effects
#  536|   	altseqstmt = makeNode(AlterSeqStmt);
#  537|   	altseqstmt->sequence = makeRangeVar(snamespace, sname, -1);
#  538|-> 	attnamelist = list_make3(makeString(snamespace),
#  539|   							 makeString(cxt->relation->relname),
#  540|   							 makeString(column->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def412]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:538: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(snamespace))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))},(union ListCell){.ptr_value=(makeString(column->colname))}' depends on order of evaluation of side effects
#  536|   	altseqstmt = makeNode(AlterSeqStmt);
#  537|   	altseqstmt->sequence = makeRangeVar(snamespace, sname, -1);
#  538|-> 	attnamelist = list_make3(makeString(snamespace),
#  539|   							 makeString(cxt->relation->relname),
#  540|   							 makeString(column->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def413]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:1123: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(cxt->relation->schemaname))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))}' depends on order of evaluation of side effects
# 1121|   
# 1122|   			stmt->objtype = OBJECT_COLUMN;
# 1123|-> 			stmt->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
# 1124|   											   makeString(cxt->relation->relname),
# 1125|   											   makeString(def->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def414]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:1123: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(cxt->relation->schemaname))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))},(union ListCell){.ptr_value=(makeString(def->colname))}' depends on order of evaluation of side effects
# 1121|   
# 1122|   			stmt->objtype = OBJECT_COLUMN;
# 1123|-> 			stmt->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
# 1124|   											   makeString(cxt->relation->relname),
# 1125|   											   makeString(def->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def415]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:1340: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(heapRel->schemaname))},(union ListCell){.ptr_value=(makeString(heapRel->relname))}' depends on order of evaluation of side effects
# 1338|   
# 1339|   				stmt->objtype = OBJECT_TABCONSTRAINT;
# 1340|-> 				stmt->object = (Node *) list_make3(makeString(heapRel->schemaname),
# 1341|   												   makeString(heapRel->relname),
# 1342|   												   makeString(n->conname));

Error: CPPCHECK_WARNING (CWE-768): [#def416]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:1340: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(heapRel->schemaname))},(union ListCell){.ptr_value=(makeString(heapRel->relname))},(union ListCell){.ptr_value=(makeString(n->conname))}' depends on order of evaluation of side effects
# 1338|   
# 1339|   				stmt->objtype = OBJECT_TABCONSTRAINT;
# 1340|-> 				stmt->object = (Node *) list_make3(makeString(heapRel->schemaname),
# 1341|   												   makeString(heapRel->relname),
# 1342|   												   makeString(n->conname));

Error: CPPCHECK_WARNING (CWE-768): [#def417]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:1659: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(nspname))},(union ListCell){.ptr_value=(makeString(oprname))}' depends on order of evaluation of side effects
# 1657|   					/* For simplicity we always schema-qualify the op name */
# 1658|   					nspname = get_namespace_name(operform->oprnamespace);
# 1659|-> 					namelist = list_make2(makeString(nspname),
# 1660|   										  makeString(oprname));
# 1661|   					index->excludeOpNames = lappend(index->excludeOpNames,

Error: CPPCHECK_WARNING (CWE-768): [#def418]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:2013: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(nsp_name))},(union ListCell){.ptr_value=(makeString(coll_name))}' depends on order of evaluation of side effects
# 2011|   	nsp_name = get_namespace_name(coll_rec->collnamespace);
# 2012|   	coll_name = pstrdup(NameStr(coll_rec->collname));
# 2013|-> 	result = list_make2(makeString(nsp_name), makeString(coll_name));
# 2014|   
# 2015|   	ReleaseSysCache(ht_coll);

Error: CPPCHECK_WARNING (CWE-768): [#def419]
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_utilcmd.c:2043: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(nsp_name))},(union ListCell){.ptr_value=(makeString(opc_name))}' depends on order of evaluation of side effects
# 2041|   		char	   *opc_name = pstrdup(NameStr(opc_rec->opcname));
# 2042|   
# 2043|-> 		result = list_make2(makeString(nsp_name), makeString(opc_name));
# 2044|   	}
# 2045|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def420]
postgresql-18beta1/postgresql-17.2/src/backend/parser/scan.c:10861:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/postgresql-17.2/src/backend/parser/scan.c:9315:1: enter_function: entry to ‘core_yylex’
postgresql-18beta1/postgresql-17.2/src/backend/parser/scan.c:10411:17: call_function: calling ‘yy_get_next_buffer’ from ‘core_yylex’
#10859|   
#10860|   	yy_flush_buffer( b , yyscanner);
#10861|-> 
#10862|   	b->yy_input_file = file;
#10863|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def421]
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4039:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partexprs_item’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:3983:1: enter_function: entry to ‘get_qual_for_hash’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4020:26: call_function: inlined call to ‘list_head’ from ‘get_qual_for_hash’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4023:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4023:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4028:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4028:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4039:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:4039:43: danger: dereference of NULL ‘partexprs_item’
# 4037|   		else
# 4038|   		{
# 4039|-> 			keyCol = (Node *) copyObject(lfirst(partexprs_item));
# 4040|   			partexprs_item = lnext(key->partexprs, partexprs_item);
# 4041|   		}

Error: CPPCHECK_WARNING (CWE-768): [#def422]
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:1851: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(new_booltest)},(union ListCell){.ptr_value=(nulltest)}' depends on order of evaluation of side effects
# 1849|   			nulltest->location = -1;
# 1850|   
# 1851|-> 			new_clauses = list_make2(new_booltest, nulltest);
# 1852|   			or_clause = list_make1(makeBoolExpr(OR_EXPR, new_clauses, -1));
# 1853|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def423]
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2516:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘start’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2496:1: enter_function: entry to ‘get_steps_using_prefix_recurse’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2520:12: branch_true: following ‘true’ branch (when ‘cur_keyno < final_keyno’)...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2530:17: call_function: inlined call to ‘for_each_cell_setup’ from ‘get_steps_using_prefix_recurse’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2534:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2530:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2546:17: call_function: inlined call to ‘for_each_cell_setup’ from ‘get_steps_using_prefix_recurse’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2546:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2546:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2553:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2556:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2570:37: call_function: calling ‘get_steps_using_prefix_recurse’ from ‘get_steps_using_prefix_recurse’
# 2514|   
# 2515|   	Assert(start != NULL);
# 2516|-> 	cur_keyno = ((PartClauseInfo *) lfirst(start))->keyno;
# 2517|   	final_keyno = ((PartClauseInfo *) llast(prefix))->keyno;
# 2518|   

Error: CPPCHECK_WARNING (CWE-457): [#def424]
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:2696: warning[uninitvar]: Uninitialized variable: isnull
# 2694|   
# 2695|   		rowHash = compute_partition_hash_value(partnatts, partsupfunc, partcollation,
# 2696|-> 											   values, isnull);
# 2697|   
# 2698|   		greatest_modulus = boundinfo->nindexes;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def425]
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3488:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lc2’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3416:1: enter_function: entry to ‘perform_pruning_base_step’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3433:15: call_function: inlined call to ‘list_head’ from ‘perform_pruning_base_step’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3434:15: call_function: inlined call to ‘list_head’ from ‘perform_pruning_base_step’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3440:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3440:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3447:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3447:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3454:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3454:20: branch_false: following ‘false’ branch (when ‘keyno <= nvalues’)...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3457:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3457:20: branch_true: following ‘true’ branch (when ‘lc1’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3464:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3475:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3488:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3488:25: danger: dereference of NULL ‘lc2’
# 3486|   
# 3487|   			/* Set up the stepcmpfuncs entry, unless we already did */
# 3488|-> 			cmpfn = lfirst_oid(lc2);
# 3489|   			Assert(OidIsValid(cmpfn));
# 3490|   			if (cmpfn != context->stepcmpfuncs[stateidx].fn_oid)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def426]
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partprune.c:3532:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘values[0]’
# 3530|   
# 3531|   		case PARTITION_STRATEGY_LIST:
# 3532|-> 			return get_matching_list_bounds(context,
# 3533|   											opstep->opstrategy,
# 3534|   											values[0], nvalues,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def427]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("postmaster.opts", "w")’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4108:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4108:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: danger: ‘fopen("postmaster.opts", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 4114|   	}
# 4115|   
# 4116|-> 	fprintf(fp, "%s", fullprogname);
# 4117|   	for (i = 1; i < argc; i++)
# 4118|   		fprintf(fp, " \"%s\"", argv[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def428]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("postmaster.opts", "w")’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4108:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4108:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/postmaster.c:4116:9: danger: ‘fopen("postmaster.opts", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 4114|   	}
# 4115|   
# 4116|-> 	fprintf(fp, "%s", fullprogname);
# 4117|   	for (i = 1; i < argc; i++)
# 4118|   		fprintf(fp, " \"%s\"", argv[i]);

Error: GCC_ANALYZER_WARNING: [#def429]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:240:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:221:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:223:46: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:236:17: release_resource: closed here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:238:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:240:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:240:32: danger: ‘1’ could be invalid
#  238|   		if (fd != -1)
#  239|   		{
#  240|-> 			(void) dup2(fd, STDOUT_FILENO);
#  241|   			(void) dup2(fd, STDERR_FILENO);
#  242|   			close(fd);

Error: GCC_ANALYZER_WARNING: [#def430]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:241:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:221:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:223:46: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:237:17: release_resource: closed here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:238:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:240:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:241:32: danger: ‘2’ could be invalid
#  239|   		{
#  240|   			(void) dup2(fd, STDOUT_FILENO);
#  241|-> 			(void) dup2(fd, STDERR_FILENO);
#  242|   			close(fd);
#  243|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def431]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:737:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(syslogPipe[1], 1)’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:595:1: enter_function: entry to ‘SysLogger_Start’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:603:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:624:13: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:666:20: call_function: calling ‘logfile_getname’ from ‘SysLogger_Start’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:666:20: return_function: returning to ‘SysLogger_Start’ from ‘logfile_getname’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:709:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:719:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:719:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:730:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:737:21: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:737:20: danger: ‘dup2(syslogPipe[1], 1)’ leaks here; was opened at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  735|   #ifndef WIN32
#  736|   		fflush(stdout);
#  737|-> 		if (dup2(syslogPipe[1], STDOUT_FILENO) < 0)
#  738|   			ereport(FATAL,
#  739|   					(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def432]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:742:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(syslogPipe[1], 2)’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:595:1: enter_function: entry to ‘SysLogger_Start’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:603:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:624:13: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:666:20: call_function: calling ‘logfile_getname’ from ‘SysLogger_Start’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:666:20: return_function: returning to ‘SysLogger_Start’ from ‘logfile_getname’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:709:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:719:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:719:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:730:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:737:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:741:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:742:21: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:742:20: danger: ‘dup2(syslogPipe[1], 2)’ leaks here; was opened at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  740|   					 errmsg("could not redirect stdout: %m")));
#  741|   		fflush(stderr);
#  742|-> 		if (dup2(syslogPipe[1], STDERR_FILENO) < 0)
#  743|   			ereport(FATAL,
#  744|   					(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def433]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1516:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("current_logfiles.tmp", "w")’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1495:14: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1498:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1500:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1516:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1518:21: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1516:13: danger: ‘fopen("current_logfiles.tmp", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1514|   	}
# 1515|   
# 1516|-> 	if (last_sys_file_name && (Log_destination & LOG_DESTINATION_STDERR))
# 1517|   	{
# 1518|   		if (fprintf(fh, "stderr %s\n", last_sys_file_name) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1516:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("current_logfiles.tmp", "w")’
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1495:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1498:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1500:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1516:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1518:21: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/postmaster/syslogger.c:1516:13: danger: ‘fopen("current_logfiles.tmp", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1514|   	}
# 1515|   
# 1516|-> 	if (last_sys_file_name && (Log_destination & LOG_DESTINATION_STDERR))
# 1517|   	{
# 1518|   		if (fprintf(fh, "stderr %s\n", last_sys_file_name) < 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def435]
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:1021:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:985:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:990:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:1002:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:1004:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:1006:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:1009:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/regex/rege_dfa.c:1021:25: danger: dereference of NULL ‘lastap.ss’
# 1019|   				lastap = ap;
# 1020|   			assert(ap.ss != NULL);
# 1021|-> 			lastap.ss->inchain[lastap.co] = ss->inchain[i];
# 1022|   		}
# 1023|   		ss->outs[i] = NULL;

Error: CPPCHECK_WARNING (CWE-457): [#def436]
postgresql-18beta1/postgresql-17.2/src/backend/regex/regexec.c:235: warning[uninitvar]: Uninitialized variable: v->pmatch
#  233|   		else
#  234|   			v->pmatch = (regmatch_t *) MALLOC(v->nmatch * sizeof(regmatch_t));
#  235|-> 		if (v->pmatch == NULL)
#  236|   			return REG_ESPACE;
#  237|   		zapallsubs(v->pmatch, v->nmatch);

Error: CPPCHECK_WARNING (CWE-457): [#def437]
postgresql-18beta1/postgresql-17.2/src/backend/replication/logical/reorderbuffer.c:4764: error[legacyUninitvar]: Uninitialized variable: chunksize
# 4762|   		elog(ERROR, "unexpected type of toast chunk");
# 4763|   
# 4764|-> 	ent->size += chunksize;
# 4765|   	ent->last_chunk_seq = chunk_seq;
# 4766|   	ent->num_chunks++;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def438]
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1107:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1065:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1071:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1094:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1096:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1105:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1107:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_gram.c:1107:9: danger: use of uninitialized value ‘yyss’ here
# 1105|           if (! yyptr)
# 1106|             YYNOMEM;
# 1107|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1108|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1109|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def439]
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2009:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.l:296:1: enter_function: entry to ‘replication_scanner_is_replication_command’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.l:298:22: call_function: calling ‘replication_yylex’ from ‘replication_scanner_is_replication_command’
# 2007|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2008|   	 * we need to put in 2 end-of-buffer characters.
# 2009|-> 	 */
# 2010|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 2011|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def440]
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2050: warning[nullPointer]: Possible null pointer dereference: b
# 2048|       
# 2049|   	yy_flush_buffer( b );
# 2050|-> 
# 2051|   	b->yy_input_file = file;
# 2052|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def441]
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2051: warning[nullPointer]: Possible null pointer dereference: b
# 2049|   	yy_flush_buffer( b );
# 2050|   
# 2051|-> 	b->yy_input_file = file;
# 2052|   	b->yy_fill_buffer = 1;
# 2053|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def442]
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2212:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2198:17: enter_function: entry to ‘replication_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2208:24: call_function: inlined call to ‘replication_yyalloc’ from ‘replication_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2209:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2212:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2222:2: call_function: calling ‘replication_yy_switch_to_buffer’ from ‘replication_yy_scan_buffer’
# 2210|   	if ( ! b )
# 2211|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 2212|-> 
# 2213|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 2214|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def443]
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2264:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2248:17: enter_function: entry to ‘replication_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2257:24: call_function: inlined call to ‘replication_yyalloc’ from ‘replication_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2258:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2258:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/repl_scanner.c:2266:6: call_function: calling ‘replication_yy_scan_buffer’ from ‘replication_yy_scan_bytes’
# 2262|   	for ( i = 0; i < _yybytes_len; ++i )
# 2263|   		buf[i] = yybytes[i];
# 2264|-> 
# 2265|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 2266|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def444]
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:980:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:938:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:944:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:967:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:969:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:978:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:980:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_gram.c:980:9: danger: use of uninitialized value ‘yyss’ here
#  978|           if (! yyptr)
#  979|             YYNOMEM;
#  980|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#  981|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  982|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def445]
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1644:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1631:21: enter_function: entry to ‘syncrep_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1635:24: call_function: inlined call to ‘syncrep_yyalloc’ from ‘syncrep_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1636:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1639:2: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1644:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1642|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1643|   	 * we need to put in 2 end-of-buffer characters.
# 1644|-> 	 */
# 1645|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1646|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def446]
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1685: warning[nullPointer]: Possible null pointer dereference: b
# 1683|       
# 1684|   	yy_flush_buffer( b );
# 1685|-> 
# 1686|   	b->yy_input_file = file;
# 1687|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def447]
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1686: warning[nullPointer]: Possible null pointer dereference: b
# 1684|   	yy_flush_buffer( b );
# 1685|   
# 1686|-> 	b->yy_input_file = file;
# 1687|   	b->yy_fill_buffer = 1;
# 1688|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def448]
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1847:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1833:17: enter_function: entry to ‘syncrep_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1843:24: call_function: inlined call to ‘syncrep_yyalloc’ from ‘syncrep_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1844:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1847:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1857:2: call_function: calling ‘syncrep_yy_switch_to_buffer’ from ‘syncrep_yy_scan_buffer’
# 1845|   	if ( ! b )
# 1846|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 1847|-> 
# 1848|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 1849|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def449]
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1899:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1883:17: enter_function: entry to ‘syncrep_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1892:24: call_function: inlined call to ‘syncrep_yyalloc’ from ‘syncrep_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1893:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1893:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/replication/syncrep_scanner.c:1901:6: call_function: calling ‘syncrep_yy_scan_buffer’ from ‘syncrep_yy_scan_bytes’
# 1897|   	for ( i = 0; i < _yybytes_len; ++i )
# 1898|   		buf[i] = yybytes[i];
# 1899|-> 
# 1900|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1901|   

Error: CPPCHECK_WARNING (CWE-768): [#def450]
postgresql-18beta1/postgresql-17.2/src/backend/rewrite/rewriteSearchCycle.c:192: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeVar(1,path_varattno,2287,-1,0,0))}),(union ListCell){.ptr_value=(arr)}' depends on order of evaluation of side effects
#  190|   
#  191|   	fexpr = makeFuncExpr(F_ARRAY_CAT, RECORDARRAYOID,
#  192|-> 						 list_make2(makeVar(1, path_varattno, RECORDARRAYOID, -1, 0, 0),
#  193|   									arr),
#  194|   						 InvalidOid, InvalidOid, COERCE_EXPLICIT_CALL);

Error: CPPCHECK_WARNING (CWE-768): [#def451]
postgresql-18beta1/postgresql-17.2/src/backend/rewrite/rewriteSearchCycle.c:558: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_col_rowexpr)},((union ListCell){.ptr_value=(makeVar(1,cpa_attno,2287,-1,0,0))})' depends on order of evaluation of side effects
#  556|   		saoe->opno = RECORD_EQ_OP;
#  557|   		saoe->useOr = true;
#  558|-> 		saoe->args = list_make2(cycle_col_rowexpr,
#  559|   								makeVar(1, cpa_attno, RECORDARRAYOID, -1, 0, 0));
#  560|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def452]
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:795:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:741:1: enter_function: entry to ‘dependency_is_compatible_clause’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:746:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:751:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:751:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:755:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:755:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:758:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:761:13: call_function: inlined call to ‘is_opclause’ from ‘dependency_is_compatible_clause’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:795:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:795:18: danger: dereference of NULL ‘clause’
#  793|   		/* OK to proceed with checking "var" */
#  794|   	}
#  795|-> 	else if (IsA(clause, ScalarArrayOpExpr))
#  796|   	{
#  797|   		/* If it's a scalar array operator, check for Var IN Const. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def453]
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1223:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1168:1: enter_function: entry to ‘dependency_is_compatible_expression’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1174:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1179:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1179:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1183:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1183:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1186:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1189:13: call_function: inlined call to ‘is_opclause’ from ‘dependency_is_compatible_expression’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1223:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/statistics/dependencies.c:1223:18: danger: dereference of NULL ‘clause’
# 1221|   		/* OK to proceed with checking "var" */
# 1222|   	}
# 1223|-> 	else if (IsA(clause, ScalarArrayOpExpr))
# 1224|   	{
# 1225|   		/* If it's a scalar array operator, check for Var IN Const. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def454]
postgresql-18beta1/postgresql-17.2/src/backend/statistics/mcv.c:1710:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/mcv.c:2126:1: enter_function: entry to ‘mcv_clause_selectivity_or’
postgresql-18beta1/postgresql-17.2/src/backend/statistics/mcv.c:2140:23: call_function: calling ‘mcv_get_match_bitmap’ from ‘mcv_clause_selectivity_or’
# 1708|   			}
# 1709|   		}
# 1710|-> 		else if (IsA(clause, ScalarArrayOpExpr))
# 1711|   		{
# 1712|   			ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) clause;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def455]
postgresql-18beta1/postgresql-17.2/src/backend/storage/file/fd.c:2867:38: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/storage/file/fd.c:2851:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/storage/file/fd.c:2858:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/file/fd.c:2861:20: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/storage/file/fd.c:2867:38: throw: if ‘GetCurrentSubTransactionId’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/storage/file/fd.c:2867:38: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 2865|   		desc->kind = AllocateDescDir;
# 2866|   		desc->desc.dir = dir;
# 2867|-> 		desc->create_subid = GetCurrentSubTransactionId();
# 2868|   		numAllocatedDescs++;
# 2869|   		return desc->desc.dir;

Error: CPPCHECK_WARNING (CWE-457): [#def456]
postgresql-18beta1/postgresql-17.2/src/backend/storage/ipc/dsm_registry.c:199: error[legacyUninitvar]: Uninitialized variable: ret
#  197|   	MemoryContextSwitchTo(oldcontext);
#  198|   
#  199|-> 	return ret;
#  200|   }

Error: CPPCHECK_WARNING (CWE-909): [#def457]
postgresql-18beta1/postgresql-17.2/src/backend/storage/lmgr/lmgr.c:720: error[uninitStructMember]: Uninitialized struct member: callback.previous
#  718|   
#  719|   	if (oper != XLTW_None)
#  720|-> 		error_context_stack = callback.previous;
#  721|   }
#  722|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def458]
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:524:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*itemidptr.itemoff’
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:699:1: enter_function: entry to ‘PageRepairFragmentation’
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:723:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:725:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:723:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:727:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:723:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:736:17: call_function: inlined call to ‘PageGetMaxOffsetNumber’ from ‘PageRepairFragmentation’
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:736:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:740:37: branch_false: following ‘false’ branch (when ‘i > nline’)...
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:777:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:778:12: branch_false: following ‘false’ branch (when ‘nstorage != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:786:39: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:786:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:792:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/storage/page/bufpage.c:792:17: call_function: calling ‘compactify_tuples’ from ‘PageRepairFragmentation’
#  522|   		{
#  523|   			itemidptr = &itemidbase[i];
#  524|-> 			if (upper != itemidptr->itemoff + itemidptr->alignedlen)
#  525|   				break;
#  526|   			upper -= itemidptr->alignedlen;

Error: CPPCHECK_WARNING (CWE-457): [#def459]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/dict_synonym.c:230: error[uninitvar]: Uninitialized variables: &key.outlen, &key.flags
#  228|   	key.out = NULL;
#  229|   
#  230|-> 	found = (Syn *) bsearch(&key, d->syn, d->len, sizeof(Syn), compareSyn);
#  231|   	pfree(key.in);
#  232|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def460]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/ts_parse.c:82:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘res’
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/ts_parse.c:540:1: enter_function: entry to ‘hlparsetext’
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/ts_parse.c:590:38: call_function: calling ‘LexizeExec’ from ‘hlparsetext’
#   80|   	else
#   81|   		list->head = list->tail = newpl;
#   82|-> 	newpl->next = NULL;
#   83|   }
#   84|   

Error: CPPCHECK_WARNING (CWE-476): [#def461]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser.c:196: error[nullPointer]: Null pointer dereference
#  194|   		}
#  195|   		st->list[st->cur].lexeme = palloc(llen + 1);
#  196|-> 		memcpy(st->list[st->cur].lexeme, lex, llen);
#  197|   		st->list[st->cur].lexeme[llen] = '\0';
#  198|   		st->list[st->cur].type = type;

Error: CPPCHECK_WARNING (CWE-476): [#def462]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser.c:196: error[nullPointer]: Null pointer dereference: lex
#  194|   		}
#  195|   		st->list[st->cur].lexeme = palloc(llen + 1);
#  196|-> 		memcpy(st->list[st->cur].lexeme, lex, llen);
#  197|   		st->list[st->cur].lexeme[llen] = '\0';
#  198|   		st->list[st->cur].type = type;

Error: CPPCHECK_WARNING (CWE-476): [#def463]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:454: error[ctunullpointer]: Null pointer dereference: prs
#  452|    * an alpha character, but not a member of other char classes.
#  453|    */
#  454|-> p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def464]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:454: warning[nullPointer]: Possible null pointer dereference: prs
#  452|    * an alpha character, but not a member of other char classes.
#  453|    */
#  454|-> p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def465]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:455: error[ctunullpointer]: Null pointer dereference: prs
#  453|    */
#  454|   p_iswhat(alnum, 1)
#  455|-> p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def466]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:455: warning[nullPointer]: Possible null pointer dereference: prs
#  453|    */
#  454|   p_iswhat(alnum, 1)
#  455|-> p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def467]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:456: error[ctunullpointer]: Null pointer dereference: prs
#  454|   p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|-> p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def468]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:456: warning[nullPointer]: Possible null pointer dereference: prs
#  454|   p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|-> p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def469]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:457: error[ctunullpointer]: Null pointer dereference: prs
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|-> p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def470]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:457: warning[nullPointer]: Possible null pointer dereference: prs
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|-> p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def471]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:458: error[ctunullpointer]: Null pointer dereference: prs
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|-> p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def472]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:458: warning[nullPointer]: Possible null pointer dereference: prs
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|-> p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def473]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:459: error[ctunullpointer]: Null pointer dereference: prs
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|-> p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def474]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:459: warning[nullPointer]: Possible null pointer dereference: prs
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|-> p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def475]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:460: error[ctunullpointer]: Null pointer dereference: prs
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|-> p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def476]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:460: warning[nullPointer]: Possible null pointer dereference: prs
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|-> p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def477]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:461: error[ctunullpointer]: Null pointer dereference: prs
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|-> p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)
#  463|   

Error: CPPCHECK_WARNING (CWE-476): [#def478]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:461: warning[nullPointer]: Possible null pointer dereference: prs
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|-> p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)
#  463|   

Error: CPPCHECK_WARNING (CWE-476): [#def479]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:462: error[ctunullpointer]: Null pointer dereference: prs
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|-> p_iswhat(xdigit, 0)
#  463|   
#  464|   /* p_iseq should be used only for ascii symbols */

Error: CPPCHECK_WARNING (CWE-476): [#def480]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:462: warning[nullPointer]: Possible null pointer dereference: prs
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|-> p_iswhat(xdigit, 0)
#  463|   
#  464|   /* p_iseq should be used only for ascii symbols */

Error: CPPCHECK_WARNING (CWE-476): [#def481]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:470: error[ctunullpointer]: Null pointer dereference: prs
#  468|   {
#  469|   	Assert(prs->state);
#  470|-> 	return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
#  471|   }
#  472|   

Error: CPPCHECK_WARNING (CWE-476): [#def482]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:470: warning[nullPointer]: Possible null pointer dereference: prs
#  468|   {
#  469|   	Assert(prs->state);
#  470|-> 	return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
#  471|   }
#  472|   

Error: CPPCHECK_WARNING (CWE-476): [#def483]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:477: error[ctunullpointer]: Null pointer dereference: prs
#  475|   {
#  476|   	Assert(prs->state);
#  477|-> 	return (prs->state->posbyte == prs->lenstr || prs->state->charlen == 0) ? 1 : 0;
#  478|   }
#  479|   

Error: CPPCHECK_WARNING (CWE-476): [#def484]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:477: warning[nullPointer]: Possible null pointer dereference: prs
#  475|   {
#  476|   	Assert(prs->state);
#  477|-> 	return (prs->state->posbyte == prs->lenstr || prs->state->charlen == 0) ? 1 : 0;
#  478|   }
#  479|   

Error: CPPCHECK_WARNING (CWE-476): [#def485]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:483: warning[nullPointer]: Possible null pointer dereference: prs
#  481|   p_iseqC(TParser *prs)
#  482|   {
#  483|-> 	return p_iseq(prs, prs->c);
#  484|   }
#  485|   

Error: CPPCHECK_WARNING (CWE-476): [#def486]
postgresql-18beta1/postgresql-17.2/src/backend/tsearch/wparser_def.c:489: warning[nullPointer]: Possible null pointer dereference: prs
#  487|   p_isneC(TParser *prs)
#  488|   {
#  489|-> 	return !p_iseq(prs, prs->c);
#  490|   }
#  491|   

Error: CPPCHECK_WARNING (CWE-457): [#def487]
postgresql-18beta1/postgresql-17.2/src/backend/utils/activity/backend_status.c:1108: error[uninitvar]: Uninitialized variables: &key.backendStatus, &key.backend_xid, &key.backend_xmin, &key.backend_subxact_count, &key.backend_subxact_overflowed
# 1106|   	 */
# 1107|   	key.proc_number = procNumber;
# 1108|-> 	return bsearch(&key, localBackendStatusTable, localNumBackends,
# 1109|   				   sizeof(LocalPgBackendStatus), cmp_lbestatus);
# 1110|   }

Error: CPPCHECK_WARNING (CWE-457): [#def488]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:1351: warning[uninitvar]: Uninitialized variable: dim
# 1349|   
# 1350|   	/* This checks for overflow of array dimensions */
# 1351|-> 	nitems = ArrayGetNItems(ndim, dim);
# 1352|   	ArrayCheckBounds(ndim, dim, lBound);
# 1353|   

Error: CPPCHECK_WARNING (CWE-457): [#def489]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:1352: warning[uninitvar]: Uninitialized variable: lBound
# 1350|   	/* This checks for overflow of array dimensions */
# 1351|   	nitems = ArrayGetNItems(ndim, dim);
# 1352|-> 	ArrayCheckBounds(ndim, dim, lBound);
# 1353|   
# 1354|   	/*

Error: CPPCHECK_WARNING (CWE-457): [#def490]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:1697: warning[uninitvar]: Uninitialized variable: buf
# 1695|   	}
# 1696|   
# 1697|-> 	PG_RETURN_TEXT_P(cstring_to_text(buf));
# 1698|   }
# 1699|   

Error: CPPCHECK_WARNING (CWE-457): [#def491]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:2902: warning[uninitvar]: Uninitialized variable: dim
# 2900|   
# 2901|   		/* complain if too few source items; we ignore extras, however */
# 2902|-> 		if (nelems < ArrayGetNItems(nSubscripts, dim))
# 2903|   			ereport(ERROR,
# 2904|   					(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def492]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3772:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bitmap’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3767:18: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3767:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3770:16: branch_true: following ‘true’ branch (when ‘nelems > 7’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3772:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3772:21: danger: dereference of NULL ‘bitmap’
# 3770|   	while (nelems >= 8)
# 3771|   	{
# 3772|-> 		if (*bitmap != 0xFF)
# 3773|   			return true;
# 3774|   		bitmap++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def493]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3782:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bitmap’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3767:18: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3767:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3770:16: branch_false: following ‘false’ branch (when ‘nelems <= 7’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3770:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3780:16: branch_true: following ‘true’ branch (when ‘nelems > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3782:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:3782:22: danger: dereference of NULL ‘bitmap’
# 3780|   	while (nelems > 0)
# 3781|   	{
# 3782|-> 		if ((*bitmap & bitmask) == 0)
# 3783|   			return true;
# 3784|   		bitmask <<= 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def494]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:4968:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘destbitmap’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5691:1: enter_function: entry to ‘makeArrayResultArr’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5701:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5712:54: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5738:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5739:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5739:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5739:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/arrayfuncs.c:5739:25: call_function: calling ‘array_bitmap_copy’ from ‘makeArrayResultArr’
# 4966|   	destbitmap += destoffset / 8;
# 4967|   	destbitmask = 1 << (destoffset % 8);
# 4968|-> 	destbitval = *destbitmap;
# 4969|   	if (srcbitmap)
# 4970|   	{

Error: CPPCHECK_WARNING (CWE-457): [#def495]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/dbsize.c:607: warning[uninitvar]: Uninitialized variable: buf
#  605|   	}
#  606|   
#  607|-> 	PG_RETURN_TEXT_P(cstring_to_text(buf));
#  608|   }
#  609|   

Error: CPPCHECK_WARNING (CWE-457): [#def496]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/inet_cidr_ntop.c:285: warning[uninitvar]: Uninitialized variable: outbuf
#  283|   	/* Format CIDR /width. */
#  284|   	(void) SPRINTF((cp, "/%u", bits));
#  285|-> 	if (strlen(outbuf) + 1 > size)
#  286|   		goto emsgsize;
#  287|   	strcpy(dst, outbuf);

Error: CPPCHECK_WARNING (CWE-457): [#def497]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb.c:101: error[legacyUninitvar]: Uninitialized variable: nbytes
#   99|   		elog(ERROR, "unsupported jsonb version number %d", version);
#  100|   
#  101|-> 	return jsonb_from_cstring(str, nbytes, false, NULL);
#  102|   }
#  103|   

Error: CPPCHECK_WARNING (CWE-457): [#def498]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb.c:101: error[legacyUninitvar]: Uninitialized variable: str
#   99|   		elog(ERROR, "unsupported jsonb version number %d", version);
#  100|   
#  101|-> 	return jsonb_from_cstring(str, nbytes, false, NULL);
#  102|   }
#  103|   

Error: COMPILER_WARNING (CWE-457): [#def499]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c: scope_hint: In function ‘compareJsonbContainers’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:294:34: warning[-Wmaybe-uninitialized]: ‘va.type’ may be used uninitialized
#  294 |                         res = (va.type > vb.type) ? 1 : -1;
#      |                                ~~^~~~~
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:202:33: note: ‘va’ declared here
#  202 |                 JsonbValue      va,
#      |                                 ^~
#  292|   			Assert(vb.type != jbvBinary);
#  293|   			/* Type-defined order */
#  294|-> 			res = (va.type > vb.type) ? 1 : -1;
#  295|   		}
#  296|   	}

Error: COMPILER_WARNING (CWE-457): [#def500]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:294:44: warning[-Wmaybe-uninitialized]: ‘vb.type’ may be used uninitialized
#  294 |                         res = (va.type > vb.type) ? 1 : -1;
#      |                                          ~~^~~~~
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:203:41: note: ‘vb’ declared here
#  203 |                                         vb;
#      |                                         ^~
#  292|   			Assert(vb.type != jbvBinary);
#  293|   			/* Type-defined order */
#  294|-> 			res = (va.type > vb.type) ? 1 : -1;
#  295|   		}
#  296|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def501]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonbsubs.c:152: error[legacyUninitvar]: Uninitialized variable: subExpr
#  150|   		}
#  151|   
#  152|-> 		upperIndexpr = lappend(upperIndexpr, subExpr);
#  153|   	}
#  154|   

Error: CPPCHECK_WARNING (CWE-476): [#def502]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonfuncs.c:5815: warning[nullPointer]: Possible null pointer dereference: res
# 5813|   	}
# 5814|   
# 5815|-> 	if (res->type == jbvArray)
# 5816|   		res->val.array.rawScalar = is_scalar;
# 5817|   

Error: CPPCHECK_WARNING (CWE-457): [#def503]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath.c:127: error[legacyUninitvar]: Uninitialized variable: nbytes
#  125|   		elog(ERROR, "unsupported jsonpath version number: %d", version);
#  126|   
#  127|-> 	return jsonPathFromCstring(str, nbytes, NULL);
#  128|   }
#  129|   

Error: CPPCHECK_WARNING (CWE-457): [#def504]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath.c:127: error[legacyUninitvar]: Uninitialized variable: str
#  125|   		elog(ERROR, "unsupported jsonpath version number: %d", version);
#  126|   
#  127|-> 	return jsonPathFromCstring(str, nbytes, NULL);
#  128|   }
#  129|   

Error: CPPCHECK_WARNING (CWE-457): [#def505]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_exec.c:1318: error[legacyUninitvar]: Uninitialized variable: datum
# 1316|   				jb = &jbv;
# 1317|   				jb->type = jbvNumeric;
# 1318|-> 				jb->val.numeric = DatumGetNumeric(DirectFunctionCall1(int8_numeric,
# 1319|   																	  datum));
# 1320|   

Error: CPPCHECK_WARNING (CWE-457): [#def506]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_exec.c:1391: error[legacyUninitvar]: Uninitialized variable: bval
# 1389|   				jb = &jbv;
# 1390|   				jb->type = jbvBool;
# 1391|-> 				jb->val.boolean = bval;
# 1392|   
# 1393|   				res = executeNextItem(cxt, jsp, NULL, jb, found, true);

Error: CPPCHECK_WARNING (CWE-457): [#def507]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_exec.c:1598: error[legacyUninitvar]: Uninitialized variable: datum
# 1596|   				jb = &jbv;
# 1597|   				jb->type = jbvNumeric;
# 1598|-> 				jb->val.numeric = DatumGetNumeric(DirectFunctionCall1(int4_numeric,
# 1599|   																	  datum));
# 1600|   

Error: CPPCHECK_WARNING (CWE-768): [#def508]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_exec.c:3517: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(jvl->singleton)},(union ListCell){.ptr_value=(jbv)}' depends on order of evaluation of side effects
# 3515|   	if (jvl->singleton)
# 3516|   	{
# 3517|-> 		jvl->list = list_make2(jvl->singleton, jbv);
# 3518|   		jvl->singleton = NULL;
# 3519|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def509]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1234:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1192:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1198:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1221:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1223:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1232:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1234:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.c:1234:9: danger: use of uninitialized value ‘yyss’ here
# 1232|           if (! yyptr)
# 1233|             YYNOMEM;
# 1234|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1235|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1236|   #  undef YYSTACK_RELOCATE

Error: CPPCHECK_WARNING (CWE-768): [#def510]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.y:204: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].value)},(union ListCell){.ptr_value=(yyvsp[0].value)}' depends on order of evaluation of side effects
#  202|   accessor_expr:
#  203|   	path_primary					{ $$ = list_make1($1); }
#  204|-> 	| '(' expr ')' accessor_op		{ $$ = list_make2($2, $4); }
#  205|   	| '(' predicate ')' accessor_op	{ $$ = list_make2($2, $4); }
#  206|   	| accessor_expr accessor_op		{ $$ = lappend($1, $2); }

Error: CPPCHECK_WARNING (CWE-768): [#def511]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_gram.y:205: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].value)},(union ListCell){.ptr_value=(yyvsp[0].value)}' depends on order of evaluation of side effects
#  203|   	path_primary					{ $$ = list_make1($1); }
#  204|   	| '(' expr ')' accessor_op		{ $$ = list_make2($2, $4); }
#  205|-> 	| '(' predicate ')' accessor_op	{ $$ = list_make2($2, $4); }
#  206|   	| accessor_expr accessor_op		{ $$ = lappend($1, $2); }
#  207|   	;

Error: CPPCHECK_WARNING (CWE-476): [#def512]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_scan.c:5369: warning[nullPointer]: Possible null pointer dereference: b
# 5367|       
# 5368|   	yy_flush_buffer( b );
# 5369|-> 
# 5370|   	b->yy_input_file = file;
# 5371|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def513]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonpath_scan.c:5370: warning[nullPointer]: Possible null pointer dereference: b
# 5368|   	yy_flush_buffer( b );
# 5369|   
# 5370|-> 	b->yy_input_file = file;
# 5371|   	b->yy_fill_buffer = 1;
# 5372|   

Error: CPPCHECK_WARNING (CWE-476): [#def514]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:510: warning[nullPointer]: Possible null pointer dereference: blocked_instance
#  508|   
#  509|   		lockMethodTable = GetLockTagsMethodTable(&(blocked_instance->locktag));
#  510|-> 		conflictMask = lockMethodTable->conflictTab[blocked_instance->waitLockMode];
#  511|   
#  512|   		/* Now scan the PROCLOCK data for conflicting procs */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def515]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:510:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘blocked_instance’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:483:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:485:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:497:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:509:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/lockfuncs.c:510:61: danger: dereference of NULL ‘blocked_instance’
#  508|   
#  509|   		lockMethodTable = GetLockTagsMethodTable(&(blocked_instance->locktag));
#  510|-> 		conflictMask = lockMethodTable->conflictTab[blocked_instance->waitLockMode];
#  511|   
#  512|   		/* Now scan the PROCLOCK data for conflicting procs */

Error: CPPCHECK_WARNING (CWE-457): [#def516]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/misc.c:760: warning[uninitvar]: Uninitialized variable: values
#  758|   	}
#  759|   
#  760|-> 	return HeapTupleGetDatum(heap_form_tuple(tupdesc, values, isnull));
#  761|   }
#  762|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def517]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:9329:30: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11108:1: enter_function: entry to ‘power_var_int’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11152:12: branch_false: following ‘false’ branch (when ‘f <= 1.31072e+5’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11156:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11156:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11168:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11203:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11228:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11246:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11247:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11251:16: branch_false: following ‘false’ branch (when ‘mask == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11297:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11297:9: call_function: calling ‘free_var’ from ‘power_var_int’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11297:9: return_function: returning to ‘power_var_int’ from ‘free_var’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11300:12: branch_true: following ‘true’ branch (when ‘neg != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11301:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/numeric.c:11301:17: call_function: calling ‘div_var_fast’ from ‘power_var_int’
# 9327|   	load_ndigits = Min(div_ndigits, var1ndigits);
# 9328|   	for (i = 0; i < load_ndigits; i++)
# 9329|-> 		div[i + 1] = var1digits[i];
# 9330|   
# 9331|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def518]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def519]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def520]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def521]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def522]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def523]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def524]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def525]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def526]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def527]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:672:17: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  670|   #endif
#  671|   	if (!setlocale(LC_MONETARY, save_lc_monetary))
#  672|-> 		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|   		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def528]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def529]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def530]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def531]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def532]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def533]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def534]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def535]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def536]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def537]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:674:17: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/8)
#  672|   		elog(FATAL, "failed to restore LC_MONETARY to \"%s\"", save_lc_monetary);
#  673|   	if (!setlocale(LC_NUMERIC, save_lc_numeric))
#  674|-> 		elog(FATAL, "failed to restore LC_NUMERIC to \"%s\"", save_lc_numeric);
#  675|   
#  676|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def538]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def539]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def540]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def541]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def542]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def543]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def544]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def545]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def546]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def547]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:686:17: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/8)
#  684|   
#  685|   		/* Release the pstrdup'd locale names */
#  686|-> 		pfree(save_lc_monetary);
#  687|   		pfree(save_lc_numeric);
#  688|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-401): [#def548]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/74/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def549]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def550]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/72/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def551]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(9)](sarif:/runs/0/results/73/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def552]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(9)](sarif:/runs/0/results/75/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def553]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(9)](sarif:/runs/0/results/77/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def554]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/76/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def555]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/79/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def556]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(9)](sarif:/runs/0/results/78/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def557]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:687:17: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(9)](sarif:/runs/0/results/71/codeFlows/0/threadFlows/0/locations/8)
#  685|   		/* Release the pstrdup'd locale names */
#  686|   		pfree(save_lc_monetary);
#  687|-> 		pfree(save_lc_numeric);
#  688|   #ifdef WIN32
#  689|   		pfree(save_lc_ctype);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def558]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(10)](sarif:/runs/0/results/87/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def559]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(10)](sarif:/runs/0/results/83/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def560]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.grouping’ leaks here; was allocated at [(10)](sarif:/runs/0/results/85/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def561]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(10)](sarif:/runs/0/results/86/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def562]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(10)](sarif:/runs/0/results/80/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def563]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(10)](sarif:/runs/0/results/82/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def564]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(10)](sarif:/runs/0/results/81/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def565]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(10)](sarif:/runs/0/results/91/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def566]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(10)](sarif:/runs/0/results/90/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def567]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:547:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:22: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:693:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:694:25: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(10)](sarif:/runs/0/results/84/codeFlows/0/threadFlows/0/locations/9)
#  692|   		/* If any of the preceding strdup calls failed, complain now. */
#  693|   		if (!struct_lconv_is_valid(&worklconv))
#  694|-> 			ereport(ERROR,
#  695|   					(errcode(ERRCODE_OUT_OF_MEMORY),
#  696|   					 errmsg("out of memory")));

Error: CPPCHECK_WARNING (CWE-457): [#def568]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:1381: error[legacyUninitvar]: Uninitialized variable: localeptr
# 1379|   				 default_locale.provider);
# 1380|   
# 1381|-> 		if (strcmp(localeptr, "C") == 0)
# 1382|   			result = true;
# 1383|   		else if (strcmp(localeptr, "POSIX") == 0)

Error: CPPCHECK_WARNING (CWE-457): [#def569]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:1447: error[legacyUninitvar]: Uninitialized variable: localeptr
# 1445|   				 default_locale.provider);
# 1446|   
# 1447|-> 		if (strcmp(localeptr, "C") == 0)
# 1448|   			result = true;
# 1449|   		else if (strcmp(localeptr, "POSIX") == 0)

Error: CPPCHECK_WARNING (CWE-457): [#def570]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:2135: error[legacyUninitvar]: Uninitialized variable: result
# 2133|   		PGLOCALE_SUPPORT_ERROR(locale->provider);
# 2134|   
# 2135|-> 	return result;
# 2136|   }
# 2137|   

Error: CPPCHECK_WARNING (CWE-457): [#def571]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/pg_locale.c:2171: error[legacyUninitvar]: Uninitialized variable: result
# 2169|   		PGLOCALE_SUPPORT_ERROR(locale->provider);
# 2170|   
# 2171|-> 	return result;
# 2172|   }
# 2173|   

Error: CPPCHECK_WARNING (CWE-768): [#def572]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/rangetypes.c:2883: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lowerExpr)},(union ListCell){.ptr_value=(upperExpr)}' depends on order of evaluation of side effects
# 2881|   
# 2882|   		if (lowerExpr != NULL && upperExpr != NULL)
# 2883|-> 			return (Node *) make_andclause(list_make2(lowerExpr, upperExpr));
# 2884|   		else if (lowerExpr != NULL)
# 2885|   			return (Node *) lowerExpr;

Error: CPPCHECK_WARNING (CWE-768): [#def573]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/regproc.c:418: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(get_namespace_name_or_temp(procform->pronamespace))},(union ListCell){.ptr_value=(pstrdup((procform->proname).data))}' depends on order of evaluation of side effects
#  416|   	nargs = procform->pronargs;
#  417|   
#  418|-> 	*objnames = list_make2(get_namespace_name_or_temp(procform->pronamespace),
#  419|   						   pstrdup(NameStr(procform->proname)));
#  420|   	*objargs = NIL;

Error: CPPCHECK_WARNING (CWE-768): [#def574]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/regproc.c:822: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(get_namespace_name_or_temp(oprForm->oprnamespace))},(union ListCell){.ptr_value=(pstrdup((oprForm->oprname).data))}' depends on order of evaluation of side effects
#  820|   
#  821|   	oprForm = (Form_pg_operator) GETSTRUCT(opertup);
#  822|-> 	*objnames = list_make2(get_namespace_name_or_temp(oprForm->oprnamespace),
#  823|   						   pstrdup(NameStr(oprForm->oprname)));
#  824|   	*objargs = NIL;

Error: CPPCHECK_WARNING (CWE-768): [#def575]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/ruleutils.c:1080: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(oldrte)},(union ListCell){.ptr_value=(newrte)}' depends on order of evaluation of side effects
# 1078|   		/* Build two-element rtable */
# 1079|   		memset(&dpns, 0, sizeof(dpns));
# 1080|-> 		dpns.rtable = list_make2(oldrte, newrte);
# 1081|   		dpns.subplans = NIL;
# 1082|   		dpns.ctes = NIL;

Error: CPPCHECK_WARNING (CWE-768): [#def576]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/selfuncs.c:1965: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},((union ListCell){.ptr_value=(makeConst(nominal_element_type,-1,nominal_element_collation,elmlen,elem_values[i],elem_nulls[i],elmbyval))})' depends on order of evaluation of side effects
# 1963|   			Selectivity s2;
# 1964|   
# 1965|-> 			args = list_make2(leftop,
# 1966|   							  makeConst(nominal_element_type,
# 1967|   										-1,

Error: CPPCHECK_WARNING (CWE-768): [#def577]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/selfuncs.c:2039: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},(union ListCell){.ptr_value=(elem)}' depends on order of evaluation of side effects
# 2037|   			 * estimation function would really care ...
# 2038|   			 */
# 2039|-> 			args = list_make2(leftop, elem);
# 2040|   			if (is_join_clause)
# 2041|   				s2 = DatumGetFloat8(FunctionCall5Coll(&oprselproc,

Error: CPPCHECK_WARNING (CWE-768): [#def578]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/selfuncs.c:2091: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},(union ListCell){.ptr_value=(dummyexpr)}' depends on order of evaluation of side effects
# 2089|   		dummyexpr->typeMod = -1;
# 2090|   		dummyexpr->collation = clause->inputcollid;
# 2091|-> 		args = list_make2(leftop, dummyexpr);
# 2092|   		if (is_join_clause)
# 2093|   			s2 = DatumGetFloat8(FunctionCall5Coll(&oprselproc,

Error: CPPCHECK_WARNING (CWE-768): [#def579]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/selfuncs.c:2216: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=((list_nth_cell(clause->largs,0)->ptr_value))}),((union ListCell){.ptr_value=((list_nth_cell(clause->rargs,0)->ptr_value))})' depends on order of evaluation of side effects
# 2214|   
# 2215|   	/* Build equivalent arg list for single operator */
# 2216|-> 	opargs = list_make2(linitial(clause->largs), linitial(clause->rargs));
# 2217|   
# 2218|   	/*

Error: CPPCHECK_WARNING (CWE-457): [#def580]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/timestamp.c:3162: error[legacyUninitvar]: Uninitialized variable: result
# 3160|   	}
# 3161|   
# 3162|-> 	PG_RETURN_TIMESTAMP(result);
# 3163|   }
# 3164|   

Error: CPPCHECK_WARNING (CWE-457): [#def581]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/timestamp.c:3317: error[legacyUninitvar]: Uninitialized variable: result
# 3315|   	}
# 3316|   
# 3317|-> 	return result;
# 3318|   }
# 3319|   

Error: CPPCHECK_WARNING (CWE-190): [#def582]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/tsgistidx.c:197: error[integerOverflow]: Signed integer underflow for expression '*(int32*)&c'.
#  195|   			FIN_LEGACY_CRC32(c);
#  196|   
#  197|-> 			*arr = *(int32 *) &c;
#  198|   			arr++;
#  199|   			ptr++;

Error: CPPCHECK_WARNING (CWE-476): [#def583]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/varlena.c:463: warning[nullPointer]: Possible null pointer dereference: rp
#  461|   		rp = result = NULL;		/* keep compiler quiet */
#  462|   	}
#  463|-> 	*rp = '\0';
#  464|   	PG_RETURN_CSTRING(result);
#  465|   }

Error: COMPILER_WARNING (CWE-704): [#def584]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/xid8funcs.c: scope_hint: In function ‘is_visible_fxid’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/xid8funcs.c:235:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  235 |                 res = bsearch(&value, snap->xip, snap->nxip, sizeof(FullTransactionId),
#      |                     ^
#  233|   		void	   *res;
#  234|   
#  235|-> 		res = bsearch(&value, snap->xip, snap->nxip, sizeof(FullTransactionId),
#  236|   					  cmp_fxid);
#  237|   		/* if found, transaction is still in progress */

Error: COMPILER_WARNING (CWE-704): [#def585]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/xid8funcs.c:235:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  233|   		void	   *res;
#  234|   
#  235|-> 		res = bsearch(&value, snap->xip, snap->nxip, sizeof(FullTransactionId),
#  236|   					  cmp_fxid);
#  237|   		/* if found, transaction is still in progress */

Error: CPPCHECK_WARNING (CWE-768): [#def586]
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/xml.c:631: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(DatumGetXmlP(fcinfo->args[0].value))},(union ListCell){.ptr_value=(DatumGetXmlP(fcinfo->args[1].value))}' depends on order of evaluation of side effects
#  629|   		PG_RETURN_XML_P(PG_GETARG_XML_P(0));
#  630|   	else
#  631|-> 		PG_RETURN_XML_P(xmlconcat(list_make2(PG_GETARG_XML_P(0),
#  632|   											 PG_GETARG_XML_P(1))));
#  633|   }

Error: CPPCHECK_WARNING (CWE-476): [#def587]
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/catcache.c:2232: warning[nullPointer]: Possible null pointer dereference: srckeys
# 2230|   		int			attnum = attnos[i];
# 2231|   		Form_pg_attribute att = TupleDescAttr(tupdesc, attnum - 1);
# 2232|-> 		Datum		src = srckeys[i];
# 2233|   		NameData	srcname;
# 2234|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def588]
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:503:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mapdicts’
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:424:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:427:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:432:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:435:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:487:80: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:497:36: branch_false: following ‘false’ branch (when ‘ndicts <= 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:507:47: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:487:80: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:503:41: danger: use of uninitialized value ‘&mapdicts’ here
#  501|   						MemoryContextAlloc(CacheMemoryContext,
#  502|   										   sizeof(Oid) * ndicts);
#  503|-> 					memcpy(maplists[maxtokentype].dictIds, mapdicts,
#  504|   						   sizeof(Oid) * ndicts);
#  505|   				}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def589]
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:530:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mapdicts’
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:424:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:427:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:432:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:435:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:487:80: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:497:36: branch_false: following ‘false’ branch (when ‘ndicts <= 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:507:47: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:523:20: branch_true: following ‘true’ branch (when ‘ndicts > 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:526:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/ts_cache.c:530:25: danger: use of uninitialized value ‘&mapdicts’ here
#  528|   				MemoryContextAlloc(CacheMemoryContext,
#  529|   								   sizeof(Oid) * ndicts);
#  530|-> 			memcpy(maplists[maxtokentype].dictIds, mapdicts,
#  531|   				   sizeof(Oid) * ndicts);
#  532|   			/* and save the overall map */

Error: CPPCHECK_WARNING (CWE-457): [#def590]
postgresql-18beta1/postgresql-17.2/src/backend/utils/cache/typcache.c:2714: warning[uninitvar]: Uninitialized variable: &srch.sort_order
# 2712|   
# 2713|   	srch.enum_oid = arg;
# 2714|-> 	return bsearch(&srch, enumdata->enum_values, enumdata->num_values,
# 2715|   				   sizeof(EnumItem), enum_oid_cmp);
# 2716|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def591]
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:1167:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:755:1: enter_function: entry to ‘get_error_stack_entry’
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:765:17: call_function: inlined call to ‘errstart_cold’ from ‘get_error_stack_entry’
# 1165|   
# 1166|   	edata->message_id = fmt;
# 1167|-> 	EVALUATE_MESSAGE(edata->domain, message, false, false);
# 1168|   
# 1169|   	MemoryContextSwitchTo(oldcontext);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def592]
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:1676:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:2232:1: enter_function: entry to ‘check_log_destination’
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:2244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:2247:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:2247:17: call_function: calling ‘format_elog_string’ from ‘check_log_destination’
# 1674|   
# 1675|   	return edata->message;
# 1676|-> }
# 1677|   
# 1678|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def593]
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:3751:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:3748:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:3751:9: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/elog.c:3751:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 3749|   #ifndef WIN32
# 3750|   	/* On Unix, we just fprintf to stderr */
# 3751|-> 	vfprintf(stderr, fmt, ap);
# 3752|   	fflush(stderr);
# 3753|   #else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def594]
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/jsonlog.c:88:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/jsonlog.c:87:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/jsonlog.c:88:26: throw: if ‘pvsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/error/jsonlog.c:88:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   86|   		errno = save_errno;
#   87|   		va_start(args, fmt);
#   88|-> 		newlen = pvsnprintf(value, len, fmt, args);
#   89|   		va_end(args);
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def595]
postgresql-18beta1/postgresql-17.2/src/backend/utils/init/postinit.c:1329:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/utils/init/postinit.c:1278:1: enter_function: entry to ‘process_startup_options’
postgresql-18beta1/postgresql-17.2/src/backend/utils/init/postinit.c:1320:19: call_function: inlined call to ‘list_head’ from ‘process_startup_options’
postgresql-18beta1/postgresql-17.2/src/backend/utils/init/postinit.c:1321:16: branch_true: following ‘true’ branch (when ‘gucopts’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/init/postinit.c:1326:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/init/postinit.c:1329:17: danger: dereference of NULL ‘<unknown>’
# 1327|   		gucopts = lnext(port->guc_options, gucopts);
# 1328|   
# 1329|-> 		value = lfirst(gucopts);
# 1330|   		gucopts = lnext(port->guc_options, gucopts);
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def596]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.c:1629:54: warning[-Wanalyzer-malloc-leak]: leak of ‘GUC_yy_create_buffer(fp, 16384)’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:573:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:586:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:586:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:593:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:595:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:595:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 1627|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1628|   	 * we need to put in 2 end-of-buffer characters.
# 1629|-> 	 */
# 1630|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1631|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.c:1629:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:573:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:586:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:586:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:593:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:595:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:595:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 1627|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1628|   	 * we need to put in 2 end-of-buffer characters.
# 1629|-> 	 */
# 1630|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1631|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def598]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.c:1670: warning[nullPointer]: Possible null pointer dereference: b
# 1668|       
# 1669|   	yy_flush_buffer( b );
# 1670|-> 
# 1671|   	b->yy_input_file = file;
# 1672|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def599]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.c:1671: warning[nullPointer]: Possible null pointer dereference: b
# 1669|   	yy_flush_buffer( b );
# 1670|   
# 1671|-> 	b->yy_input_file = file;
# 1672|   	b->yy_fill_buffer = 1;
# 1673|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def600]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:384:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:573:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:586:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:586:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:593:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:595:47: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc-file.l:595:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
#  382|   	errorcount = 0;
#  383|   
#  384|-> 	lex_buffer = yy_create_buffer(fp, YY_BUF_SIZE);
#  385|   	yy_switch_to_buffer(lex_buffer);
#  386|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def601]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:5991:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:5987:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:5990:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:5990:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:5991:13: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:5991:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 5989|   
# 5990|   	va_start(vargs, fmt);
# 5991|-> 	n = vsnprintf(*destptr, *maxbytes, fmt, vargs);
# 5992|   	va_end(vargs);
# 5993|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def602]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6674:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘eqsgn’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6646:12: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6650:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6650:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6654:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6656:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6663:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/guc.c:6674:17: danger: dereference of NULL ‘eqsgn’
# 6672|   
# 6673|   		eqsgn = strchr(val, '=');
# 6674|-> 		*eqsgn = '\0';
# 6675|   
# 6676|   		/* skip if we have permission to delete it */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def603]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:136:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:138:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:138:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:139:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:142:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:142:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:191:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:191:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:196:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:198:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:198:42: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:199:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:196:49: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:196:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:198:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:199:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  199|   			if (!new_environ[i])
#  200|   			{
#  201|-> 				write_stderr("out of memory\n");
#  202|   				exit(1);
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def604]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_environ’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:136:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:138:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:138:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:139:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:142:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:142:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:190:41: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:191:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:191:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:196:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:198:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:199:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:201:33: danger: ‘new_environ’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  199|   			if (!new_environ[i])
#  200|   			{
#  201|-> 				write_stderr("out of memory\n");
#  202|   				exit(1);
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def605]
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:236:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_argv’
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:136:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:138:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:138:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:139:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:142:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:142:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:191:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:191:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:196:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:205:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:225:38: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:226:20: branch_false: following ‘false’ branch (when ‘new_argv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:226:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:231:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:233:50: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:234:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:236:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:236:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/misc/ps_status.c:236:33: danger: ‘new_argv’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  234|   			if (!new_argv[i])
#  235|   			{
#  236|-> 				write_stderr("out of memory\n");
#  237|   				exit(1);
#  238|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:513:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:444:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:445:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:462:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:513:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:513:9: danger: ‘set’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  511|   
#  512|   	/* Finally, do the type-independent part of context creation */
#  513|-> 	MemoryContextCreate((MemoryContext) set,
#  514|   						T_AllocSetContext,
#  515|   						MCTX_ASET_ID,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def607]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: danger: ‘block’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  917|   		if (blksize < required_size)
#  918|   			break;
#  919|-> 		block = (AllocBlock) malloc(blksize);
#  920|   	}
#  921|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def608]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:923:24: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:919:38: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:922:12: branch_true: following ‘true’ branch (when ‘block’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:923:24: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:923:24: throw: if ‘MemoryContextAllocationFailure’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/aset.c:923:24: danger: ‘block’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  921|   
#  922|   	if (block == NULL)
#  923|-> 		return MemoryContextAllocationFailure(context, size, flags);
#  924|   
#  925|   	context->mem_allocated += blksize;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def609]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:227:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:131:1: enter_function: entry to ‘BumpContextCreate’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:177:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:178:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:192:9: call_function: inlined call to ‘dlist_init’ from ‘BumpContextCreate’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:222:16: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:227:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:227:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/bump.c:227:9: danger: ‘set’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  225|   
#  226|   	/* Finally, do the type-independent part of context creation */
#  227|-> 	MemoryContextCreate((MemoryContext) set, T_BumpContext, MCTX_BUMP_ID,
#  228|   						parent, name);
#  229|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def610]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1441:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘result.index’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1476:1: enter_function: entry to ‘FreePageManagerPutInternal’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1489:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1491:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1491:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1499:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1499:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1509:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1509:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1525:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1527:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1527:33: branch_false: following ‘false’ branch (when ‘soft == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1529:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1529:34: call_function: calling ‘FreePageManagerGetInternal’ from ‘FreePageManagerPutInternal’
# 1439|   		Assert(result.found);
# 1440|   		if (victim->npages == npages)
# 1441|-> 			FreePageBtreeRemove(fpm, result.page, result.index);
# 1442|   		else
# 1443|   		{

Error: CPPCHECK_WARNING (CWE-457): [#def611]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/freepage.c:1538: error[legacyUninitvar]: Uninitialized variable: root
# 1536|   
# 1537|   			/* Create the btree and move the preexisting range into it. */
# 1538|-> 			root->hdr.magic = FREE_PAGE_LEAF_MAGIC;
# 1539|   			root->hdr.nused = 1;
# 1540|   			relptr_store(base, root->hdr.parent, (FreePageBtree *) NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def612]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:262:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:160:1: enter_function: entry to ‘GenerationContextCreate’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:209:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:210:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:224:9: call_function: inlined call to ‘dlist_init’ from ‘GenerationContextCreate’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:257:16: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:262:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:262:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/generation.c:262:9: danger: ‘set’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  260|   
#  261|   	/* Finally, do the type-independent part of context creation */
#  262|-> 	MemoryContextCreate((MemoryContext) set,
#  263|   						T_GenerationContext,
#  264|   						MCTX_GENERATION_ID,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def613]
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘slab’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:322:1: enter_function: entry to ‘SlabContextCreate’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:358:12: branch_false: following ‘false’ branch (when ‘chunksPerBlock != 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:364:32: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:364:32: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:365:12: branch_false: following ‘false’ branch (when ‘slab’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:381:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:405:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:406:17: call_function: inlined call to ‘dlist_init’ from ‘SlabContextCreate’
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:414:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/backend/utils/mmgr/slab.c:414:9: danger: ‘slab’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  412|   
#  413|   	/* Finally, do the type-independent part of context creation */
#  414|-> 	MemoryContextCreate((MemoryContext) slab,
#  415|   						T_SlabContext,
#  416|   						MCTX_SLAB_ID,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def614]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: danger: ‘fopen(path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  682|   		pg_fatal("could not open file \"%s\" for reading: %m", path);
#  683|   
#  684|-> 	initStringInfo(&line);
#  685|   
#  686|   	maxlines = 1024;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def615]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  682|   		pg_fatal("could not open file \"%s\" for reading: %m", path);
#  683|   
#  684|-> 	initStringInfo(&line);
#  685|   
#  686|   	maxlines = 1024;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def616]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:687:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:687:28: throw: if ‘pg_malloc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:687:28: danger: ‘fopen(path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  685|   
#  686|   	maxlines = 1024;
#  687|-> 	result = (char **) pg_malloc(maxlines * sizeof(char *));
#  688|   
#  689|   	n = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def617]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:687:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:687:28: throw: if ‘pg_malloc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:687:28: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  685|   
#  686|   	maxlines = 1024;
#  687|-> 	result = (char **) pg_malloc(maxlines * sizeof(char *));
#  688|   
#  689|   	n = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def618]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:690:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:690:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:690:16: danger: ‘fopen(path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  688|   
#  689|   	n = 0;
#  690|-> 	while (pg_get_line_buf(infile, &line))
#  691|   	{
#  692|   		/* make sure there will be room for a trailing NULL pointer */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def619]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:690:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:681:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:684:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:690:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:690:16: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  688|   
#  689|   	n = 0;
#  690|-> 	while (pg_get_line_buf(infile, &line))
#  691|   	{
#  692|   		/* make sure there will be room for a trailing NULL pointer */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def620]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:727:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:725:25: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:725:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:725:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:727:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:729:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:727:28: danger: ‘fopen(path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  725|   	if ((out_file = fopen(path, "w")) == NULL)
#  726|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
#  727|-> 	for (line = lines; *line != NULL; line++)
#  728|   	{
#  729|   		if (fputs(*line, out_file) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def621]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:727:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:725:25: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:725:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:725:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:727:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:729:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:727:28: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  725|   	if ((out_file = fopen(path, "w")) == NULL)
#  726|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
#  727|-> 	for (line = lines; *line != NULL; line++)
#  728|   	{
#  729|   		if (fputs(*line, out_file) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def622]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1029:29: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1029:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: danger: ‘fopen(path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1029|   	if ((version_file = fopen(path, PG_BINARY_W)) == NULL)
# 1030|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
# 1031|-> 	if (fprintf(version_file, "%s\n", PG_MAJORVERSION) < 0 ||
# 1032|   		fclose(version_file))
# 1033|   		pg_fatal("could not write file \"%s\": %m", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def623]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1029:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1029:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1031:13: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1029|   	if ((version_file = fopen(path, PG_BINARY_W)) == NULL)
# 1030|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
# 1031|-> 	if (fprintf(version_file, "%s\n", PG_MAJORVERSION) < 0 ||
# 1032|   		fclose(version_file))
# 1033|   		pg_fatal("could not write file \"%s\": %m", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def624]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(pwfilename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1643:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1671:35: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1671:35: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1673:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: danger: ‘fopen(pwfilename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1674|   			pg_fatal("could not open file \"%s\" for reading: %m",
# 1675|   					 pwfilename);
# 1676|-> 		pwd1 = pg_get_line(pwf, NULL);
# 1677|   		if (!pwd1)
# 1678|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def625]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(pwfilename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1643:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1671:35: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1671:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1673:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/initdb/initdb.c:1676:24: danger: ‘fopen(pwfilename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 1674|   			pg_fatal("could not open file \"%s\" for reading: %m",
# 1675|   					 pwfilename);
# 1676|-> 		pwd1 = pg_get_line(pwf, NULL);
# 1677|   		if (!pwd1)
# 1678|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def626]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:233:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  231|   		++name;
#  232|   
#  233|-> 	fid = pg_open_tzfile(name, canonname);
#  234|   	if (fid < 0)
#  235|   		return ENOENT;			/* pg_open_tzfile may not set errno */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def627]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  240|   		int			err = nread < 0 ? errno : EINVAL;
#  241|   
#  242|-> 		close(fid);
#  243|   		return err;
#  244|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def628]
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:245:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/postgresql-17.2/src/bin/initdb/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  243|   		return err;
#  244|   	}
#  245|-> 	if (close(fid) < 0)
#  246|   		return errno;
#  247|   	for (stored = 4; stored <= 8; stored *= 2)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def629]
postgresql-18beta1/postgresql-17.2/src/bin/pg_archivecleanup/pg_archivecleanup.c:103:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(archiveLocation)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_archivecleanup/pg_archivecleanup.c:98:17: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_archivecleanup/pg_archivecleanup.c:99:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_archivecleanup/pg_archivecleanup.c:99:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_archivecleanup/pg_archivecleanup.c:103:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_archivecleanup/pg_archivecleanup.c:103:35: danger: ‘opendir(archiveLocation)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  101|   				 archiveLocation);
#  102|   
#  103|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  104|   	{
#  105|   		char		WALFilePath[MAXPGPATH * 2]; /* the file path including

Error: GCC_ANALYZER_WARNING (CWE-775): [#def630]
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:364:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:359:16: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:360:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:364:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:364:12: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  362|   
#  363|   #ifndef WIN32
#  364|-> 	if (chmod(filename, mode))
#  365|   		pg_fatal("could not set permissions on file \"%s\": %m",
#  366|   				 filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def631]
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:364:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:359:16: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:360:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:364:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_file.c:364:12: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  362|   
#  363|   #ifndef WIN32
#  364|-> 	if (chmod(filename, mode))
#  365|   		pg_fatal("could not set permissions on file \"%s\": %m",
#  366|   				 filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def632]
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:91:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:100:46: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:100:46: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:102:20: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: throw: if ‘gzdopen’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  103|   			pg_fatal("could not duplicate stdout: %m");
#  104|   
#  105|-> 		streamer->gzfile = gzdopen(fd, "wb");
#  106|   		if (streamer->gzfile == NULL)
#  107|   			pg_fatal("could not open output file: %m");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def633]
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1020:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘state.file’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1698:1: enter_function: entry to ‘ReceiveBackupManifest’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1704:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1705:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1708:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1708:9: call_function: calling ‘ReceiveCopyData’ from ‘ReceiveBackupManifest’
# 1018|   
# 1019|   	/* Get the COPY data stream. */
# 1020|-> 	res = PQgetResult(conn);
# 1021|   	if (PQresultStatus(res) != PGRES_COPY_OUT)
# 1022|   		pg_fatal("could not get COPY data stream: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def634]
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1020:15: warning[-Wanalyzer-malloc-leak]: leak of ‘state.file’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1698:1: enter_function: entry to ‘ReceiveBackupManifest’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1704:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1705:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1708:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_basebackup.c:1708:9: call_function: calling ‘ReceiveCopyData’ from ‘ReceiveBackupManifest’
# 1018|   
# 1019|   	/* Get the COPY data stream. */
# 1020|-> 	res = PQgetResult(conn);
# 1021|   	if (PQresultStatus(res) != PGRES_COPY_OUT)
# 1022|   		pg_fatal("could not get COPY data stream: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def635]
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_receivewal.c:278:37: warning[-Wanalyzer-malloc-leak]: leak of ‘get_destination_dir(basedir)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_receivewal.c:268:1: enter_function: entry to ‘FindStreamingStart’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_receivewal.c:276:15: call_function: calling ‘get_destination_dir’ from ‘FindStreamingStart’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_receivewal.c:276:15: return_function: returning to ‘FindStreamingStart’ from ‘get_destination_dir’
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_receivewal.c:278:37: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_basebackup/pg_receivewal.c:278:37: danger: ‘get_destination_dir(basedir)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  276|   	dir = get_destination_dir(basedir);
#  277|   
#  278|-> 	while (errno = 0, (dirent = readdir(dir)) != NULL)
#  279|   	{
#  280|   		uint32		tli;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def636]
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:119:17: warning[-Wanalyzer-jump-through-null]: jump through null pointer
 branch_false: following ‘false’ branch (when ‘copy_method > 2’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:98:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:98:12: branch_false: following ‘false’ branch (when ‘dry_run == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:109:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:109:20: branch_false: following ‘false’ branch (when ‘strategy_name’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:112:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/copy_file.c:119:17: danger: jump through null pointer here
#  117|   						 src, dst, pg_checksum_type_name(checksum_ctx->type));
#  118|   
#  119|-> 		strategy_implementation(src, dst, checksum_ctx);
#  120|   	}
#  121|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def637]
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:934:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&ifulldir)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:932:20: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:932:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:932:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:934:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:934:33: danger: ‘opendir(&ifulldir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  932|   	if ((dir = opendir(ifulldir)) == NULL)
#  933|   		pg_fatal("could not open directory \"%s\": %m", ifulldir);
#  934|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
#  935|   	{
#  936|   		PGFileType	type;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def638]
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:1258:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pg_tblspc)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:1255:20: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:1255:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:1255:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:1258:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_combinebackup/pg_combinebackup.c:1258:33: danger: ‘opendir(&pg_tblspc)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1256|   		pg_fatal("could not open directory \"%s\": %m", pg_tblspc);
# 1257|   
# 1258|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
# 1259|   	{
# 1260|   		Oid			oid;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def639]
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:208:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:1953:1: enter_function: entry to ‘do_advice’
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:1955:9: call_function: calling ‘write_stderr’ from ‘do_advice’
#  206|   #ifndef WIN32
#  207|   	/* On Unix, we just fprintf to stderr */
#  208|-> 	vfprintf(stderr, fmt, ap);
#  209|   #else
#  210|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def640]
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2121:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2125:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2126:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2128:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2132:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2141:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2153:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:13: danger: ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 2152|   
# 2153|   	fd = popen(cmd, "r");
# 2154|-> 	if (fd == NULL || fgets(filename, sizeof(filename), fd) == NULL || pclose(fd) != 0)
# 2155|   	{
# 2156|   		write_stderr(_("%s: could not determine the data directory using command \"%s\"\n"), progname, cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def641]
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:76: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2121:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2125:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2126:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2128:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2132:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2141:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2153:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_ctl/pg_ctl.c:2154:76: danger: ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 2152|   
# 2153|   	fd = popen(cmd, "r");
# 2154|-> 	if (fd == NULL || fgets(filename, sizeof(filename), fd) == NULL || pclose(fd) != 0)
# 2155|   	{
# 2156|   		write_stderr(_("%s: could not determine the data directory using command \"%s\"\n"), progname, cmd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def642]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_gzip.c:361:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(fd)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_gzip.c:360:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_gzip.c:361:24: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_gzip.c:361:24: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_gzip.c:361:24: danger: ‘dup(fd)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  359|   
#  360|   	if (fd >= 0)
#  361|-> 		gzfp = gzdopen(dup(fd), mode_compression);
#  362|   	else
#  363|   		gzfp = gzopen(path, mode_compression);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def643]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:730:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:717:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:718:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:718:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:721:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:727:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:730:1: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  728|   
#  729|   	return true;
#  730|-> }
#  731|   
#  732|   static bool

Error: GCC_ANALYZER_WARNING (CWE-775): [#def644]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  479|   		return false;
#  480|   
#  481|-> 	zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
#  482|   	CFH->private_data = zstdcs;
#  483|   	zstdcs->fp = fp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def645]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:474:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:474:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  479|   		return false;
#  480|   
#  481|-> 	zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
#  482|   	CFH->private_data = zstdcs;
#  483|   	zstdcs->fp = fp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def646]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  485|   	if (mode[0] == 'r')
#  486|   	{
#  487|-> 		zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
#  488|   		zstdcs->dstream = ZSTD_createDStream();
#  489|   		if (zstdcs->dstream == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def647]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  485|   	if (mode[0] == 'r')
#  486|   	{
#  487|-> 		zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
#  488|   		zstdcs->dstream = ZSTD_createDStream();
#  489|   		if (zstdcs->dstream == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def648]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  492|   	else if (mode[0] == 'w' || mode[0] == 'a')
#  493|   	{
#  494|-> 		zstdcs->output.size = ZSTD_CStreamOutSize();
#  495|   		zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
#  496|   		zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def649]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  492|   	else if (mode[0] == 'w' || mode[0] == 'a')
#  493|   	{
#  494|-> 		zstdcs->output.size = ZSTD_CStreamOutSize();
#  495|   		zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
#  496|   		zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def650]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  499|   	}
#  500|   	else
#  501|-> 		pg_fatal("unhandled mode \"%s\"", mode);
#  502|   
#  503|   	return true;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def651]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  499|   	}
#  500|   	else
#  501|-> 		pg_fatal("unhandled mode \"%s\"", mode);
#  502|   
#  503|   	return true;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def652]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/filter.c:161:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/filter.c:160:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/filter.c:161:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/filter.c:161:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  159|   
#  160|   	va_start(argp, fmt);
#  161|-> 	vsnprintf(buf, sizeof(buf), fmt, argp);
#  162|   	va_end(argp);
#  163|   

Error: CPPCHECK_WARNING (CWE-476): [#def653]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:504: warning[nullPointer]: Possible null pointer dereference: slot
#  502|   		/* On all platforms, update workerStatus and te[] as well */
#  503|   		Assert(j < pstate->numWorkers);
#  504|-> 		slot->workerStatus = WRKR_TERMINATED;
#  505|   		pstate->te[j] = NULL;
#  506|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def654]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:504:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘slot’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1059:1: enter_function: entry to ‘ParallelBackupEnd’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1064:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1064:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1071:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1073:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1071:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1078:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:1078:9: call_function: calling ‘WaitForTerminatingWorkers’ from ‘ParallelBackupEnd’
#  502|   		/* On all platforms, update workerStatus and te[] as well */
#  503|   		Assert(j < pstate->numWorkers);
#  504|-> 		slot->workerStatus = WRKR_TERMINATED;
#  505|   		pstate->te[j] = NULL;
#  506|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def655]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipeMW[0]’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:897:1: enter_function: entry to ‘ParallelBackupStart’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:910:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:915:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:939:9: call_function: calling ‘set_archive_cancel_info’ from ‘ParallelBackupStart’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:939:9: return_function: returning to ‘ParallelBackupStart’ from ‘set_archive_cancel_info’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:945:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:953:40: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:958:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:958:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:958:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: danger: ‘pipeMW[0]’ leaks here
#  957|   		/* Create communication pipes for this worker */
#  958|   		if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0)
#  959|-> 			pg_fatal("could not create communication channels: %m");
#  960|   
#  961|   		/* leader's ends of the pipes */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def656]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipeMW[1]’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:897:1: enter_function: entry to ‘ParallelBackupStart’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:910:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:915:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:939:9: call_function: calling ‘set_archive_cancel_info’ from ‘ParallelBackupStart’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:939:9: return_function: returning to ‘ParallelBackupStart’ from ‘set_archive_cancel_info’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:945:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:953:40: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:958:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:958:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:958:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/parallel.c:959:25: danger: ‘pipeMW[1]’ leaks here
#  957|   		/* Create communication pipes for this worker */
#  958|   		if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0)
#  959|-> 			pg_fatal("could not create communication channels: %m");
#  960|   
#  961|   		/* leader's ends of the pipes */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def657]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:1734:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:4142:1: enter_function: entry to ‘dumpTimestamp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:4146:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:4147:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:4147:17: call_function: calling ‘ahprintf’ from ‘dumpTimestamp’
# 1732|   		errno = save_errno;
# 1733|   		va_start(args, fmt);
# 1734|-> 		cnt = pvsnprintf(p, len, fmt, args);
# 1735|   		va_end(args);
# 1736|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def658]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:1895:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:3425:1: enter_function: entry to ‘_selectOutputSchema’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:3456:25: call_function: calling ‘warn_or_exit_horribly’ from ‘_selectOutputSchema’
# 1893|   
# 1894|   	va_start(ap, fmt);
# 1895|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, fmt, ap);
# 1896|   	va_end(ap);
# 1897|   

Error: CPPCHECK_WARNING (CWE-476): [#def659]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_archiver.c:2264: warning[nullPointer]: Possible null pointer dereference: fh
# 2262|   	}
# 2263|   
# 2264|-> 	if ((cnt = fread(sig, 1, 5, fh)) != 5)
# 2265|   	{
# 2266|   		if (ferror(fh))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def660]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:172:56: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(*<unknown>.directory)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:152:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:157:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:163:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:163:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:165:51: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:167:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:167:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:172:56: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_directory.c:172:56: danger: ‘opendir(*<unknown>.directory)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  170|   
#  171|   				is_empty = true;
#  172|-> 				while (errno = 0, (d = readdir(dir)))
#  173|   				{
#  174|   					if (strcmp(d->d_name, ".") != 0 && strcmp(d->d_name, "..") != 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def661]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_tar.c:971:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_tar.c:970:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_tar.c:971:23: throw: if ‘pvsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_backup_tar.c:971:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  969|   		errno = save_errno;
#  970|   		va_start(args, fmt);
#  971|-> 		cnt = pvsnprintf(p, len, fmt, args);
#  972|   		va_end(args);
#  973|   

Error: CPPCHECK_WARNING (CWE-457): [#def662]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:1418: error[legacyUninitvar]: Uninitialized variable: archiveFormat
# 1416|   	else
# 1417|   		pg_fatal("invalid output format \"%s\" specified", format);
# 1418|-> 	return archiveFormat;
# 1419|   }
# 1420|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def663]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12330:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘probin’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12214:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12219:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12289:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12294:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12304:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12326:12: branch_false: following ‘false’ branch (when ‘prosqlbody’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12330:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:12330:18: danger: dereference of NULL ‘probin’
#12328|   		appendPQExpBufferStr(asPart, prosqlbody);
#12329|   	}
#12330|-> 	else if (probin[0] != '\0')
#12331|   	{
#12332|   		appendPQExpBufferStr(asPart, "AS ");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def664]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13805:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘collcollate’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13726:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13729:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13789:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13794:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13794:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13803:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13803:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13805:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13805:21: danger: dereference of NULL ‘collcollate’
#13803|   	if (fout->remoteVersion < 150000)
#13804|   	{
#13805|-> 		if (collcollate[0] == '\0')
#13806|   			collcollate = NULL;
#13807|   		if (collctype[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def665]
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13807:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘collctype’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13726:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13729:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13789:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13790:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13794:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13803:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13803:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13805:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13805:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13805:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/pg_dump.c:13807:21: danger: dereference of NULL ‘collctype’
#13805|   		if (collcollate[0] == '\0')
#13806|   			collcollate = NULL;
#13807|-> 		if (collctype[0] == '\0')
#13808|   			collctype = NULL;
#13809|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def666]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:531:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:531:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:531:22: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  529|   	if (!fgets(rawline, sizeof(rawline), ver_fd))
#  530|   	{
#  531|-> 		if (!ferror(ver_fd))
#  532|   			pg_fatal("unexpected empty file \"%s\"", ver_file);
#  533|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def667]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:531:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:531:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:531:22: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  529|   	if (!fgets(rawline, sizeof(rawline), ver_fd))
#  530|   	{
#  531|-> 		if (!ferror(ver_fd))
#  532|   			pg_fatal("unexpected empty file \"%s\"", ver_file);
#  533|   		else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def668]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  536|   
#  537|   	/* strip trailing newline and carriage return */
#  538|-> 	(void) pg_strip_crlf(rawline);
#  539|   
#  540|   	if (strcmp(rawline, PG_MAJORVERSION) != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def669]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  536|   
#  537|   	/* strip trailing newline and carriage return */
#  538|-> 	(void) pg_strip_crlf(rawline);
#  539|   
#  540|   	if (strcmp(rawline, PG_MAJORVERSION) != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def670]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:540:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:540:12: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  538|   	(void) pg_strip_crlf(rawline);
#  539|   
#  540|-> 	if (strcmp(rawline, PG_MAJORVERSION) != 0)
#  541|   	{
#  542|   		pg_log_error("data directory is of wrong version");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def671]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:540:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:524:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:529:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:538:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:540:12: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  538|   	(void) pg_strip_crlf(rawline);
#  539|   
#  540|-> 	if (strcmp(rawline, PG_MAJORVERSION) != 0)
#  541|   	{
#  542|   		pg_log_error("data directory is of wrong version");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def672]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:930:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:926:17: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:927:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:927:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:930:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:930:35: danger: ‘opendir("pg_wal")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  928|   		pg_fatal("could not open directory \"%s\": %m", XLOGDIR);
#  929|   
#  930|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  931|   	{
#  932|   		if (IsXLogFileName(xlde->d_name) ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def673]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:983:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:979:17: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:980:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:980:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:983:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:983:35: danger: ‘opendir("pg_wal")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  981|   		pg_fatal("could not open directory \"%s\": %m", XLOGDIR);
#  982|   
#  983|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  984|   	{
#  985|   		if (IsXLogFileName(xlde->d_name) ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def674]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1018:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal/archive_status")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1014:17: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1015:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1015:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1018:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1018:35: danger: ‘opendir("pg_wal/archive_status")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1016|   		pg_fatal("could not open directory \"%s\": %m", ARCHSTATDIR);
# 1017|   
# 1018|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
# 1019|   	{
# 1020|   		if (strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_FNAME_LEN &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def675]
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1056:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal/summaries")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1052:17: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1053:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1053:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1056:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_resetwal/pg_resetwal.c:1056:35: danger: ‘opendir("pg_wal/summaries")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1054|   		pg_fatal("could not open directory \"%s\": %m", WALSUMMARYDIR);
# 1055|   
# 1056|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
# 1057|   	{
# 1058|   		if (strspn(xlde->d_name, "0123456789ABCDEF") == WALSUMMARY_NHEXCHARS &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def676]
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/file_ops.c:391:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&fullparentpath)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/file_ops.c:386:17: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/file_ops.c:387:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/file_ops.c:387:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/file_ops.c:391:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/file_ops.c:391:35: danger: ‘opendir(&fullparentpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  389|   				 fullparentpath);
#  390|   
#  391|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  392|   	{
#  393|   		struct stat fst;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def677]
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/xlogreader.c:78:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/xlogreader.c:77:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/xlogreader.c:78:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_rewind/xlogreader.c:78:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   76|   
#   77|   	va_start(args, fmt);
#   78|-> 	vsnprintf(state->errormsg_buf, MAX_ERRORMSG_LEN, fmt, args);
#   79|   	va_end(args);
#   80|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def678]
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:318:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:318:31: danger: infinite loop here
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:318:31: branch_true: if it ever follows ‘true’ branch, it will always do so...
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:318:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:320:42: branch_false: when ‘writes >= writes_per_op’: always following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:318:57: branch_false: ...to here
#  316|   	{
#  317|   		START_TIMER;
#  318|-> 		for (ops = 0; alarm_triggered == false; ops++)
#  319|   		{
#  320|   			for (writes = 0; writes < writes_per_op; writes++)

Error: GCC_ANALYZER_WARNING (CWE-835): [#def679]
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:421:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:421:31: danger: infinite loop here
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:421:31: branch_true: if it ever follows ‘true’ branch, it will always do so...
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:421:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:423:42: branch_false: when ‘writes >= writes_per_op’: always following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:421:57: branch_false: ...to here
#  419|   	{
#  420|   		START_TIMER;
#  421|-> 		for (ops = 0; alarm_triggered == false; ops++)
#  422|   		{
#  423|   			for (writes = 0; writes < writes_per_op; writes++)

Error: GCC_ANALYZER_WARNING (CWE-835): [#def680]
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:486:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:486:31: danger: infinite loop here
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:486:31: branch_true: if it ever follows ‘true’ branch, it will always do so...
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:486:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:488:42: branch_false: if it ever follows ‘false’ branch, it will always do so...
postgresql-18beta1/postgresql-17.2/src/bin/pg_test_fsync/pg_test_fsync.c:486:57: branch_false: ...to here
#  484|   	{
#  485|   		START_TIMER;
#  486|-> 		for (ops = 0; alarm_triggered == false; ops++)
#  487|   		{
#  488|   			for (writes = 0; writes < 16 / writes_size; writes++)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def681]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:361:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:363:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:366:40: branch_true: following ‘true’ branch (when ‘n_data_types_usage_checks > checknum’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:376:66: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:470:36: branch_false: following ‘false’ branch (when ‘found == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:471:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:44: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:73: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:73: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:45: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:497:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:497:44: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  497|   					if (!db_used)
#  498|   					{
#  499|-> 						fprintf(script, "In database: %s\n", active_db->db_name);
#  500|   						db_used = true;
#  501|   					}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def682]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:361:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:363:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:366:40: branch_true: following ‘true’ branch (when ‘n_data_types_usage_checks > checknum’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:376:66: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:470:36: branch_false: following ‘false’ branch (when ‘found == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:471:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:44: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:73: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:73: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:494:45: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:497:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:497:44: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:499:49: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  497|   					if (!db_used)
#  498|   					{
#  499|-> 						fprintf(script, "In database: %s\n", active_db->db_name);
#  500|   						db_used = true;
#  501|   					}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def683]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*deletion_script_file_name, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:923:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:923:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:962:23: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:962:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: danger: ‘fopen(*deletion_script_file_name, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  966|   #ifndef WIN32
#  967|   	/* add shebang header */
#  968|-> 	fprintf(script, "#!/bin/sh\n\n");
#  969|   #endif
#  970|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def684]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*deletion_script_file_name, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:923:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:923:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:962:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:962:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:968:9: danger: ‘fopen(*deletion_script_file_name, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  966|   #ifndef WIN32
#  967|   	/* add shebang header */
#  968|-> 	fprintf(script, "#!/bin/sh\n\n");
#  969|   #endif
#  970|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def685]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1115:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1117:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 1136|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1137|   
# 1138|-> 				fprintf(script, "%s\n", datname);
# 1139|   			}
# 1140|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def686]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1115:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1117:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1135:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1138:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 1136|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1137|   
# 1138|-> 				fprintf(script, "%s\n", datname);
# 1139|   			}
# 1140|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def687]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1214:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1222:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1226:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1234:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1252:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1252:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: danger: ‘script’ leaks here; was opened at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1252|   			if (!db_used)
# 1253|   			{
# 1254|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1255|   				db_used = true;
# 1256|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def688]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1214:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1222:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1226:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1234:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1250:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1252:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1252:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1254:33: danger: ‘script’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 1252|   			if (!db_used)
# 1253|   			{
# 1254|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1255|   				db_used = true;
# 1256|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def689]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1300:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1311:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1343:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1344:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1344:43: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1343:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1346:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1346:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 1346|   			if (!db_used)
# 1347|   			{
# 1348|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1349|   				db_used = true;
# 1350|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def690]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1300:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1311:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1343:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1344:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1344:43: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1343:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1346:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1346:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1348:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 1346|   			if (!db_used)
# 1347|   			{
# 1348|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1349|   				db_used = true;
# 1350|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def691]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1418:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1421:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1471:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1472:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1472:43: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1471:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1474:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1474:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 1474|   			if (!db_used)
# 1475|   			{
# 1476|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1477|   				db_used = true;
# 1478|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def692]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1418:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1421:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1471:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1472:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1472:43: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1471:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1474:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1474:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1476:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1474|   			if (!db_used)
# 1475|   			{
# 1476|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1477|   				db_used = true;
# 1478|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def693]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1524:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1532:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1550:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1550:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 1550|   			if (!db_used)
# 1551|   			{
# 1552|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1553|   				db_used = true;
# 1554|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def694]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1524:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1532:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1548:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1550:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1550:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1552:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 1550|   			if (!db_used)
# 1551|   			{
# 1552|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1553|   				db_used = true;
# 1554|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def695]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1610:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:20: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:49: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 1612|   		if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1613|   			pg_fatal("could not open file \"%s\": %m", output_path);
# 1614|-> 		fprintf(script, "%s (oid=%s)\n",
# 1615|   				PQgetvalue(res, rowno, i_rolname),
# 1616|   				PQgetvalue(res, rowno, i_roloid));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def696]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1610:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:20: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1612:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1614:17: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 1612|   		if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1613|   			pg_fatal("could not open file \"%s\": %m", output_path);
# 1614|-> 		fprintf(script, "%s (oid=%s)\n",
# 1615|   				PQgetvalue(res, rowno, i_rolname),
# 1616|   				PQgetvalue(res, rowno, i_roloid));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def697]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1654:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1663:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1684:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1685:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1685:43: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1684:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1687:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1687:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
# 1687|   			if (!db_used)
# 1688|   			{
# 1689|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1690|   				db_used = true;
# 1691|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def698]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1654:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1663:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1684:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1685:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1685:43: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1684:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1687:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1687:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1689:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
# 1687|   			if (!db_used)
# 1688|   			{
# 1689|-> 				fprintf(script, "In database: %s\n", active_db->db_name);
# 1690|   				db_used = true;
# 1691|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def699]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1852:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1854:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1861:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1863:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1863:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1864:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1864:51: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1863:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: danger: ‘script’ leaks here; was opened at [(7)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/6)
# 1865|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1866|   
# 1867|-> 				fprintf(script, "The slot \"%s\" is invalid\n",
# 1868|   						slot->slotname);
# 1869|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def700]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1852:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1854:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1861:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1863:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1863:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1864:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1864:51: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1863:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1867:33: danger: ‘script’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6)
# 1865|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1866|   
# 1867|-> 				fprintf(script, "The slot \"%s\" is invalid\n",
# 1868|   						slot->slotname);
# 1869|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def701]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1852:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1854:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1861:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1880:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1880:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1882:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1883:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1883:51: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1882:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/8)
# 1884|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1885|   
# 1886|-> 				fprintf(script,
# 1887|   						"The slot \"%s\" has not consumed the WAL yet\n",
# 1888|   						slot->slotname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def702]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1852:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1854:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1861:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1880:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1880:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1882:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1883:51: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1883:51: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1882:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1886:33: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/8)
# 1884|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1885|   
# 1886|-> 				fprintf(script,
# 1887|   						"The slot \"%s\" has not consumed the WAL yet\n",
# 1888|   						slot->slotname);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def703]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1927:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1930:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1934:20: branch_true: following ‘true’ branch (when ‘dbnum == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1940:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: danger: ‘script’ leaks here; was opened at [(7)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/6)
# 1952|   				if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1953|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1954|-> 				fprintf(script, "The replication origin is missing for database:\"%s\" subscription:\"%s\"\n",
# 1955|   						PQgetvalue(res, i, 0),
# 1956|   						PQgetvalue(res, i, 1));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def704]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1927:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1930:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1934:20: branch_true: following ‘true’ branch (when ‘dbnum == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1940:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1952:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1954:33: danger: ‘script’ leaks here; was allocated at [(7)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/6)
# 1952|   				if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1953|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1954|-> 				fprintf(script, "The replication origin is missing for database:\"%s\" subscription:\"%s\"\n",
# 1955|   						PQgetvalue(res, i, 0),
# 1956|   						PQgetvalue(res, i, 1));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def705]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1927:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1930:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1934:20: branch_true: following ‘true’ branch (when ‘dbnum == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1940:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1950:41: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1958:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/8)
# 2005|   				pg_fatal("could not open file \"%s\": %m", output_path);
# 2006|   
# 2007|-> 			fprintf(script, "The table sync state \"%s\" is not allowed for database:\"%s\" subscription:\"%s\" schema:\"%s\" relation:\"%s\"\n",
# 2008|   					PQgetvalue(res, i, 0),
# 2009|   					active_db->db_name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def706]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1927:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1930:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1934:20: branch_true: following ‘true’ branch (when ‘dbnum == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1940:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1950:41: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:1958:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2004:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/check.c:2007:25: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/8)
# 2005|   				pg_fatal("could not open file \"%s\": %m", output_path);
# 2006|   
# 2007|-> 			fprintf(script, "The table sync state \"%s\" is not allowed for database:\"%s\" subscription:\"%s\" schema:\"%s\" relation:\"%s\"\n",
# 2008|   					PQgetvalue(res, i, 0),
# 2009|   					active_db->db_name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def707]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:36: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:84:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:132:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:136:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:36: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  136|   				p = strchr(p, ':');
#  137|   
#  138|-> 				if (p == NULL || strlen(p) <= 1)
#  139|   					pg_fatal("%d: database cluster state problem", __LINE__);
#  140|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def708]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:37: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:84:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:132:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:136:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:36: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:50: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:37: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
#  136|   				p = strchr(p, ':');
#  137|   
#  138|-> 				if (p == NULL || strlen(p) <= 1)
#  139|   					pg_fatal("%d: database cluster state problem", __LINE__);
#  140|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def709]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:152:40: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:84:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:132:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:136:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:152:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:152:40: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/18)
#  150|   				 */
#  151|   				/* Remove trailing newline and leading spaces */
#  152|-> 				(void) pg_strip_crlf(p);
#  153|   				while (*p == ' ')
#  154|   					p++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def710]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:153:40: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:84:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:132:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:134:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:136:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:138:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:153:40: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:155:37: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:153:40: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/18)
#  151|   				/* Remove trailing newline and leading spaces */
#  152|   				(void) pg_strip_crlf(p);
#  153|-> 				while (*p == ' ')
#  154|   					p++;
#  155|   				if (strcmp(p, "shut down in recovery") == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def711]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:173:22: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:84:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:128:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:132:24: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:173:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:173:22: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/18)
#  171|   		}
#  172|   
#  173|-> 		rc = pclose(output);
#  174|   		if (rc != 0)
#  175|   			pg_fatal("could not get control data using %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def712]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:202:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:84:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:86:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:103:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:121:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:121:13: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:121:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:188:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:192:9: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:192:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:198:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:198:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:202:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:202:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:202:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:209:16: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:505:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/controldata.c:202:13: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(25)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/24)
#  200|   
#  201|   	/* Only in <= 9.2 */
#  202|-> 	if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
#  203|   	{
#  204|   		cluster->controldata.data_checksum_version = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def713]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:46:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:13: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   43|   	fflush(NULL);
#   44|   
#   45|-> 	if ((output = popen(cmd, "r")) == NULL ||
#   46|   		fgets(cmd_output, sizeof(cmd_output), output) == NULL)
#   47|   		pg_fatal("could not get pg_ctl version data using %s: %m", cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def714]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:49:14: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:46:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:45:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:49:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:49:14: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   47|   		pg_fatal("could not get pg_ctl version data using %s: %m", cmd);
#   48|   
#   49|-> 	rc = pclose(output);
#   50|   	if (rc != 0)
#   51|   		pg_fatal("could not get pg_ctl version data using %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-404): [#def715]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:109:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:108:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:109:20: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:109:20: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  107|   	written = 0;
#  108|   	va_start(ap, fmt);
#  109|-> 	written += vsnprintf(cmd + written, MAXCMDLEN - written, fmt, ap);
#  110|   	va_end(ap);
#  111|   	if (written >= MAXCMDLEN)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def716]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&log_file, "a")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:138:15: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: danger: ‘fopen(&log_file, "a")’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  165|   		fprintf(log, "\n\n");
#  166|   #endif
#  167|-> 	fprintf(log, "command: %s\n", cmd);
#  168|   #ifdef WIN32
#  169|   	/* Are we printing "command:" after its output? */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def717]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&log_file, "a")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:138:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: danger: ‘fopen(&log_file, "a")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  165|   		fprintf(log, "\n\n");
#  166|   #endif
#  167|-> 	fprintf(log, "command: %s\n", cmd);
#  168|   #ifdef WIN32
#  169|   	/* Are we printing "command:" after its output? */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def718]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&log_file, "a")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:189:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:217:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:217:20: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:217:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: danger: ‘fopen(&log_file, "a")’ leaks here; was opened at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  217|   	if ((log = fopen(log_file, "a")) == NULL)
#  218|   		pg_fatal("could not write to log file \"%s\": %m", log_file);
#  219|-> 	fprintf(log, "\n\n");
#  220|   	fclose(log);
#  221|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def719]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&log_file, "a")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:189:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:217:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:217:20: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:217:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/exec.c:219:9: danger: ‘fopen(&log_file, "a")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  217|   	if ((log = fopen(log_file, "a")) == NULL)
#  218|   		pg_fatal("could not write to log file \"%s\": %m", log_file);
#  219|-> 	fprintf(log, "\n\n");
#  220|   	fclose(log);
#  221|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def720]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:168:26: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:176:20: branch_true: following ‘true’ branch (when ‘libnum == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:178:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:184:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: throw: if ‘PQerrorMessage’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  188|   				if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
#  189|   					pg_fatal("could not open file \"%s\": %m", output_path);
#  190|-> 				fprintf(script, _("could not load library \"%s\": %s"),
#  191|   						lib,
#  192|   						PQerrorMessage(conn));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def721]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:168:26: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:176:20: branch_true: following ‘true’ branch (when ‘libnum == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:178:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:184:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:36: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:188:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: throw: if ‘PQerrorMessage’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/function.c:190:33: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  188|   				if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
#  189|   					pg_fatal("could not open file \"%s\": %m", output_path);
#  190|-> 				fprintf(script, _("could not load library \"%s\": %s"),
#  191|   						lib,
#  192|   						PQerrorMessage(conn));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def722]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:213:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:42:1: enter_function: entry to ‘gen_db_file_maps’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:62:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:65:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:65:39: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:67:53: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:71:20: branch_true: following ‘true’ branch (when ‘new_rel’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:77:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/info.c:77:25: call_function: calling ‘report_unmatched_relation’ from ‘gen_db_file_maps’
#  211|   report_unmatched_relation(const RelInfo *rel, const DbInfo *db, bool is_new_db)
#  212|   {
#  213|-> 	Oid			reloid = rel->reloid;	/* we might change rel below */
#  214|   	char		reldesc[1000];
#  215|   	int			i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def723]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:418:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:420:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:424:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:432:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:447:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:13: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  444|   	fflush(NULL);
#  445|   
#  446|-> 	if ((output = popen(cmd, "r")) == NULL ||
#  447|   		fgets(cmd_output, sizeof(cmd_output), output) == NULL)
#  448|   		pg_fatal("could not get data directory using %s: %m", cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def724]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:450:14: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:418:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:420:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:424:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:432:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:447:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:446:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:450:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:450:14: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  448|   		pg_fatal("could not get data directory using %s: %m", cmd);
#  449|   
#  450|-> 	rc = pclose(output);
#  451|   	if (rc != 0)
#  452|   		pg_fatal("could not get data directory using %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def725]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:476:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:484:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:27: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: danger: ‘fopen(&filename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  497|   			 lineno++)
#  498|   		{
#  499|-> 			if (fgets(line, sizeof(line), fp) == NULL)
#  500|   				pg_fatal("could not read line %d from file \"%s\": %m",
#  501|   						 lineno, filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def726]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:476:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:484:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:27: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: danger: ‘fopen(&filename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  497|   			 lineno++)
#  498|   		{
#  499|-> 			if (fgets(line, sizeof(line), fp) == NULL)
#  500|   				pg_fatal("could not read line %d from file \"%s\": %m",
#  501|   						 lineno, filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def727]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:509:52: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:476:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:484:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:27: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:497:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:509:52: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:509:52: danger: ‘fopen(&filename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  507|   			{
#  508|   				/* strip trailing newline and carriage return */
#  509|-> 				cluster->sockdir = pg_strdup(line);
#  510|   				(void) pg_strip_crlf(cluster->sockdir);
#  511|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def728]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:509:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:476:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:484:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:27: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:497:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:509:52: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:509:52: danger: ‘fopen(&filename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  507|   			{
#  508|   				/* strip trailing newline and carriage return */
#  509|-> 				cluster->sockdir = pg_strdup(line);
#  510|   				(void) pg_strip_crlf(cluster->sockdir);
#  511|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def729]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:510:40: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:476:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:484:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:27: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:497:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:510:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:510:40: danger: ‘fopen(&filename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  508|   				/* strip trailing newline and carriage return */
#  509|   				cluster->sockdir = pg_strdup(line);
#  510|-> 				(void) pg_strip_crlf(cluster->sockdir);
#  511|   			}
#  512|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def730]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:510:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:476:12: branch_true: following ‘true’ branch (when ‘live_check != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:484:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:27: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:492:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:506:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:497:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:496:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:499:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:504:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:510:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/option.c:510:40: danger: ‘fopen(&filename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  508|   				/* strip trailing newline and carriage return */
#  509|   				cluster->sockdir = pg_strdup(line);
#  510|-> 				(void) pg_strip_crlf(cluster->sockdir);
#  511|   			}
#  512|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def731]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/parallel.c:76:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/parallel.c:75:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/parallel.c:76:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/parallel.c:76:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   74|   
#   75|   	va_start(args, fmt);
#   76|-> 	vsnprintf(cmd, sizeof(cmd), fmt, args);
#   77|   	va_end(args);
#   78|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def732]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename_path, "a")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:266:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:275:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:279:37: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:282:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:286:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:289:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:296:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:298:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:300:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:300:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:302:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:305:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:307:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:310:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:310:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:310:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:314:39: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:316:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:318:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:320:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:320:27: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:320:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: danger: ‘fopen(&filename_path, "a")’ leaks here; was opened at [(23)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/22)
#  321|   			pg_fatal("could not write to log file \"%s\": %m", filename_path);
#  322|   
#  323|-> 		fprintf(fp,
#  324|   				"-----------------------------------------------------------------\n"
#  325|   				"  pg_upgrade run on %s"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def733]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename_path, "a")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:266:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:275:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:279:37: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:282:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:286:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:289:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:296:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:298:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:300:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:300:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:302:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:305:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:307:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:310:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:310:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:310:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:314:39: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:316:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:318:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:320:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:320:27: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:320:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/pg_upgrade.c:323:17: danger: ‘fopen(&filename_path, "a")’ leaks here; was allocated at [(23)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/22)
#  321|   			pg_fatal("could not write to log file \"%s\": %m", filename_path);
#  322|   
#  323|-> 		fprintf(fp,
#  324|   				"-----------------------------------------------------------------\n"
#  325|   				"  pg_upgrade run on %s"

Error: GCC_ANALYZER_WARNING (CWE-404): [#def734]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/server.c:130:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/server.c:129:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/server.c:130:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/server.c:130:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  128|   
#  129|   	va_start(args, fmt);
#  130|-> 	vsnprintf(query, sizeof(query), fmt, args);
#  131|   	va_end(args);
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def735]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:135:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:134:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:135:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:135:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  133|   
#  134|   	va_start(args, fmt);
#  135|-> 	vsnprintf(message, sizeof(message), fmt, args);
#  136|   	va_end(args);
#  137|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def736]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:162:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:161:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:162:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:162:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  160|   
#  161|   	va_start(args, fmt);
#  162|-> 	vsnprintf(message, sizeof(message), fmt, args);
#  163|   	va_end(args);
#  164|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def737]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:184:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:270:1: enter_function: entry to ‘pg_fatal’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:274:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/util.c:275:9: call_function: calling ‘pg_log_v’ from ‘pg_fatal’
#  182|   	Assert(fmt[0] == '\0' || fmt[strlen(fmt) - 1] != '\n');
#  183|   
#  184|-> 	vsnprintf(message, sizeof(message), _(fmt), ap);
#  185|   
#  186|   	/* PG_VERBOSE and PG_STATUS are only output in verbose mode */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def738]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   82|   					PQExpBufferData connectbuf;
#   83|   
#   84|-> 					initPQExpBuffer(&connectbuf);
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def739]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#   82|   					PQExpBufferData connectbuf;
#   83|   
#   84|-> 					initPQExpBuffer(&connectbuf);
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def740]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:85:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:85:41: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:85:41: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#   83|   
#   84|   					initPQExpBuffer(&connectbuf);
#   85|-> 					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|   					termPQExpBuffer(&connectbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def741]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:85:41: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:85:41: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:85:41: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#   83|   
#   84|   					initPQExpBuffer(&connectbuf);
#   85|-> 					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|   					termPQExpBuffer(&connectbuf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def742]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:87:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:87:41: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:87:41: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|-> 					termPQExpBuffer(&connectbuf);
#   88|   					db_used = true;
#   89|   				}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def743]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:87:41: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:87:41: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:87:41: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|-> 					termPQExpBuffer(&connectbuf);
#   88|   					db_used = true;
#   89|   				}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def744]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:90:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:90:33: throw: if ‘quote_identifier’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:90:33: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#   88|   					db_used = true;
#   89|   				}
#   90|-> 				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def745]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:90:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:90:33: throw: if ‘quote_identifier’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:90:33: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#   88|   					db_used = true;
#   89|   				}
#   90|-> 				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def746]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:91:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:91:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:91:66: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
#   89|   				}
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|-> 						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def747]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:91:66: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:91:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:91:66: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#   89|   				}
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|-> 						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def748]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:92:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:92:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:92:66: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|-> 						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}
#   94|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def749]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:92:66: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:92:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:92:66: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|-> 						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}
#   94|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def750]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
#  180|   				PQExpBufferData connectbuf;
#  181|   
#  182|-> 				initPQExpBuffer(&connectbuf);
#  183|   				appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#  184|   				fputs(connectbuf.data, script);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def751]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
#  180|   				PQExpBufferData connectbuf;
#  181|   
#  182|-> 				initPQExpBuffer(&connectbuf);
#  183|   				appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#  184|   				fputs(connectbuf.data, script);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def752]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:183:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:183:33: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:183:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  181|   
#  182|   				initPQExpBuffer(&connectbuf);
#  183|-> 				appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#  184|   				fputs(connectbuf.data, script);
#  185|   				termPQExpBuffer(&connectbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def753]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:183:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:183:33: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:183:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
#  181|   
#  182|   				initPQExpBuffer(&connectbuf);
#  183|-> 				appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#  184|   				fputs(connectbuf.data, script);
#  185|   				termPQExpBuffer(&connectbuf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def754]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:185:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:185:33: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:185:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
#  183|   				appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#  184|   				fputs(connectbuf.data, script);
#  185|-> 				termPQExpBuffer(&connectbuf);
#  186|   				db_used = true;
#  187|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def755]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:185:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:185:33: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:185:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
#  183|   				appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#  184|   				fputs(connectbuf.data, script);
#  185|-> 				termPQExpBuffer(&connectbuf);
#  186|   				db_used = true;
#  187|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def756]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:188:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:188:25: throw: if ‘quote_identifier’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:188:25: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/4)
#  186|   				db_used = true;
#  187|   			}
#  188|-> 			fprintf(script, "ALTER EXTENSION %s UPDATE;\n",
#  189|   					quote_identifier(PQgetvalue(res, rowno, i_name)));
#  190|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def757]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:188:25: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:188:25: throw: if ‘quote_identifier’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:188:25: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
#  186|   				db_used = true;
#  187|   			}
#  188|-> 			fprintf(script, "ALTER EXTENSION %s UPDATE;\n",
#  189|   					quote_identifier(PQgetvalue(res, rowno, i_name)));
#  190|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def758]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:189:58: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:189:58: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:189:58: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/4)
#  187|   			}
#  188|   			fprintf(script, "ALTER EXTENSION %s UPDATE;\n",
#  189|-> 					quote_identifier(PQgetvalue(res, rowno, i_name)));
#  190|   		}
#  191|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def759]
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:189:58: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:57: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:189:58: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_upgrade/version.c:189:58: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/4)
#  187|   			}
#  188|   			fprintf(script, "ALTER EXTENSION %s UPDATE;\n",
#  189|-> 					quote_identifier(PQgetvalue(res, rowno, i_name)));
#  190|   		}
#  191|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def760]
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:637:37: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(fullpath)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:616:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:617:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:617:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:637:37: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:637:37: danger: ‘opendir(fullpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  635|   	}
#  636|   
#  637|-> 	while (errno = 0, (dirent = readdir(dir)) != NULL)
#  638|   	{
#  639|   		char	   *filename = dirent->d_name;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def761]
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:988:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:987:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:988:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:988:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  986|   
#  987|   	va_start(ap, fmt);
#  988|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, gettext(fmt), ap);
#  989|   	va_end(ap);
#  990|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def762]
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:1005:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:1004:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:1005:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_verifybackup/pg_verifybackup.c:1005:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1003|   
# 1004|   	va_start(ap, fmt);
# 1005|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, gettext(fmt), ap);
# 1006|   	va_end(ap);
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def763]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:119:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(directory)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:115:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:117:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:119:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:119:9: danger: ‘opendir(directory)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  117|   	if (dir == NULL)
#  118|   		return false;
#  119|-> 	closedir(dir);
#  120|   	return true;
#  121|   }

Error: COMPILER_WARNING (CWE-704): [#def764]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c: scope_hint: In function ‘split_path’
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:166:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  166 |         sep = strrchr(path, '/');
#      |             ^
#  164|   
#  165|   	/* split filepath into directory & filename */
#  166|-> 	sep = strrchr(path, '/');
#  167|   
#  168|   	/* directory path */

Error: COMPILER_WARNING (CWE-704): [#def765]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:166:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  164|   
#  165|   	/* split filepath into directory & filename */
#  166|-> 	sep = strrchr(path, '/');
#  167|   
#  168|   	/* directory path */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def766]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:228:32: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(directory)’
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:216:12: branch_false: following ‘false’ branch (when ‘fname’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:224:27: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:224:27: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:224:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:224:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:228:32: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:228:32: danger: ‘opendir(directory)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  226|   		struct dirent *xlde;
#  227|   
#  228|-> 		while ((xlde = readdir(xldir)) != NULL)
#  229|   		{
#  230|   			if (IsXLogFileName(xlde->d_name))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def767]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:534:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:494:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:505:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:508:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:514:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:514:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:517:24: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:520:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:521:50: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:530:24: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:531:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:534:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:534:20: danger: ‘fopen(&filename, "w")’ leaks here; was opened at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  532|   			pg_fatal("could not open file \"%s\": %m", filename);
#  533|   
#  534|-> 		if (fwrite(page, BLCKSZ, 1, file) != 1)
#  535|   			pg_fatal("could not write file \"%s\": %m", filename);
#  536|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def768]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:534:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "w")’
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:494:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:505:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:508:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:514:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:514:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:517:24: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:520:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:521:50: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:530:24: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:531:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:534:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/pg_waldump.c:534:20: danger: ‘fopen(&filename, "w")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  532|   			pg_fatal("could not open file \"%s\": %m", filename);
#  533|   
#  534|-> 		if (fwrite(page, BLCKSZ, 1, file) != 1)
#  535|   			pg_fatal("could not write file \"%s\": %m", filename);
#  536|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def769]
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/xlogreader.c:78:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/xlogreader.c:77:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/xlogreader.c:78:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_waldump/xlogreader.c:78:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   76|   
#   77|   	va_start(args, fmt);
#   78|-> 	vsnprintf(state->errormsg_buf, MAX_ERRORMSG_LEN, fmt, args);
#   79|   	va_end(args);
#   80|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def770]
postgresql-18beta1/postgresql-17.2/src/bin/pg_walsummary/pg_walsummary.c:236:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/pg_walsummary/pg_walsummary.c:235:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/pg_walsummary/pg_walsummary.c:236:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_walsummary/pg_walsummary.c:236:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  234|   
#  235|   	va_start(ap, fmt);
#  236|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, fmt, ap);
#  237|   	va_end(ap);
#  238|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def771]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1117:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1075:6: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1139:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1139:6: branch_false: following ‘false’ branch (when ‘yystate != 25’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1142:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1154:6: branch_false: following ‘false’ branch (when ‘yyn != -33’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1160:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1160:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1163:16: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1172:11: branch_false: following ‘false’ branch (when ‘yychar != 256’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1184:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1191:6: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1194:6: branch_false: following ‘false’ branch (when ‘yyn > 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1204:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1204:6: branch_false: following ‘false’ branch (when ‘yyerrstatus == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1211:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1075:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1081:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1104:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1106:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1113:11: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1115:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1117:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1120:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1120:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1133:10: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1139:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1139:6: branch_false: following ‘false’ branch (when ‘yystate != 25’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1142:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1154:6: branch_false: following ‘false’ branch (when ‘yyn != -33’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1160:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1160:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1163:16: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1163:16: throw: if ‘expr_yylex’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1117:9: danger: ‘yyptr’ leaks here; was allocated at [(21)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/20)
# 1115|           if (! yyptr)
# 1116|             YYNOMEM;
# 1117|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1118|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1119|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def772]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1117:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1075:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1081:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1104:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1106:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1115:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1117:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprparse.c:1117:9: danger: use of uninitialized value ‘yyss’ here
# 1115|           if (! yyptr)
# 1116|             YYNOMEM;
# 1117|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1118|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1119|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def773]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:1999:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:321:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:343:14: call_function: calling ‘expr_yylex’ from ‘expr_lex_one_word’
# 1997|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1998|   	 * we need to put in 2 end-of-buffer characters.
# 1999|-> 	 */
# 2000|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2001|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def774]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2042:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:321:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:343:14: call_function: calling ‘expr_yylex’ from ‘expr_lex_one_word’
# 2040|   
# 2041|   	yy_flush_buffer( b , yyscanner);
# 2042|-> 
# 2043|   	b->yy_input_file = file;
# 2044|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def775]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2162:3: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(8)’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:321:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:334:19: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:335:56: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:335:10: call_function: calling ‘expr_yy_switch_to_buffer’ from ‘expr_lex_one_word’
# 2160|   		if ( ! yyg->yy_buffer_stack )
# 2161|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2162|-> 
# 2163|   		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
# 2164|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def776]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2183:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:321:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:334:19: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:335:56: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:335:10: call_function: calling ‘expr_yy_switch_to_buffer’ from ‘expr_lex_one_word’
# 2181|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2182|   
# 2183|-> 		/* zero only the new slots.*/
# 2184|   		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
# 2185|   		yyg->yy_buffer_stack_max = num_to_alloc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def777]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2208:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2194:17: enter_function: entry to ‘expr_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2204:24: call_function: inlined call to ‘expr_yyalloc’ from ‘expr_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2205:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2208:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2218:2: call_function: calling ‘expr_yy_switch_to_buffer’ from ‘expr_yy_scan_buffer’
# 2206|   	if ( ! b )
# 2207|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 2208|-> 
# 2209|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 2210|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def778]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.c:2311:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(*(struct yyguts_t *)yyscanner.yytext_r)’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:321:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/exprscan.l:343:14: call_function: calling ‘expr_yylex’ from ‘expr_lex_one_word’
# 2309|   YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
# 2310|   {
# 2311|->     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
# 2312|       return yyextra;
# 2313|   }

Error: CPPCHECK_WARNING (CWE-457): [#def779]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/pgbench.c:1622: warning[uninitvar]: Uninitialized variables: &key.svalue, &key.value
# 1620|   	/* Now we can search */
# 1621|   	key.name = name;
# 1622|-> 	return (Variable *) bsearch(&key,
# 1623|   								variables->vars,
# 1624|   								variables->nvars,

Error: COMPILER_WARNING (CWE-704): [#def780]
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/pgbench.c: scope_hint: In function ‘parseScriptWeight’
postgresql-18beta1/postgresql-17.2/src/bin/pgbench/pgbench.c:6161:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 6161 |         if ((sep = strrchr(option, WSEP)))
#      |                  ^
# 6159|   	int			weight;
# 6160|   
# 6161|-> 	if ((sep = strrchr(option, WSEP)))
# 6162|   	{
# 6163|   		int			namelen = sep - option;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def781]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2666:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2668:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2673:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2687:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2688:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2697:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2698:46: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2700:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 2717|   			 */
# 2718|   			if (query_buf && query_buf->len > 0)
# 2719|-> 				fprintf(fd, "%s\n", query_buf->data);
# 2720|   			else if (previous_buf && previous_buf->len > 0)
# 2721|   				fprintf(fd, "%s\n", previous_buf->data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def782]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2666:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2668:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2673:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2687:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2688:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2697:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2698:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2700:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2719:33: danger: ‘fd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
# 2717|   			 */
# 2718|   			if (query_buf && query_buf->len > 0)
# 2719|-> 				fprintf(fd, "%s\n", query_buf->data);
# 2720|   			else if (previous_buf && previous_buf->len > 0)
# 2721|   				fprintf(fd, "%s\n", previous_buf->data);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def783]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2721:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2666:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2668:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2673:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2687:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2688:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2697:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2698:46: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2700:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2720:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2720:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2721:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2721:33: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 2719|   				fprintf(fd, "%s\n", query_buf->data);
# 2720|   			else if (previous_buf && previous_buf->len > 0)
# 2721|-> 				fprintf(fd, "%s\n", previous_buf->data);
# 2722|   
# 2723|   			if (is_pipe)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def784]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2721:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2666:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2668:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2673:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2687:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2688:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2697:41: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2698:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2700:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2720:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2720:33: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2721:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2721:33: danger: ‘fd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 2719|   				fprintf(fd, "%s\n", query_buf->data);
# 2720|   			else if (previous_buf && previous_buf->len > 0)
# 2721|-> 				fprintf(fd, "%s\n", previous_buf->data);
# 2722|   
# 2723|   			if (is_pipe)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def785]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2725:42: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2666:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2668:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2673:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2680:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2687:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2688:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2691:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2693:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2700:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2718:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2720:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2723:28: branch_true: following ‘true’ branch (when ‘is_pipe != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2725:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2725:42: throw: if ‘pclose’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:2725:42: danger: ‘fd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 2723|   			if (is_pipe)
# 2724|   			{
# 2725|-> 				result = pclose(fd);
# 2726|   
# 2727|   				if (result != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def786]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4157:33: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4103:12: branch_false: following ‘false’ branch (when ‘filename_arg’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4109:38: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4142:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4143:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4143:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4145:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4152:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4155:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4157:33: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4157:33: danger: ‘stream’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 4155|   			if (ql > 0 && query_buf->data[ql - 1] != '\n')
# 4156|   			{
# 4157|-> 				appendPQExpBufferChar(query_buf, '\n');
# 4158|   				ql++;
# 4159|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def787]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4163:33: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4103:12: branch_false: following ‘false’ branch (when ‘filename_arg’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4109:38: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4142:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4143:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4143:34: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4145:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4152:43: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4161:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4163:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4163:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4163:33: danger: ‘stream’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 4161|   			if (fwrite(query_buf->data, 1, ql, stream) != ql)
# 4162|   			{
# 4163|-> 				pg_log_error("%s: %m", fname);
# 4164|   
# 4165|   				if (fclose(stream) != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def788]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 4231|   			char		line[1024];
# 4232|   
# 4233|-> 			resetPQExpBuffer(query_buf);
# 4234|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4235|   				appendPQExpBufferStr(query_buf, line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def789]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 4231|   			char		line[1024];
# 4232|   
# 4233|-> 			resetPQExpBuffer(query_buf);
# 4234|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4235|   				appendPQExpBufferStr(query_buf, line);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def790]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4234:32: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 4233|   			resetPQExpBuffer(query_buf);
# 4234|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4235|-> 				appendPQExpBufferStr(query_buf, line);
# 4236|   
# 4237|   			if (ferror(stream))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def791]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4234:32: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4235:33: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 4233|   			resetPQExpBuffer(query_buf);
# 4234|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4235|-> 				appendPQExpBufferStr(query_buf, line);
# 4236|   
# 4237|   			if (ferror(stream))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def792]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4237:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 4237|   			if (ferror(stream))
# 4238|   			{
# 4239|-> 				pg_log_error("%s: %m", fname);
# 4240|   				error = true;
# 4241|   				resetPQExpBuffer(query_buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def793]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4237:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 4237|   			if (ferror(stream))
# 4238|   			{
# 4239|-> 				pg_log_error("%s: %m", fname);
# 4240|   				error = true;
# 4241|   				resetPQExpBuffer(query_buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def794]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4241:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4237:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4241:33: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4241:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 4239|   				pg_log_error("%s: %m", fname);
# 4240|   				error = true;
# 4241|-> 				resetPQExpBuffer(query_buf);
# 4242|   			}
# 4243|   			else if (edited)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def795]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4241:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4201:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4209:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4211:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4222:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4223:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4233:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4237:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4239:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4241:33: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4241:33: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 4239|   				pg_log_error("%s: %m", fname);
# 4240|   				error = true;
# 4241|-> 				resetPQExpBuffer(query_buf);
# 4242|   			}
# 4243|   			else if (edited)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def796]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4337:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4294:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4301:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4320:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4322:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4334:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4337:9: throw: if ‘pg_logging_config’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4337:9: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 4335|   	pset.inputfile = filename;
# 4336|   
# 4337|-> 	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4338|   
# 4339|   	result = MainLoop(fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def797]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4337:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4294:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4301:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4320:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4322:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4334:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4337:9: throw: if ‘pg_logging_config’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4337:9: danger: ‘fd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
# 4335|   	pset.inputfile = filename;
# 4336|   
# 4337|-> 	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4338|   
# 4339|   	result = MainLoop(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def798]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4339:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4294:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4301:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4320:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4322:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4334:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4339:18: throw: if ‘MainLoop’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4339:18: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
# 4337|   	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4338|   
# 4339|-> 	result = MainLoop(fd);
# 4340|   
# 4341|   	if (fd != stdin)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def799]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4339:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4294:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4299:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4301:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4320:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4322:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4334:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4339:18: throw: if ‘MainLoop’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:4339:18: danger: ‘fd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
# 4337|   	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4338|   
# 4339|-> 	result = MainLoop(fd);
# 4340|   
# 4341|   	if (fd != stdin)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def800]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5345:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5259:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5315:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5317:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5319:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5343:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5345:17: throw: if ‘pg_malloc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5345:17: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/14)
# 5343|   	user_title = myopt.title;
# 5344|   	title_len = (user_title ? strlen(user_title) : 0) + 256;
# 5345|-> 	title = pg_malloc(title_len);
# 5346|   
# 5347|   	/* Loop to run query and then sleep awhile */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def801]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5362:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5259:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5315:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5317:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5319:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5343:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5348:16: branch_false: following ‘false’ branch (when ‘done == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5358:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5361:20: branch_true: following ‘true’ branch (when ‘user_title’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5362:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5362:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5362:25: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/14)
# 5360|   
# 5361|   		if (user_title)
# 5362|-> 			snprintf(title, title_len, _("%s\t%s (every %gs)\n"),
# 5363|   					 user_title, timebuf, sleep_ms / 1000.0);
# 5364|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def802]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5365:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5259:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5315:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5317:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5319:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5343:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5348:16: branch_false: following ‘false’ branch (when ‘done == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5358:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5361:20: branch_false: following ‘false’ branch (when ‘user_title’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5365:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5365:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5365:25: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/14)
# 5363|   					 user_title, timebuf, sleep_ms / 1000.0);
# 5364|   		else
# 5365|-> 			snprintf(title, title_len, _("%s (every %gs)\n"),
# 5366|   					 timebuf, sleep_ms / 1000.0);
# 5367|   		myopt.title = title;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def803]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5370:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5259:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5315:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5317:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5319:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5343:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5348:16: branch_false: following ‘false’ branch (when ‘done == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5358:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5361:20: branch_true: following ‘true’ branch (when ‘user_title’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5362:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5370:23: throw: if ‘PSQLexecWatch’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5370:23: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/14)
# 5368|   
# 5369|   		/* Run the query and print out the result */
# 5370|-> 		res = PSQLexecWatch(query_buf->data, &myopt, pagerpipe, min_rows);
# 5371|   
# 5372|   		/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def804]
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5448:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5259:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5309:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5313:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5312:13: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5315:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5317:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5319:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5343:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5348:16: branch_true: following ‘true’ branch (when ‘done != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5446:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5446:12: branch_true: following ‘true’ branch (when ‘pagerpipe’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5448:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5448:17: throw: if ‘pclose’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/command.c:5448:17: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/14)
# 5446|   	if (pagerpipe)
# 5447|   	{
# 5448|-> 		pclose(pagerpipe);
# 5449|   		restore_sigpipe_trap();
# 5450|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def805]
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:98:33: warning[-Wanalyzer-malloc-leak]: leak of ‘gfile_fout’
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1004:1: enter_function: entry to ‘PrintQueryResult’
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1017:28: branch_true: following ‘true’ branch (when ‘last != 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1017:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1017:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1019:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1019:34: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1020:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/common.c:1020:43: call_function: calling ‘ExecQueryTuples’ from ‘PrintQueryResult’
#   96|   		{
#   97|   			if (*is_pipe)
#   98|-> 				disable_sigpipe_trap();
#   99|   		}
#  100|   		else

Error: CPPCHECK_WARNING (CWE-457): [#def806]
postgresql-18beta1/postgresql-17.2/src/bin/psql/crosstabview.c:363: error[uninitvar]: Uninitialized variables: &elt.sort_value, &elt.rank
#  361|   		else
#  362|   			elt.name = NULL;
#  363|-> 		rp = (pivot_field *) bsearch(&elt,
#  364|   									 piv_rows,
#  365|   									 num_rows,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def807]
postgresql-18beta1/postgresql-17.2/src/bin/psql/crosstabview.c:369:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/bin/psql/crosstabview.c:350:22: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/crosstabview.c:359:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/crosstabview.c:369:17: danger: dereference of NULL ‘<unknown>’
#  367|   									 pivotFieldCompare);
#  368|   		Assert(rp != NULL);
#  369|-> 		row_number = rp->rank;
#  370|   
#  371|   		/* Find target column */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def808]
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘output’
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: throw: if ‘history_set_pos’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: danger: ‘output’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  518|   	}
#  519|   
#  520|-> 	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|   		fprintf(output, "%s\n", cur_hist->line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def809]
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: warning[-Wanalyzer-malloc-leak]: leak of ‘output’
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: throw: if ‘history_set_pos’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: danger: ‘output’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  518|   	}
#  519|   
#  520|-> 	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|   		fprintf(output, "%s\n", cur_hist->line);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def810]
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘output’
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: branch_true: following ‘true’ branch (when ‘cur_hist’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: danger: ‘output’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  520|   	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|-> 		fprintf(output, "%s\n", cur_hist->line);
#  523|   	}
#  524|   	END_ITERATE_HISTORY();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def811]
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: warning[-Wanalyzer-malloc-leak]: leak of ‘output’
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:511:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:520:9: branch_true: following ‘true’ branch (when ‘cur_hist’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/input.c:522:17: danger: ‘output’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  520|   	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|-> 		fprintf(output, "%s\n", cur_hist->line);
#  523|   	}
#  524|   	END_ITERATE_HISTORY();

Error: GCC_ANALYZER_WARNING (CWE-404): [#def812]
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:29:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:23:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:25:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:28:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:29:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:29:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   27|   
#   28|   		va_start(ap, fmt);
#   29|-> 		vfprintf(pset.queryFout, fmt, ap);
#   30|   		va_end(ap);
#   31|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def813]
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:41:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:38:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:40:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:40:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:41:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/large_obj.c:41:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   39|   	{
#   40|   		va_start(ap, fmt);
#   41|-> 		vfprintf(pset.logfile, fmt, ap);
#   42|   		va_end(ap);
#   43|   		fputs("\n", pset.logfile);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def814]
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:277:57: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(pnstrdup(p + 1, (long unsigned int)cmdend), "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:99:18: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:103:20: branch_false: following ‘false’ branch (when ‘esc == 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:324:26: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:99:18: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:272:54: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:273:52: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:275:61: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:275:60: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:277:57: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/prompt.c:277:57: danger: ‘popen(pnstrdup(p + 1, (long unsigned int)cmdend), "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  275|   							if (fgets(buf, sizeof(buf), fd) == NULL)
#  276|   								buf[0] = '\0';
#  277|-> 							pclose(fd);
#  278|   						}
#  279|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def815]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:1487:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:549:8: enter_function: entry to ‘psql_scan_slash_option’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:579:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_option’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:579:10: return_function: returning to ‘psql_scan_slash_option’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:590:14: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_option’
# 1485|   
# 1486|   		if ( ! YY_CURRENT_BUFFER ) {
# 1487|-> 			yyensure_buffer_stack (yyscanner);
# 1488|   			YY_CURRENT_BUFFER_LVALUE =
# 1489|   				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def816]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2486:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:687:1: enter_function: entry to ‘psql_scan_slash_command_end’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:697:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command_end’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:697:10: return_function: returning to ‘psql_scan_slash_command_end’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:705:2: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_command_end’
# 2484|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2485|   	 * we need to put in 2 end-of-buffer characters.
# 2486|-> 	 */
# 2487|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2488|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def817]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2486:54: warning[-Wanalyzer-malloc-leak]: leak of ‘slash_yy_create_buffer(*(struct yyguts_t *)yyscanner.yyin_r, 16384,  yyscanner)’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:549:8: enter_function: entry to ‘psql_scan_slash_option’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:579:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_option’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:579:10: return_function: returning to ‘psql_scan_slash_option’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:590:14: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_option’
# 2484|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2485|   	 * we need to put in 2 end-of-buffer characters.
# 2486|-> 	 */
# 2487|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2488|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def818]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2529:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:687:1: enter_function: entry to ‘psql_scan_slash_command_end’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:697:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command_end’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:697:10: return_function: returning to ‘psql_scan_slash_command_end’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:705:2: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_command_end’
# 2527|   
# 2528|   	yy_flush_buffer( b , yyscanner);
# 2529|-> 
# 2530|   	b->yy_input_file = file;
# 2531|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def819]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2649:3: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(8)’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:490:1: enter_function: entry to ‘psql_scan_slash_command’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:504:19: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:505:10: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:505:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command’
# 2647|   		if ( ! yyg->yy_buffer_stack )
# 2648|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2649|-> 
# 2650|   		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
# 2651|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def820]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2670:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:490:1: enter_function: entry to ‘psql_scan_slash_command’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:504:19: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:505:10: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:505:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command’
# 2668|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2669|   
# 2670|-> 		/* zero only the new slots.*/
# 2671|   		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
# 2672|   		yyg->yy_buffer_stack_max = num_to_alloc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def821]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2695:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2681:17: enter_function: entry to ‘slash_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2691:24: call_function: inlined call to ‘slash_yyalloc’ from ‘slash_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2692:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2695:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.c:2705:2: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘slash_yy_scan_buffer’
# 2693|   	if ( ! b )
# 2694|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 2695|-> 
# 2696|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 2697|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: CPPCHECK_WARNING (CWE-562): [#def822]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:501: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  499|   	/* Set current output target */
#  500|   	state->output_buf = &mybuf;
#  501|-> 
#  502|   	/* Set input source */
#  503|   	if (state->buffer_stack != NULL)

Error: CPPCHECK_WARNING (CWE-562): [#def823]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:575: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  573|   	/* Set current output target */
#  574|   	state->output_buf = &mybuf;
#  575|-> 
#  576|   	/* Set input source */
#  577|   	if (state->buffer_stack != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def824]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:817:33: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:802:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:803:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:803:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:817:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:817:33: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  815|   			{
#  816|   				pg_log_error("%s: %m", cmd);
#  817|-> 				error = true;
#  818|   				break;
#  819|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def825]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:821:18: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:802:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:803:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:803:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:815:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:821:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:821:18: throw: if ‘appendBinaryPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:821:18: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  819|   			}
#  820|   			appendBinaryPQExpBuffer(&cmd_output, buf, result);
#  821|-> 		} while (!feof(fd));
#  822|   	}
#  823|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def826]
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:832:29: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:802:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:803:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:803:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:825:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:832:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/psql/psqlscanslash.l:832:29: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  830|   		 */
#  831|   		exit_code = pclose(fd);
#  832|-> 		if (exit_code == -1)
#  833|   		{
#  834|   			pg_log_error("%s: %m", cmd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def827]
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:539:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:474:1: enter_function: entry to ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:489:9: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:489:9: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:492:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:500:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:502:36: call_function: calling ‘blockreftable_iterate’ from ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:502:36: return_function: returning to ‘WriteBlockRefTable’ from ‘blockreftable_iterate’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:502:24: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:517:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:521:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:523:70: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:528:25: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:528:25: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:538:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:540:68: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:539:61: danger: dereference of NULL ‘blockreftable_lookup(*brtab.hash,  key)’
#  537|   			/* Write the untruncated portion of the chunk length array. */
#  538|   			if (sentry->nchunks != 0)
#  539|-> 				BlockRefTableWrite(&buffer, brtentry->chunk_usage,
#  540|   								   sentry->nchunks * sizeof(uint16));
#  541|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def828]
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:543:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:474:1: enter_function: entry to ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:489:9: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:489:9: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:492:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:500:32: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:502:36: call_function: calling ‘blockreftable_iterate’ from ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:502:36: return_function: returning to ‘WriteBlockRefTable’ from ‘blockreftable_iterate’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:502:24: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:517:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:521:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:523:70: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:528:25: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:528:25: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:538:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:543:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/blkreftable.c:543:41: danger: dereference of NULL ‘blockreftable_lookup(*brtab.hash,  key)’
#  541|   
#  542|   			/* Write the contents of each chunk. */
#  543|-> 			for (j = 0; j < brtentry->nchunks; ++j)
#  544|   			{
#  545|   				if (brtentry->chunk_usage[j] == 0)

Error: COMPILER_WARNING (CWE-704): [#def829]
postgresql-18beta1/postgresql-17.2/src/common/compression.c: scope_hint: In function ‘parse_compress_options’
postgresql-18beta1/postgresql-17.2/src/common/compression.c:458:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  458 |         sep = strchr(option, ':');
#      |             ^
#  456|   	 * name.
#  457|   	 */
#  458|-> 	sep = strchr(option, ':');
#  459|   	if (sep == NULL)
#  460|   	{

Error: COMPILER_WARNING (CWE-704): [#def830]
postgresql-18beta1/postgresql-17.2/src/common/compression.c:458:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  456|   	 * name.
#  457|   	 */
#  458|-> 	sep = strchr(option, ':');
#  459|   	if (sep == NULL)
#  460|   	{

Error: CPPCHECK_WARNING (CWE-457): [#def831]
postgresql-18beta1/postgresql-17.2/src/common/encnames.c:540: warning[uninitvar]: Uninitialized variable: newkey
#  538|   	}
#  539|   	*np = '\0';
#  540|-> 	return newkey;
#  541|   }
#  542|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def832]
postgresql-18beta1/postgresql-17.2/src/common/exec.c:388:16: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/postgresql-17.2/src/common/exec.c:379:25: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/exec.c:379:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/exec.c:387:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/exec.c:388:16: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/exec.c:388:16: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  386|   	/* Make sure popen() didn't change errno */
#  387|   	errno = 0;
#  388|-> 	line = pg_get_line(pipe_cmd, NULL);
#  389|   
#  390|   	if (line == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def833]
postgresql-18beta1/postgresql-17.2/src/common/file_utils.c:285:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/postgresql-17.2/src/common/file_utils.c:278:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/file_utils.c:279:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/file_utils.c:279:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/file_utils.c:285:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/file_utils.c:285:33: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  283|   	}
#  284|   
#  285|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
#  286|   	{
#  287|   		char		subpath[MAXPGPATH * 2];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def834]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:121:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:81:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:82:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:84:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:121:21: throw: if ‘pg_cryptohash_create’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:121:21: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  119|   	}
#  120|   
#  121|-> 	ctx->hash = pg_cryptohash_create(type);
#  122|   	if (ctx->hash == NULL)
#  123|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def835]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:171:28: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:171:28: throw: if ‘pg_cryptohash_create’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:171:28: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  169|   		memset(shrinkbuf, 0, digest_size);
#  170|   
#  171|-> 		hash_ctx = pg_cryptohash_create(ctx->type);
#  172|   		if (hash_ctx == NULL)
#  173|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def836]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: throw: if ‘pg_cryptohash_init’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  177|   		}
#  178|   
#  179|-> 		if (pg_cryptohash_init(hash_ctx) < 0 ||
#  180|   			pg_cryptohash_update(hash_ctx, key, len) < 0 ||
#  181|   			pg_cryptohash_final(hash_ctx, shrinkbuf, digest_size) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def837]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: throw: if ‘pg_cryptohash_update’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  178|   
#  179|   		if (pg_cryptohash_init(hash_ctx) < 0 ||
#  180|-> 			pg_cryptohash_update(hash_ctx, key, len) < 0 ||
#  181|   			pg_cryptohash_final(hash_ctx, shrinkbuf, digest_size) < 0)
#  182|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def838]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: throw: if ‘pg_cryptohash_final’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  179|   		if (pg_cryptohash_init(hash_ctx) < 0 ||
#  180|   			pg_cryptohash_update(hash_ctx, key, len) < 0 ||
#  181|-> 			pg_cryptohash_final(hash_ctx, shrinkbuf, digest_size) < 0)
#  182|   		{
#  183|   			ctx->error = PG_HMAC_ERROR_INTERNAL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def839]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:184:42: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:184:42: throw: if ‘pg_cryptohash_error’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:184:42: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  182|   		{
#  183|   			ctx->error = PG_HMAC_ERROR_INTERNAL;
#  184|-> 			ctx->errreason = pg_cryptohash_error(hash_ctx);
#  185|   			pg_cryptohash_free(hash_ctx);
#  186|   			FREE(shrinkbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def840]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:185:25: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:185:25: throw: if ‘pg_cryptohash_free’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:185:25: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  183|   			ctx->error = PG_HMAC_ERROR_INTERNAL;
#  184|   			ctx->errreason = pg_cryptohash_error(hash_ctx);
#  185|-> 			pg_cryptohash_free(hash_ctx);
#  186|   			FREE(shrinkbuf);
#  187|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def841]
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:259:13: warning[-Wanalyzer-malloc-leak]: leak of ‘h’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:248:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:251:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:251:13: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:252:12: branch_false: following ‘false’ branch (when ‘h’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:257:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:259:13: throw: if ‘pg_cryptohash_final’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:259:13: danger: ‘h’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  257|   	memset(h, 0, ctx->digest_size);
#  258|   
#  259|-> 	if (pg_cryptohash_final(ctx->hash, h, ctx->digest_size) < 0)
#  260|   	{
#  261|   		ctx->error = PG_HMAC_ERROR_INTERNAL;

Error: CPPCHECK_WARNING (CWE-457): [#def842]
postgresql-18beta1/postgresql-17.2/src/common/jsonapi.c:1315: warning[uninitvar]: Uninitialized variable: lex->inc_state
# 1313|   	JsonParseErrorType result;
# 1314|   
# 1315|-> 	if (lex->incremental && lex->inc_state->partial_completed)
# 1316|   	{
# 1317|   		/*

Error: GCC_ANALYZER_WARNING (CWE-404): [#def843]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:239:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:205:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:210:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:211:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  237|   	 * is buffered.
#  238|   	 */
#  239|-> 	fflush(stdout);
#  240|   
#  241|   	if (log_pre_callback)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def844]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:242:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:205:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:210:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:211:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  240|   
#  241|   	if (log_pre_callback)
#  242|-> 		log_pre_callback();
#  243|   
#  244|   	if (log_locus_callback)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def845]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:245:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:205:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:210:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:211:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  243|   
#  244|   	if (log_locus_callback)
#  245|-> 		log_locus_callback(&filename, &lineno);
#  246|   
#  247|   	fmt = _(fmt);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def846]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:252:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:205:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:210:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:211:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  250|   	{
#  251|   		if (sgr_locus)
#  252|-> 			fprintf(stderr, ANSI_ESCAPE_FMT, sgr_locus);
#  253|   		if (!(log_flags & PG_LOG_FLAG_TERSE))
#  254|   			fprintf(stderr, "%s:", progname);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def847]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:254:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:205:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:210:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:211:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  252|   			fprintf(stderr, ANSI_ESCAPE_FMT, sgr_locus);
#  253|   		if (!(log_flags & PG_LOG_FLAG_TERSE))
#  254|-> 			fprintf(stderr, "%s:", progname);
#  255|   		if (filename)
#  256|   		{

Error: GCC_ANALYZER_WARNING (CWE-404): [#def848]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:257:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:205:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:210:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:211:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  255|   		if (filename)
#  256|   		{
#  257|-> 			fprintf(stderr, "%s:", filename);
#  258|   			if (lineno > 0)
#  259|   				fprintf(stderr, UINT64_FORMAT ":", lineno);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def849]
postgresql-18beta1/postgresql-17.2/src/common/logging.c:311:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/logging.c:232:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/logging.c:239:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/logging.c:247:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:249:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/logging.c:266:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:310:9: acquire_resource: ‘va_copy’ called here
postgresql-18beta1/postgresql-17.2/src/common/logging.c:311:24: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/logging.c:311:24: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  309|   
#  310|   	va_copy(ap2, ap);
#  311|-> 	required_len = vsnprintf(NULL, 0, fmt, ap2) + 1;
#  312|   	va_end(ap2);
#  313|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def850]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:80:15: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   78|   
#   79|   	*errstr = NULL;
#   80|-> 	ctx = pg_cryptohash_create(PG_MD5);
#   81|   	if (ctx == NULL)
#   82|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def851]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:83:27: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   81|   	if (ctx == NULL)
#   82|   	{
#   83|-> 		*errstr = pg_cryptohash_error(NULL);	/* returns OOM */
#   84|   		return false;
#   85|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def852]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:87:13: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   85|   	}
#   86|   
#   87|-> 	if (pg_cryptohash_init(ctx) < 0 ||
#   88|   		pg_cryptohash_update(ctx, buff, len) < 0 ||
#   89|   		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def853]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:88:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   86|   
#   87|   	if (pg_cryptohash_init(ctx) < 0 ||
#   88|-> 		pg_cryptohash_update(ctx, buff, len) < 0 ||
#   89|   		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)
#   90|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def854]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:89:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   87|   	if (pg_cryptohash_init(ctx) < 0 ||
#   88|   		pg_cryptohash_update(ctx, buff, len) < 0 ||
#   89|-> 		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)
#   90|   	{
#   91|   		*errstr = pg_cryptohash_error(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def855]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:91:27: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   89|   		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)
#   90|   	{
#   91|-> 		*errstr = pg_cryptohash_error(ctx);
#   92|   		pg_cryptohash_free(ctx);
#   93|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def856]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:92:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   90|   	{
#   91|   		*errstr = pg_cryptohash_error(ctx);
#   92|-> 		pg_cryptohash_free(ctx);
#   93|   		return false;
#   94|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def857]
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:97:9: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   95|   
#   96|   	bytesToHex(sum, hexsum);
#   97|-> 	pg_cryptohash_free(ctx);
#   98|   	return true;
#   99|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def858]
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:106:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:65:38: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:67:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:75:33: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:95:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:97:33: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:98:64: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:100:53: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:104:52: branch_true: following ‘true’ branch (when ‘val’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:106:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:106:57: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/percentrepl.c:106:57: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  104|   						if (val)
#  105|   						{
#  106|-> 							appendStringInfoString(&result, val);
#  107|   							found = true;
#  108|   						}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def859]
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:52:31: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:45:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:46:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:52:31: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:52:31: throw: if ‘palloc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:52:31: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   50|   	}
#   51|   
#   52|-> 	filenames = (char **) palloc(fnsize * sizeof(char *));
#   53|   
#   54|   	while (errno = 0, (file = readdir(dir)) != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def860]
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:54:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:45:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:46:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:52:31: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:54:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/pgfnames.c:54:35: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   52|   	filenames = (char **) palloc(fnsize * sizeof(char *));
#   53|   
#   54|-> 	while (errno = 0, (file = readdir(dir)) != NULL)
#   55|   	{
#   56|   		if (strcmp(file->d_name, ".") != 0 && strcmp(file->d_name, "..") != 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def861]
postgresql-18beta1/postgresql-17.2/src/common/psprintf.c:110:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/psprintf.c:46:1: enter_function: entry to ‘psprintf’
postgresql-18beta1/postgresql-17.2/src/common/psprintf.c:65:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/psprintf.c:66:26: call_function: calling ‘pvsnprintf’ from ‘psprintf’
#  108|   	int			nprinted;
#  109|   
#  110|-> 	nprinted = vsnprintf(buf, len, fmt, args);
#  111|   
#  112|   	/* We assume failure means the fmt is bogus, hence hard failure is OK */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def862]
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:67:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:60:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:61:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:67:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:67:30: throw: if ‘palloc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:67:30: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   65|   	}
#   66|   
#   67|-> 	dirnames = (char **) palloc(sizeof(char *) * dirnames_capacity);
#   68|   
#   69|   	while (errno = 0, (de = readdir(dir)))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def863]
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:69:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:60:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:61:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:67:30: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:69:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/rmtree.c:69:33: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   67|   	dirnames = (char **) palloc(sizeof(char *) * dirnames_capacity);
#   68|   
#   69|-> 	while (errno = 0, (de = readdir(dir)))
#   70|   	{
#   71|   		if (strcmp(de->d_name, ".") == 0 ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def864]
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1096:22: warning[-Wanalyzer-malloc-leak]: leak of ‘input_chars’
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1069:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1082:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1083:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1085:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1085:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1088:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1088:23: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1089:12: branch_false: following ‘false’ branch (when ‘input_chars’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1089:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1093:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1095:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1096:22: throw: if ‘pg_utf_mblen_private’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/saslprep.c:1096:22: danger: ‘input_chars’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1094|   	{
# 1095|   		input_chars[i] = utf8_to_unicode(p);
# 1096|-> 		p += pg_utf_mblen(p);
# 1097|   	}
# 1098|   	input_chars[i] = (pg_wchar) '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def865]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termin’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:95:18: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: danger: ‘termin’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def866]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def867]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termin’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:95:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: danger: ‘termin’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def868]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:142:17: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def869]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘termin’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:95:18: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: danger: ‘termin’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def870]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def871]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termin’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:95:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: danger: ‘termin’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def872]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:145:18: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def873]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:148:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  147|   	/* If we failed to read anything, just return an empty string */
#  148|   	if (result == NULL)
#  149|-> 		result = pg_strdup("");
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def874]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:148:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:149:26: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  147|   	/* If we failed to read anything, just return an empty string */
#  148|   	if (result == NULL)
#  149|-> 		result = pg_strdup("");
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def875]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:152:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:152:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:152:16: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */
#  152|-> 	(void) pg_strip_crlf(result);
#  153|   
#  154|   	if (!echo)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def876]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:152:16: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:152:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:152:16: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */
#  152|-> 	(void) pg_strip_crlf(result);
#  153|   
#  154|   	if (!echo)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def877]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:160:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:154:12: branch_false: following ‘false’ branch (when ‘echo == 0’)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:158:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:160:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:160:17: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  158|   		tcsetattr(fileno(termin), TCSAFLUSH, &t_orig);
#  159|   		fputs("\n", termout);
#  160|-> 		fflush(termout);
#  161|   #elif defined(WIN32)
#  162|   		SetConsoleMode(t, t_orig);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def878]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:160:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:154:12: branch_false: following ‘false’ branch (when ‘echo == 0’)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:158:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:160:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:160:17: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  158|   		tcsetattr(fileno(termin), TCSAFLUSH, &t_orig);
#  159|   		fputs("\n", termout);
#  160|-> 		fflush(termout);
#  161|   #elif defined(WIN32)
#  162|   		SetConsoleMode(t, t_orig);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def879]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:171:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:154:12: branch_true: following ‘true’ branch (when ‘echo != 0’)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:167:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:167:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:171:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:171:17: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  169|   		/* also echo \n if prompt was canceled */
#  170|   		fputs("\n", termout);
#  171|-> 		fflush(termout);
#  172|   	}
#  173|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def880]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:171:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:154:12: branch_true: following ‘true’ branch (when ‘echo != 0’)...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:167:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:167:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:171:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:171:17: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  169|   		/* also echo \n if prompt was canceled */
#  170|   		fputs("\n", termout);
#  171|-> 		fflush(termout);
#  172|   	}
#  173|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def881]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:180:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:174:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:180:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:180:16: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  178|   	}
#  179|   
#  180|-> 	return result;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def882]
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:180:16: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:174:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:180:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/sprompt.c:180:16: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  178|   	}
#  179|   
#  180|-> 	return result;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def883]
postgresql-18beta1/postgresql-17.2/src/common/string.c:112:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
postgresql-18beta1/postgresql-17.2/src/common/string.c:97:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/string.c:102:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/string.c:102:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/string.c:105:23: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/string.c:109:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/string.c:109:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/string.c:112:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/string.c:112:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/string.c:112:25: danger: ‘dst’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  110|   		{
#  111|   			Assert(i < (dstlen - 3));
#  112|-> 			snprintf(&dst[i], dstlen - i, "\\x%02x", (unsigned char) *p);
#  113|   			i += 4;
#  114|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def884]
postgresql-18beta1/postgresql-17.2/src/common/stringinfo.c:155:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/common/stringinfo.c:97:1: enter_function: entry to ‘appendStringInfo’
postgresql-18beta1/postgresql-17.2/src/common/stringinfo.c:108:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/common/stringinfo.c:109:26: call_function: calling ‘appendStringInfoVA’ from ‘appendStringInfo’
#  153|   		return 32;
#  154|   
#  155|-> 	nprinted = pvsnprintf(str->data + str->len, (size_t) avail, fmt, args);
#  156|   
#  157|   	if (nprinted < (size_t) avail)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def885]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:909:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘width_header’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  907|   			 * display across multiple lines.  We check for both cases below.
#  908|   			 */
#  909|-> 			if (width > 0 && width_wrap[i])
#  910|   			{
#  911|   				unsigned int extra_lines;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def886]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:941:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  939|   						height;
#  940|   
#  941|-> 			pg_wcssize((const unsigned char *) cont->title, strlen(cont->title),
#  942|   					   encoding, &width, &height, NULL);
#  943|   			if (width >= width_total)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def887]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:945:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  943|   			if (width >= width_total)
#  944|   				/* Aligned */
#  945|-> 				fprintf(fout, "%s\n", cont->title);
#  946|   			else
#  947|   				/* Centered */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def888]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:948:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  946|   			else
#  947|   				/* Centered */
#  948|-> 				fprintf(fout, "%-*s%s\n", (width_total - width) / 2, "",
#  949|   						cont->title);
#  950|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def889]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:1040:17: warning[-Wanalyzer-null-argument]: use of NULL ‘bytes_output’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
# 1038|   		}
# 1039|   
# 1040|-> 		memset(bytes_output, 0, col_count * sizeof(int));
# 1041|   
# 1042|   		/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def890]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:1410:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
# 1408|   					fs;
# 1409|   
# 1410|-> 		pg_wcssize((const unsigned char *) *ptr, strlen(*ptr), encoding,
# 1411|   				   &width, &height, &fs);
# 1412|   		if (width > dwidth)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def891]
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3432:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
# 3430|   	else
# 3431|   		*is_pager = false;
# 3432|-> }
# 3433|   
# 3434|   /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def892]
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4584:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1127:8: enter_function: entry to ‘psql_scan’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1142:10: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_scan’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1142:10: return_function: returning to ‘psql_scan’ from ‘psql_yy_switch_to_buffer’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1147:14: call_function: calling ‘psql_yylex’ from ‘psql_scan’
# 4582|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 4583|   	 * we need to put in 2 end-of-buffer characters.
# 4584|-> 	 */
# 4585|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 4586|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def893]
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4627:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1127:8: enter_function: entry to ‘psql_scan’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1142:10: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_scan’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1142:10: return_function: returning to ‘psql_scan’ from ‘psql_yy_switch_to_buffer’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.l:1147:14: call_function: calling ‘psql_yylex’ from ‘psql_scan’
# 4625|   
# 4626|   	yy_flush_buffer( b , yyscanner);
# 4627|-> 
# 4628|   	b->yy_input_file = file;
# 4629|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def894]
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4793:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4779:17: enter_function: entry to ‘psql_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4789:24: call_function: inlined call to ‘psql_yyalloc’ from ‘psql_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4793:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/psqlscan.c:4803:2: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_yy_scan_buffer’
# 4791|   	if ( ! b )
# 4792|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 4793|-> 
# 4794|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 4795|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def895]
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:142:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename,  <unknown>)’
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:138:14: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:139:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:142:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:142:13: danger: ‘fopen(&filename,  <unknown>)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  140|   		pg_fatal("could not open file \"%s\": %m", filename);
#  141|   
#  142|-> 	if (fwrite(contents->data, contents->len, 1, cf) != 1)
#  143|   		pg_fatal("could not write to file \"%s\": %m", filename);
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def896]
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:142:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename,  <unknown>)’
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:138:14: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:139:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:142:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/fe_utils/recovery_gen.c:142:13: danger: ‘fopen(&filename,  <unknown>)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  140|   		pg_fatal("could not open file \"%s\": %m", filename);
#  141|   
#  142|-> 	if (fwrite(contents->data, contents->len, 1, cf) != 1)
#  143|   		pg_fatal("could not write to file \"%s\": %m", filename);
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def897]
postgresql-18beta1/postgresql-17.2/src/include/access/tableam.h:1057:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sscan’
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam_handler.c:686:1: enter_function: entry to ‘heapam_relation_copy_for_cluster’
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam_handler.c:730:12: branch_false: following ‘false’ branch (when ‘use_sort == 0’)...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam_handler.c:742:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam_handler.c:742:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam_handler.c:744:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/heap/heapam_handler.c:803:30: call_function: calling ‘table_scan_getnextslot’ from ‘heapam_relation_copy_for_cluster’
# 1055|   table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
# 1056|   {
# 1057|-> 	slot->tts_tableOid = RelationGetRelid(sscan->rs_rd);
# 1058|   
# 1059|   	/* We don't expect actual scans using NoMovementScanDirection */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def898]
postgresql-18beta1/postgresql-17.2/src/include/access/tupmacs.h:28:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:553:1: enter_function: entry to ‘brin_deform_tuple’
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:565:16: branch_true: following ‘true’ branch (when ‘dMemtuple’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:565:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:565:28: call_function: calling ‘brin_memtuple_initialize’ from ‘brin_deform_tuple’
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:565:28: return_function: returning to ‘brin_deform_tuple’ from ‘brin_memtuple_initialize’
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:568:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:572:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:583:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:587:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/brin/brin_tuple.c:587:9: call_function: calling ‘brin_deconstruct_tuple’ from ‘brin_deform_tuple’
#   26|   att_isnull(int ATT, const bits8 *BITS)
#   27|   {
#   28|-> 	return !(BITS[ATT >> 3] & (1 << (ATT & 0x07)));
#   29|   }
#   30|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def899]
postgresql-18beta1/postgresql-17.2/src/include/lib/radixtree.h:1121:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘slot’
postgresql-18beta1/postgresql-17.2/src/backend/access/common/tidstore.c:432:1: enter_function: entry to ‘TidStoreIsMember’
postgresql-18beta1/postgresql-17.2/src/backend/access/common/tidstore.c:440:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/common/tidstore.c:443:24: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/common/tidstore.c:443:24: call_function: calling ‘local_ts_find’ from ‘TidStoreIsMember’
# 1119|   	}
# 1120|   
# 1121|-> 	if (RT_CHILDPTR_IS_VALUE(*slot))
# 1122|   		return (RT_VALUE_TYPE *) slot;
# 1123|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def900]
postgresql-18beta1/postgresql-17.2/src/include/libpq/pqformat.h:146:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1922:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1949:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1957:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1959:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1962:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/libpq/auth.c:1969:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  144|   pq_sendint32(StringInfo buf, uint32 i)
#  145|   {
#  146|-> 	enlargeStringInfo(buf, sizeof(uint32));
#  147|   	pq_writeint32(buf, i);
#  148|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def901]
postgresql-18beta1/postgresql-17.2/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘elemops’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:3868:1: enter_function: entry to ‘make_partition_op_expr’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:3876:19: call_function: calling ‘get_partition_operator’ from ‘make_partition_op_expr’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:3876:19: return_function: returning to ‘make_partition_op_expr’ from ‘get_partition_operator’
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:3951:50: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/partitioning/partbounds.c:3951:100: call_function: inlined call to ‘list_nth_cell’ from ‘make_partition_op_expr’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def902]
postgresql-18beta1/postgresql-17.2/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘expanded_groups’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_agg.c:1803:1: enter_function: entry to ‘expand_grouping_sets’
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_agg.c:1810:12: branch_false: following ‘false’ branch (when ‘groupingSets’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_agg.c:1810:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_agg.c:1813:9: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/parser/parse_agg.c:1836:9: call_function: inlined call to ‘list_nth_cell’ from ‘expand_grouping_sets’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def903]
postgresql-18beta1/postgresql-17.2/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_ops’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2923:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2928:26: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2928:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2940:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2947:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2947:25: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2965:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2965:20: branch_false: following ‘false’ branch (when ‘matching_cols <= 1’)...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2985:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2985:25: release_memory: ‘new_ops’ is NULL
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/path/indxpath.c:2987:44: call_function: inlined call to ‘list_nth_cell’ from ‘expand_indexqual_rowcompare’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def904]
postgresql-18beta1/postgresql-17.2/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sortclause’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3159:1: enter_function: entry to ‘reorder_grouping_sets’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3165:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3171:50: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3171:24: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3171:24: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3165:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3171:24: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3171:50: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18beta1/postgresql-17.2/src/backend/optimizer/plan/planner.c:3171:24: branch_true: following ‘true’ branch...
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def905]
postgresql-18beta1/postgresql-17.2/src/include/storage/block.h:105:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:648:1: enter_function: entry to ‘_bt_bottomupdel_finish_pending’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:657:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:659:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:665:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:690:57: call_function: inlined call to ‘BTreeTupleGetNPosting’ from ‘_bt_bottomupdel_finish_pending’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:696:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:709:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:709:42: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘_bt_bottomupdel_finish_pending’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:709:42: return_function: returning to ‘_bt_bottomupdel_finish_pending’ from ‘BTreeTupleGetHeapTID’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtdedup.c:712:48: call_function: inlined call to ‘ItemPointerGetBlockNumber’ from ‘_bt_bottomupdel_finish_pending’
#  103|   BlockIdGetBlockNumber(const BlockIdData *blockId)
#  104|   {
#  105|-> 	return (((BlockNumber) blockId->bi_hi) << 16) | ((BlockNumber) blockId->bi_lo);
#  106|   }
#  107|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def906]
postgresql-18beta1/postgresql-17.2/src/include/storage/bufpage.h:340:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘childpage’
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/gin/ginbtree.c:823:17: call_function: calling ‘ginFinishOldSplit’ from ‘ginInsertValue’
#  338|   {
#  339|   	PageValidateSpecialPointer(page);
#  340|-> 	return (char *) page + ((PageHeader) page)->pd_special;
#  341|   }
#  342|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def907]
postgresql-18beta1/postgresql-17.2/src/include/storage/itemptr.h:116:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5073:1: enter_function: entry to ‘_bt_check_third_page’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5082:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5090:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5098:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5102:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5102:9: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5102:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5102:9: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘_bt_check_third_page’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5102:9: return_function: returning to ‘_bt_check_third_page’ from ‘BTreeTupleGetHeapTID’
postgresql-18beta1/postgresql-17.2/src/backend/access/nbtree/nbtutils.c:5102:9: call_function: inlined call to ‘ItemPointerGetOffsetNumber’ from ‘_bt_check_third_page’
#  114|   ItemPointerGetOffsetNumberNoCheck(const ItemPointerData *pointer)
#  115|   {
#  116|-> 	return pointer->ip_posid;
#  117|   }
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def908]
postgresql-18beta1/postgresql-17.2/src/include/storage/itemptr.h:116:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘nexttid’
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1049:1: enter_function: entry to ‘bt_entry_unique_check’
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1062:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1101:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1101:23: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘bt_entry_unique_check’
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1101:23: return_function: returning to ‘bt_entry_unique_check’ from ‘BTreeTupleGetHeapTID’
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1102:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1105:48: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/contrib/amcheck/verify_nbtree.c:1107:33: call_function: calling ‘bt_report_duplicate’ from ‘bt_entry_unique_check’
#  114|   ItemPointerGetOffsetNumberNoCheck(const ItemPointerData *pointer)
#  115|   {
#  116|-> 	return pointer->ip_posid;
#  117|   }
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def909]
postgresql-18beta1/postgresql-17.2/src/include/utils/expandedrecord.h:220:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘newerh’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7427:1: enter_function: entry to ‘exec_move_row_from_datum’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7432:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7440:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7543:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7543:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7554:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7555:17: call_function: calling ‘exec_move_row_from_fields’ from ‘exec_move_row_from_datum’
#  218|   expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
#  219|   {
#  220|-> 	if (likely(erh->er_tupdesc != NULL))
#  221|   		return erh->er_tupdesc;
#  222|   	else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def910]
postgresql-18beta1/postgresql-17.2/src/include/utils/expandedrecord.h:220:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘srcerh’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7427:1: enter_function: entry to ‘exec_move_row_from_datum’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7432:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7440:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7543:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7543:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7554:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_exec.c:7555:17: call_function: calling ‘exec_move_row_from_fields’ from ‘exec_move_row_from_datum’
#  218|   expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
#  219|   {
#  220|-> 	if (likely(erh->er_tupdesc != NULL))
#  221|   		return erh->er_tupdesc;
#  222|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def911]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:182:43: warning[-Wanalyzer-malloc-leak]: leak of ‘ecpg_strndup(cp, (long unsigned int)len)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:198:1: enter_function: entry to ‘deccvasc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:205:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:208:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:208:15: call_function: calling ‘ecpg_strndup’ from ‘deccvasc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:208:15: return_function: returning to ‘deccvasc’ from ‘ecpg_strndup’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:210:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:214:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:215:26: throw: if ‘PGTYPESnumeric_from_asc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/compatlib/informix.c:182:43: danger: ‘ecpg_strndup(cp, (long unsigned int)len)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  180|   {
#  181|   	size_t		real_len = strlen(str);
#  182|-> 	int			use_len = (int) ((real_len > len) ? len : real_len);
#  183|   
#  184|   	char	   *new = malloc(use_len + 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def912]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:161:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:153:1: enter_function: entry to ‘ECPGsetcommit’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:155:34: call_function: calling ‘ecpg_get_connection’ from ‘ECPGsetcommit’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:155:34: return_function: returning to ‘ECPGsetcommit’ from ‘ecpg_get_connection’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:161:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/connect.c:161:9: danger: dereference of NULL ‘ecpg_get_connection(connection_name)’
#  159|   		return false;
#  160|   
#  161|-> 	ecpg_log("ECPGsetcommit on line %d: action \"%s\"; connection \"%s\"\n", lineno, mode, con->name);
#  162|   
#  163|   	if (con->autocommit && strncmp(mode, "off", strlen("off")) == 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def913]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:42:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
#   40|   get_descriptors(void)
#   41|   {
#   42|-> 	pthread_once(&descriptor_once, descriptor_key_init);
#   43|   	return (struct descriptor *) pthread_getspecific(descriptor_key);
#   44|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def914]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:143:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:332:38: call_function: calling ‘get_int_item’ from ‘ECPGget_desc’
#  141|   			break;
#  142|   		default:
#  143|-> 			ecpg_raise(lineno, ECPG_VAR_NOT_NUMERIC, ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, NULL);
#  144|   			return false;
#  145|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def915]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:219:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: call_function: calling ‘get_char_item’ from ‘ECPGget_desc’
#  217|   			break;
#  218|   		default:
#  219|-> 			ecpg_raise(lineno, ECPG_VAR_NOT_CHAR, ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, NULL);
#  220|   			return false;
#  221|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def916]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:252:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:252:9: throw: if ‘ecpg_init_sqlca’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:252:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  250|   
#  251|   	va_start(args, index);
#  252|-> 	ecpg_init_sqlca(sqlca);
#  253|   	ECPGresult = ecpg_result_by_descriptor(lineno, desc_name);
#  254|   	if (!ECPGresult)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def917]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/3)
#  258|   	}
#  259|   
#  260|-> 	ntuples = PQntuples(ECPGresult);
#  261|   
#  262|   	if (index < 1 || index > PQnfields(ECPGresult))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def918]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch (when ‘index > 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: throw: if ‘PQnfields’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
#  260|   	ntuples = PQntuples(ECPGresult);
#  261|   
#  262|-> 	if (index < 1 || index > PQnfields(ECPGresult))
#  263|   	{
#  264|   		ecpg_raise(lineno, ECPG_INVALID_DESCRIPTOR_INDEX, ECPG_SQLSTATE_INVALID_DESCRIPTOR_INDEX, NULL);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def919]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:264:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:264:17: throw: if ‘ecpg_raise’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:264:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/3)
#  262|   	if (index < 1 || index > PQnfields(ECPGresult))
#  263|   	{
#  264|-> 		ecpg_raise(lineno, ECPG_INVALID_DESCRIPTOR_INDEX, ECPG_SQLSTATE_INVALID_DESCRIPTOR_INDEX, NULL);
#  265|   		va_end(args);
#  266|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def920]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:269:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:269:9: throw: if ‘ecpg_log’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:269:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/3)
#  267|   	}
#  268|   
#  269|-> 	ecpg_log("ECPGget_desc: reading items for tuple %d\n", index);
#  270|   	--index;
#  271|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def921]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
#  320|   
#  321|   			case ECPGd_name:
#  322|-> 				if (!get_char_item(lineno, var, vartype, PQfname(ECPGresult, index), varcharsize))
#  323|   				{
#  324|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def922]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: call_function: calling ‘get_char_item’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: return_function: returning to ‘ECPGget_desc’ from ‘get_char_item’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:322:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: throw: if ‘ecpg_log’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
#  326|   				}
#  327|   
#  328|-> 				ecpg_log("ECPGget_desc: NAME = %s\n", PQfname(ECPGresult, index));
#  329|   				break;
#  330|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def923]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:350:74: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:350:74: throw: if ‘PQfmod’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:350:74: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/3)
#  348|   
#  349|   			case ECPGd_scale:
#  350|-> 				if (!get_int_item(lineno, var, vartype, (PQfmod(ECPGresult, index) - VARHDRSZ) & 0xffff))
#  351|   				{
#  352|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def924]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:360:73: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:360:73: throw: if ‘PQfmod’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:360:73: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/3)
#  358|   
#  359|   			case ECPGd_precision:
#  360|-> 				if (!get_int_item(lineno, var, vartype, PQfmod(ECPGresult, index) >> 16))
#  361|   				{
#  362|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def925]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:370:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:370:38: throw: if ‘PQfsize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:370:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/3)
#  368|   
#  369|   			case ECPGd_octet:
#  370|-> 				if (!get_int_item(lineno, var, vartype, PQfsize(ECPGresult, index)))
#  371|   				{
#  372|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def926]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:380:73: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:380:73: throw: if ‘PQfmod’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:380:73: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/3)
#  378|   
#  379|   			case ECPGd_length:
#  380|-> 				if (!get_int_item(lineno, var, vartype, PQfmod(ECPGresult, index) - VARHDRSZ))
#  381|   				{
#  382|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def927]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:390:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:390:38: throw: if ‘PQftype’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:390:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/3)
#  388|   
#  389|   			case ECPGd_type:
#  390|-> 				if (!get_int_item(lineno, var, vartype, ecpg_dynamic_type(PQftype(ECPGresult, index))))
#  391|   				{
#  392|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def928]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:400:73: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:400:73: throw: if ‘PQftype’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:400:73: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/3)
#  398|   
#  399|   			case ECPGd_di_code:
#  400|-> 				if (!get_int_item(lineno, var, vartype, ecpg_dynamic_type_DDT(PQftype(ECPGresult, index))))
#  401|   				{
#  402|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def929]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:410:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:410:38: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:410:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/3)
#  408|   
#  409|   			case ECPGd_cardinality:
#  410|-> 				if (!get_int_item(lineno, var, vartype, PQntuples(ECPGresult)))
#  411|   				{
#  412|   					va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def930]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:429:41: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:422:33: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:429:41: throw: if ‘ecpg_log’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:429:41: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/3)
#  427|   				if (arrsize > 0 && ntuples > arrsize)
#  428|   				{
#  429|-> 					ecpg_log("ECPGget_desc on line %d: incorrect number of matches; %d don't fit into array of %ld\n",
#  430|   							 lineno, ntuples, arrsize);
#  431|   					ecpg_raise(lineno, ECPG_TOO_MANY_MATCHES, ECPG_SQLSTATE_CARDINALITY_VIOLATION, NULL);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def931]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:431:41: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:422:33: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:431:41: throw: if ‘ecpg_raise’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:431:41: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/3)
#  429|   					ecpg_log("ECPGget_desc on line %d: incorrect number of matches; %d don't fit into array of %ld\n",
#  430|   							 lineno, ntuples, arrsize);
#  431|-> 					ecpg_raise(lineno, ECPG_TOO_MANY_MATCHES, ECPG_SQLSTATE_CARDINALITY_VIOLATION, NULL);
#  432|   					va_end(args);
#  433|   					return false;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def932]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:438:68: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:422:33: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:436:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:438:68: throw: if ‘ecpg_auto_alloc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:438:68: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/3)
#  436|   				if (arrsize == 0 && *(void **) var == NULL)
#  437|   				{
#  438|-> 					void	   *mem = (void *) ecpg_auto_alloc(offset * ntuples, lineno);
#  439|   
#  440|   					if (!mem)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def933]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:462:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:462:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:462:33: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/3)
#  460|   
#  461|   			default:
#  462|-> 				snprintf(type_str, sizeof(type_str), "%d", type);
#  463|   				ecpg_raise(lineno, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, type_str);
#  464|   				va_end(args);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def934]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:463:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:463:33: throw: if ‘ecpg_raise’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:463:33: danger: missing call to ‘va_end’ to match ‘va_start’ at [(4)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/3)
#  461|   			default:
#  462|   				snprintf(type_str, sizeof(type_str), "%d", type);
#  463|-> 				ecpg_raise(lineno, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, type_str);
#  464|   				va_end(args);
#  465|   				return false;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def935]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:720:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:605:1: enter_function: entry to ‘ECPGset_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:612:16: call_function: calling ‘ecpg_find_desc’ from ‘ECPGset_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:612:16: return_function: returning to ‘ECPGset_desc’ from ‘ecpg_find_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:613:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:616:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:634:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:637:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:637:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:646:20: branch_true: following ‘true’ branch (when ‘itemtype == 16’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:724:1: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:720:9: throw: if ‘ecpg_free’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:720:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(11)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/10)
#  718|   		}
#  719|   	}
#  720|-> 	ecpg_free(var);
#  721|   	va_end(args);
#  722|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def936]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:842:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
#  840|   	}
#  841|   
#  842|-> 	ecpg_raise(line, ECPG_UNKNOWN_DESCRIPTOR, ECPG_SQLSTATE_INVALID_SQL_DESCRIPTOR_NAME, name);
#  843|   	return NULL;				/* not found */
#  844|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def937]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:912:47: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:912:47: throw: if ‘PQdescribePrepared’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:912:47: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/6)
#  910|   						break;
#  911|   
#  912|-> 					res = PQdescribePrepared(con->connection, stmt_name);
#  913|   					if (!ecpg_check_PQresult(res, line, con->connection, compat))
#  914|   						break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def938]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:913:46: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:913:46: throw: if ‘ecpg_check_PQresult’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:913:46: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/6)
#  911|   
#  912|   					res = PQdescribePrepared(con->connection, stmt_name);
#  913|-> 					if (!ecpg_check_PQresult(res, line, con->connection, compat))
#  914|   						break;
#  915|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def939]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:916:41: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:916:41: throw: if ‘PQclear’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:916:41: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/6)
#  914|   						break;
#  915|   
#  916|-> 					PQclear(desc->result);
#  917|   
#  918|   					desc->result = res;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def940]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:929:55: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:929:55: throw: if ‘PQdescribePrepared’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:929:55: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/6)
#  927|   						struct sqlda_compat *sqlda;
#  928|   
#  929|-> 						res = PQdescribePrepared(con->connection, stmt_name);
#  930|   						if (!ecpg_check_PQresult(res, line, con->connection, compat))
#  931|   							break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def941]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:930:54: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:930:54: throw: if ‘ecpg_check_PQresult’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:930:54: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/6)
#  928|   
#  929|   						res = PQdescribePrepared(con->connection, stmt_name);
#  930|-> 						if (!ecpg_check_PQresult(res, line, con->connection, compat))
#  931|   							break;
#  932|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def942]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:933:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:933:57: throw: if ‘ecpg_build_compat_sqlda’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:933:57: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/6)
#  931|   							break;
#  932|   
#  933|-> 						sqlda = ecpg_build_compat_sqlda(line, res, -1, compat);
#  934|   						if (sqlda)
#  935|   						{

Error: GCC_ANALYZER_WARNING (CWE-404): [#def943]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:934:52: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: throw: if ‘PQclear’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/6)
#  948|   						}
#  949|   
#  950|-> 						PQclear(res);
#  951|   					}
#  952|   					else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def944]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:957:55: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:957:55: throw: if ‘PQdescribePrepared’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:957:55: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/6)
#  955|   						struct sqlda_struct *sqlda;
#  956|   
#  957|-> 						res = PQdescribePrepared(con->connection, stmt_name);
#  958|   						if (!ecpg_check_PQresult(res, line, con->connection, compat))
#  959|   							break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def945]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:958:54: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:958:54: throw: if ‘ecpg_check_PQresult’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:958:54: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/6)
#  956|   
#  957|   						res = PQdescribePrepared(con->connection, stmt_name);
#  958|-> 						if (!ecpg_check_PQresult(res, line, con->connection, compat))
#  959|   							break;
#  960|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def946]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:961:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:961:57: throw: if ‘ecpg_build_native_sqlda’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:961:57: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/6)
#  959|   							break;
#  960|   
#  961|-> 						sqlda = ecpg_build_native_sqlda(line, res, -1, compat);
#  962|   						if (sqlda)
#  963|   						{

Error: GCC_ANALYZER_WARNING (CWE-404): [#def947]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:962:52: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: throw: if ‘PQclear’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/6)
#  976|   						}
#  977|   
#  978|-> 						PQclear(res);
#  979|   					}
#  980|   					break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def948]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:1960:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2283:15: call_function: calling ‘ecpg_do’ from ‘ECPGdo’
# 1958|   	if (!query)
# 1959|   	{
# 1960|-> 		ecpg_raise(lineno, ECPG_EMPTY, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, NULL);
# 1961|   		return false;
# 1962|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def949]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:1964:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2283:15: call_function: calling ‘ecpg_do’ from ‘ECPGdo’
# 1962|   	}
# 1963|   
# 1964|-> 	ecpg_pthreads_init();
# 1965|   
# 1966|   	con = ecpg_get_connection(connection_name);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def950]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:1966:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2283:15: call_function: calling ‘ecpg_do’ from ‘ECPGdo’
# 1964|   	ecpg_pthreads_init();
# 1965|   
# 1966|-> 	con = ecpg_get_connection(connection_name);
# 1967|   
# 1968|   	if (!ecpg_init(con, connection_name, lineno))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def951]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:1968:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2283:15: call_function: calling ‘ecpg_do’ from ‘ECPGdo’
# 1966|   	con = ecpg_get_connection(connection_name);
# 1967|   
# 1968|-> 	if (!ecpg_init(con, connection_name, lineno))
# 1969|   		return false;
# 1970|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def952]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:1971:37: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/execute.c:2283:15: call_function: calling ‘ecpg_do’ from ‘ECPGdo’
# 1969|   		return false;
# 1970|   
# 1971|-> 	stmt = (struct statement *) ecpg_alloc(sizeof(struct statement), lineno);
# 1972|   
# 1973|   	if (stmt == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def953]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:21:36: warning[-Wanalyzer-malloc-leak]: leak of ‘ecpg_alloc(16, lineno)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:117:1: enter_function: entry to ‘ecpg_add_mem’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:119:51: call_function: calling ‘ecpg_alloc’ from ‘ecpg_add_mem’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:119:51: return_function: returning to ‘ecpg_add_mem’ from ‘ecpg_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:121:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:124:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:125:20: call_function: calling ‘get_auto_allocs’ from ‘ecpg_add_mem’
#   19|   ecpg_alloc(long size, int lineno)
#   20|   {
#   21|-> 	char	   *new = (char *) calloc(1L, size);
#   22|   
#   23|   	if (!new)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def954]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:21:36: warning[-Wanalyzer-malloc-leak]: leak of ‘ecpg_alloc(size,  lineno)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:101:1: enter_function: entry to ‘ecpg_auto_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:103:36: call_function: calling ‘ecpg_alloc’ from ‘ecpg_auto_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:103:36: return_function: returning to ‘ecpg_auto_alloc’ from ‘ecpg_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:105:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:108:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/memory.c:108:14: call_function: calling ‘ecpg_add_mem’ from ‘ecpg_auto_alloc’
#   19|   ecpg_alloc(long size, int lineno)
#   20|   {
#   21|-> 	char	   *new = (char *) calloc(1L, size);
#   22|   
#   23|   	if (!new)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def955]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:114:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ECPGget_sqlca()’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:232:1: enter_function: entry to ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: call_function: calling ‘ECPGget_sqlca’ from ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: return_function: returning to ‘ecpg_log’ from ‘ECPGget_sqlca’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:114:17: danger: ‘ECPGget_sqlca()’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  112|   	pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
#  113|   
#  114|-> 	sqlca = pthread_getspecific(sqlca_key);
#  115|   	if (sqlca == NULL)
#  116|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def956]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:261:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fmt’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:232:1: enter_function: entry to ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: call_function: calling ‘ECPGget_sqlca’ from ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: return_function: returning to ‘ecpg_log’ from ‘ECPGget_sqlca’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:245:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:249:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:256:24: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:257:12: branch_false: following ‘false’ branch (when ‘fmt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:260:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:260:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:261:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:261:17: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:261:17: danger: ‘fmt’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
#  259|   
#  260|   	if (ecpg_internal_regression_mode)
#  261|-> 		snprintf(fmt, bufsize, "[NO_PID]: %s", intl_format);
#  262|   	else
#  263|   		snprintf(fmt, bufsize, "[%d]: %s", (int) getpid(), intl_format);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def957]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:263:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fmt’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:232:1: enter_function: entry to ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: call_function: calling ‘ECPGget_sqlca’ from ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: return_function: returning to ‘ecpg_log’ from ‘ECPGget_sqlca’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:245:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:249:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:256:24: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:257:12: branch_false: following ‘false’ branch (when ‘fmt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:260:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:260:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:263:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:263:17: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:263:17: danger: ‘fmt’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  261|   		snprintf(fmt, bufsize, "[NO_PID]: %s", intl_format);
#  262|   	else
#  263|-> 		snprintf(fmt, bufsize, "[%d]: %s", (int) getpid(), intl_format);
#  264|   
#  265|   	pthread_mutex_lock(&debug_mutex);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def958]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:271:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:232:1: enter_function: entry to ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: call_function: calling ‘ECPGget_sqlca’ from ‘ecpg_log’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:235:33: return_function: returning to ‘ecpg_log’ from ‘ECPGget_sqlca’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:245:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:249:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:257:12: branch_false: following ‘false’ branch (when ‘fmt’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:260:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:268:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:270:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:270:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:271:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/ecpglib/misc.c:271:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(13)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/12)
#  269|   	{
#  270|   		va_start(ap, format);
#  271|-> 		vfprintf(debugstream, fmt, ap);
#  272|   		va_end(ap);
#  273|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def959]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:12:36: warning[-Wanalyzer-malloc-leak]: leak of ‘pgtypes_alloc(40)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:30:1: enter_function: entry to ‘pgtypes_fmt_replace’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:77:49: call_function: calling ‘pgtypes_alloc’ from ‘pgtypes_fmt_replace’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:77:49: return_function: returning to ‘pgtypes_fmt_replace’ from ‘pgtypes_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:79:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:81:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:84:53: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/common.c:12:36: danger: ‘pgtypes_alloc(40)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#   10|   pgtypes_alloc(long size)
#   11|   {
#   12|-> 	char	   *new = (char *) calloc(1L, size);
#   13|   
#   14|   	if (!new)

Error: COMPILER_WARNING (CWE-704): [#def960]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c: scope_hint: In function ‘PGTYPESdate_defmt_asc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c:357:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  357 |         fmt_ystart = strstr(fmt, "yy");
#      |                    ^
#  355|   
#  356|   	/* analyze the fmt string */
#  357|-> 	fmt_ystart = strstr(fmt, "yy");
#  358|   	fmt_mstart = strstr(fmt, "mm");
#  359|   	fmt_dstart = strstr(fmt, "dd");

Error: COMPILER_WARNING (CWE-704): [#def961]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c:357:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  355|   
#  356|   	/* analyze the fmt string */
#  357|-> 	fmt_ystart = strstr(fmt, "yy");
#  358|   	fmt_mstart = strstr(fmt, "mm");
#  359|   	fmt_dstart = strstr(fmt, "dd");

Error: COMPILER_WARNING (CWE-704): [#def962]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c:358:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  358 |         fmt_mstart = strstr(fmt, "mm");
#      |                    ^
#  356|   	/* analyze the fmt string */
#  357|   	fmt_ystart = strstr(fmt, "yy");
#  358|-> 	fmt_mstart = strstr(fmt, "mm");
#  359|   	fmt_dstart = strstr(fmt, "dd");
#  360|   

Error: COMPILER_WARNING (CWE-704): [#def963]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c:358:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  356|   	/* analyze the fmt string */
#  357|   	fmt_ystart = strstr(fmt, "yy");
#  358|-> 	fmt_mstart = strstr(fmt, "mm");
#  359|   	fmt_dstart = strstr(fmt, "dd");
#  360|   

Error: COMPILER_WARNING (CWE-704): [#def964]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c:359:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  359 |         fmt_dstart = strstr(fmt, "dd");
#      |                    ^
#  357|   	fmt_ystart = strstr(fmt, "yy");
#  358|   	fmt_mstart = strstr(fmt, "mm");
#  359|-> 	fmt_dstart = strstr(fmt, "dd");
#  360|   
#  361|   	if (!fmt_ystart || !fmt_mstart || !fmt_dstart)

Error: COMPILER_WARNING (CWE-704): [#def965]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/datetime.c:359:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  357|   	fmt_ystart = strstr(fmt, "yy");
#  358|   	fmt_mstart = strstr(fmt, "mm");
#  359|-> 	fmt_dstart = strstr(fmt, "dd");
#  360|   
#  361|   	if (!fmt_ystart || !fmt_mstart || !fmt_dstart)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def966]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/timestamp.c:759:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘replace_val’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/timestamp.c:782:1: enter_function: entry to ‘PGTYPEStimestamp_fmt_asc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/pgtypeslib/timestamp.c:793:16: call_function: calling ‘dttofmtasc_replace’ from ‘PGTYPEStimestamp_fmt_asc’
#  757|   					break;
#  758|   			}
#  759|-> 			i = pgtypes_fmt_replace(replace_val, replace_type, &q, pstr_len);
#  760|   			if (i)
#  761|   				return i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def967]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4602:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4589:21: enter_function: entry to ‘base_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4593:24: call_function: inlined call to ‘base_yyalloc’ from ‘base_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4597:2: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4602:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 4600|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 4601|   	 * we need to put in 2 end-of-buffer characters.
# 4602|-> 	 */
# 4603|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 4604|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def968]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4643: warning[nullPointer]: Possible null pointer dereference: b
# 4641|       
# 4642|   	yy_flush_buffer( b );
# 4643|-> 
# 4644|   	b->yy_input_file = file;
# 4645|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def969]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4644: warning[nullPointer]: Possible null pointer dereference: b
# 4642|   	yy_flush_buffer( b );
# 4643|   
# 4644|-> 	b->yy_input_file = file;
# 4645|   	b->yy_fill_buffer = 1;
# 4646|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def970]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4805:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4791:17: enter_function: entry to ‘base_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4801:24: call_function: inlined call to ‘base_yyalloc’ from ‘base_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4802:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4805:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4815:2: call_function: calling ‘base_yy_switch_to_buffer’ from ‘base_yy_scan_buffer’
# 4803|   	if ( ! b )
# 4804|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 4805|-> 
# 4806|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 4807|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def971]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4831:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1772:1: enter_function: entry to ‘isdefine’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1777:29: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1780:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1789:39: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1789:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1803:25: call_function: calling ‘base_yy_scan_string’ from ‘isdefine’
# 4829|   YY_BUFFER_STATE yy_scan_string (const char * yystr )
# 4830|   {
# 4831|->     
# 4832|   	return yy_scan_bytes( yystr, (int) strlen(yystr) );
# 4833|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def972]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4855:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1816:1: enter_function: entry to ‘isinformixdefine’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1833:31: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1833:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1839:17: call_function: calling ‘base_yy_scan_string’ from ‘isinformixdefine’
# 4853|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
# 4854|   
# 4855|-> 	for ( i = 0; i < _yybytes_len; ++i )
# 4856|   		buf[i] = yybytes[i];
# 4857|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def973]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4857:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4841:17: enter_function: entry to ‘base_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4850:24: call_function: inlined call to ‘base_yyalloc’ from ‘base_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4851:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4851:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.c:4859:6: call_function: calling ‘base_yy_scan_buffer’ from ‘base_yy_scan_bytes’
# 4855|   	for ( i = 0; i < _yybytes_len; ++i )
# 4856|   		buf[i] = yybytes[i];
# 4857|-> 
# 4858|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 4859|   

Error: CPPCHECK_WARNING (CWE-401): [#def974]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1607: error[memleakOnRealloc]: Common realloc mistake: 'literalbuf' nulled but not freed upon failure
# 1605|   		while ((literallen+yleng) >= literalalloc);
# 1606|   		literalbuf = (char *) realloc(literalbuf, literalalloc);
# 1607|-> 	}
# 1608|   	/* append new data, add trailing null */
# 1609|   	memcpy(literalbuf+literallen, ytext, yleng);

Error: CPPCHECK_WARNING (CWE-401): [#def975]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1622: error[memleakOnRealloc]: Common realloc mistake: 'literalbuf' nulled but not freed upon failure
# 1620|   		literalalloc *= 2;
# 1621|   		literalbuf = (char *) realloc(literalbuf, literalalloc);
# 1622|-> 	}
# 1623|   	/* append new data, add trailing null */
# 1624|   	literalbuf[literallen] = ychar;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def976]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1803:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<return-value>’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1772:1: enter_function: entry to ‘isdefine’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1777:29: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1780:43: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1789:39: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1789:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1803:25: call_function: calling ‘base_yy_scan_string’ from ‘isdefine’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/pgc.l:1803:25: danger: ‘<return-value>’ leaks here; was allocated at [(23)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/22)
# 1801|   			 */
# 1802|   			yy_scan_string(ptr->value);
# 1803|-> 			return true;
# 1804|   		}
# 1805|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def977]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39445:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39400:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39406:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39432:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39434:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39443:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39443:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39445:9: danger: use of uninitialized value ‘yyss’ here
#39443|           if (! yyptr)
#39444|             YYNOMEM;
#39445|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#39446|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#39447|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def978]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39576:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39400:6: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39469:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39469:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39472:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39484:6: branch_true: following ‘true’ branch (when ‘yyn == -6472’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39485:5: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39556:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39558:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.c:39576:3: danger: use of uninitialized value ‘*<unknown>’ here
#39574|        unconditionally makes the parser a bit smaller, and it avoids a
#39575|        GCC warning that YYVAL may be used uninitialized.  */
#39576|->   yyval = yyvsp[1-yylen];
#39577|   
#39578|     /* Default location. */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def979]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:116:1: enter_function: entry to ‘mmfatal’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:120:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:121:9: call_function: calling ‘vmmerror’ from ‘mmfatal’
#   77|   	error = _(error);
#   78|   
#   79|-> 	fprintf(stderr, "%s:%d: ", input_filename, base_yylineno);
#   80|   
#   81|   	switch(type)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def980]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:84:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:106:1: enter_function: entry to ‘mmerror’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:110:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:111:9: call_function: calling ‘vmmerror’ from ‘mmerror’
#   82|   	{
#   83|   		case ET_WARNING:
#   84|-> 			fprintf(stderr, _("WARNING: "));
#   85|   			break;
#   86|   		case ET_ERROR:

Error: GCC_ANALYZER_WARNING (CWE-404): [#def981]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:87:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:116:1: enter_function: entry to ‘mmfatal’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:120:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:121:9: call_function: calling ‘vmmerror’ from ‘mmfatal’
#   85|   			break;
#   86|   		case ET_ERROR:
#   87|-> 			fprintf(stderr, _("ERROR: "));
#   88|   			break;
#   89|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def982]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:91:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:116:1: enter_function: entry to ‘mmfatal’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:120:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:121:9: call_function: calling ‘vmmerror’ from ‘mmfatal’
#   89|   	}
#   90|   
#   91|-> 	vfprintf(stderr, error, ap);
#   92|   
#   93|   	fprintf(stderr, "\n");

Error: GCC_ANALYZER_WARNING (CWE-404): [#def983]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:141:35: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:153:1: enter_function: entry to ‘cat_str’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:159:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:164:21: branch_true: following ‘true’ branch (when ‘i < count’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:165:27: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/preproc.y:165:27: call_function: calling ‘cat2_str’ from ‘cat_str’
#  139|   cat2_str(char *str1, char *str2)
#  140|   {
#  141|-> 	char * res_str	= (char *)mm_alloc(strlen(str1) + strlen(str2) + 2);
#  142|   
#  143|   	strcpy(res_str, str1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def984]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:18:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(ind_name) + <unknown> + 3)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#   16|   
#   17|   	if (ptr == NULL)
#   18|-> 		mmfatal(OUT_OF_MEMORY, "out of memory");
#   19|   
#   20|   	return ptr;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def985]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:30:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("-1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#   28|   
#   29|   	if (new == NULL)
#   30|-> 		mmfatal(OUT_OF_MEMORY, "out of memory");
#   31|   
#   32|   	return new;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def986]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:30:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#   28|   
#   29|   	if (new == NULL)
#   30|-> 		mmfatal(OUT_OF_MEMORY, "out of memory");
#   31|   
#   32|   	return new;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def987]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:355:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("-1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#  353|   					mmfatal(INDICATOR_NOT_SIMPLE, "indicator for simple data type has to be simple");
#  354|   
#  355|-> 				ECPGdump_a_simple(o, name, type->type, str_varchar_one, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_arr_one, struct_sizeof, prefix, 0);
#  356|   				if (ind_type != NULL)
#  357|   					ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_neg_one, ind_struct_sizeof, ind_prefix, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def988]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:355:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#  353|   					mmfatal(INDICATOR_NOT_SIMPLE, "indicator for simple data type has to be simple");
#  354|   
#  355|-> 				ECPGdump_a_simple(o, name, type->type, str_varchar_one, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_arr_one, struct_sizeof, prefix, 0);
#  356|   				if (ind_type != NULL)
#  357|   					ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_neg_one, ind_struct_sizeof, ind_prefix, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def989]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:376:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("-1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#  374|   					mmfatal(INDICATOR_NOT_SIMPLE, "indicator for simple data type has to be simple");
#  375|   
#  376|-> 				ECPGdump_a_simple(o, name, type->type, NULL, str_neg_one, NULL, prefix, 0);
#  377|   				if (ind_type != NULL)
#  378|   					ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, ind_type_neg_one, NULL, ind_prefix, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def990]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:396:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("-1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#  394|   					mmfatal(INDICATOR_NOT_SIMPLE, "indicator for simple data type has to be simple");
#  395|   
#  396|-> 				ECPGdump_a_simple(o, name, type->type, type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_neg_one, struct_sizeof, prefix, type->counter);
#  397|   				if (ind_type != NULL)
#  398|   					ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : ind_type_neg_one, ind_struct_sizeof, ind_prefix, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def991]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:56: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + <unknown> + 4)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
#  426|   	{
#  427|   		char	   *variable = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 4);
#  428|-> 		char	   *offset = (char *) mm_alloc(strlen(name) + strlen("sizeof(struct varchar_)") + 1 + strlen(varcharsize) + sizeof(int) * CHAR_BIT * 10 / 3);
#  429|   		char	   *struct_name;
#  430|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def992]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:505:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:505:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:505:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/10)
#  503|   				 * we have to use a pointer here
#  504|   				 */
#  505|-> 				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  506|   				sprintf(offset, "sizeof(numeric)");
#  507|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def993]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:506:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:506:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:506:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/10)
#  504|   				 */
#  505|   				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  506|-> 				sprintf(offset, "sizeof(numeric)");
#  507|   				break;
#  508|   			case ECPGt_interval:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def994]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:513:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:513:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:513:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/10)
#  511|   				 * we have to use a pointer here
#  512|   				 */
#  513|-> 				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  514|   				sprintf(offset, "sizeof(interval)");
#  515|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def995]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:514:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:514:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:514:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/10)
#  512|   				 */
#  513|   				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  514|-> 				sprintf(offset, "sizeof(interval)");
#  515|   				break;
#  516|   			case ECPGt_date:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def996]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:521:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:521:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:521:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/10)
#  519|   				 * we have to use a pointer and translate the variable type
#  520|   				 */
#  521|-> 				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  522|   				sprintf(offset, "sizeof(date)");
#  523|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def997]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:522:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:522:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:522:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/10)
#  520|   				 */
#  521|   				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  522|-> 				sprintf(offset, "sizeof(date)");
#  523|   				break;
#  524|   			case ECPGt_timestamp:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def998]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:529:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:529:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:529:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/10)
#  527|   				 * we have to use a pointer and translate the variable type
#  528|   				 */
#  529|-> 				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  530|   				sprintf(offset, "sizeof(timestamp)");
#  531|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def999]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:530:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:530:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:530:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/10)
#  528|   				 */
#  529|   				sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
#  530|-> 				sprintf(offset, "sizeof(timestamp)");
#  531|   				break;
#  532|   			case ECPGt_const:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1000]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:537:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:537:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:537:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/10)
#  535|   				 * just dump the const as string
#  536|   				 */
#  537|-> 				sprintf(variable, "\"%s\"", name);
#  538|   				sprintf(offset, "strlen(\"%s\")", name);
#  539|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1001]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:538:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:411:1: enter_function: entry to ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:423:17: branch_false: following ‘false’ branch (when ‘type != 31’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:58: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:427:49: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_simple’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:428:47: return_function: returning to ‘ECPGdump_a_simple’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:538:33: throw: if ‘pg_sprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:538:33: danger: ‘mm_alloc(strlen(name) + strlen(varcharsize) + 130)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/10)
#  536|   				 */
#  537|   				sprintf(variable, "\"%s\"", name);
#  538|-> 				sprintf(offset, "strlen(\"%s\")", name);
#  539|   				break;
#  540|   			default:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1002]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:46: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_strdup("1")’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#  587|   	struct ECPGstruct_member *p,
#  588|   			   *ind_p = NULL;
#  589|-> 	char	   *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
#  590|   	char	   *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
#  591|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1003]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:50: warning[-Wanalyzer-malloc-leak]: leak of ‘mm_alloc(strlen(name) + <unknown> + 3)’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
#  588|   			   *ind_p = NULL;
#  589|   	char	   *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
#  590|-> 	char	   *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
#  591|   
#  592|   	if (atoi(arrsize) == 1)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1004]
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:50: warning[-Wanalyzer-null-argument]: use of NULL ‘ind_name’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/ecpg/preproc/type.c:614:17: call_function: calling ‘ECPGdump_a_type’ from ‘ECPGdump_a_struct’
#  588|   			   *ind_p = NULL;
#  589|   	char	   *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
#  590|-> 	char	   *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
#  591|   
#  592|   	if (atoi(arrsize) == 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1005]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: warning[-Wanalyzer-malloc-leak]: leak of ‘state’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:106:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:107:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:109:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:116:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: throw: if ‘pg_saslprep’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: danger: ‘state’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  121|   
#  122|   	/* Normalize the password with SASLprep, if possible */
#  123|-> 	rc = pg_saslprep(password, &prep_password);
#  124|   	if (rc == SASLPREP_OOM)
#  125|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1006]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(sasl_mechanism)’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:107:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:109:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:115:33: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:116:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: throw: if ‘pg_saslprep’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:123:14: danger: ‘strdup(sasl_mechanism)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  121|   
#  122|   	/* Normalize the password with SASLprep, if possible */
#  123|-> 	rc = pg_saslprep(password, &prep_password);
#  124|   	if (rc == SASLPREP_OOM)
#  125|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1007]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:437:9: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:358:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:364:23: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:367:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:372:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:374:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:379:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:416:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:419:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:422:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:429:51: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:430:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:433:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:433:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:434:12: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:437:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:437:9: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:437:9: danger: ‘result’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  435|   		goto oom_error;
#  436|   
#  437|-> 	termPQExpBuffer(&buf);
#  438|   	return result;
#  439|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1008]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:738:32: warning[-Wanalyzer-malloc-leak]: leak of ‘decoded_server_signature’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:688:1: enter_function: entry to ‘read_server_final_message’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:696:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:703:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:703:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:720:92: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:719:36: call_function: calling ‘read_attr_value’ from ‘read_server_final_message’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:719:36: return_function: returning to ‘read_server_final_message’ from ‘read_attr_value’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:721:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:727:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:731:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:732:12: branch_false: following ‘false’ branch (when ‘decoded_server_signature’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:739:82: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:738:32: throw: if ‘pg_b64_decode’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth-scram.c:738:32: danger: ‘decoded_server_signature’ leaks here; was allocated at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  736|   	}
#  737|   
#  738|-> 	server_signature_len = pg_b64_decode(encoded_server_signature,
#  739|   										 strlen(encoded_server_signature),
#  740|   										 decoded_server_signature,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1009]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:81:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ginbuf.value’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:71:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:73:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:74:32: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:75:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:81:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:81:21: throw: if ‘pqGetnchar’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:81:21: danger: ‘ginbuf.value’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   79|   			return STATUS_ERROR;
#   80|   		}
#   81|-> 		if (pqGetnchar(ginbuf.value, payloadlen, conn))
#   82|   		{
#   83|   			/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1010]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:645:13: warning[-Wanalyzer-malloc-leak]: leak of ‘challenge’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:637:21: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:638:12: branch_false: following ‘false’ branch (when ‘challenge’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:645:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:645:13: throw: if ‘pqGetnchar’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:645:13: danger: ‘challenge’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  643|   	}
#  644|   
#  645|-> 	if (pqGetnchar(challenge, payloadlen, conn))
#  646|   	{
#  647|   		free(challenge);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1011]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:732:38: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:710:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:716:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:724:45: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:725:36: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:731:33: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:732:38: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:732:38: danger: ‘crypt_pwd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  730|   
#  731|   				crypt_pwd2 = crypt_pwd + MD5_PASSWD_LEN + 1;
#  732|-> 				if (!pg_md5_encrypt(password, conn->pguser,
#  733|   									strlen(conn->pguser), crypt_pwd2,
#  734|   									&errstr))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1012]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1242:14: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1238:21: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1239:12: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1242:14: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1242:14: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1242:14: danger: ‘crypt_pwd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1240|   		return NULL;
# 1241|   
# 1242|-> 	if (!pg_md5_encrypt(passwd, user, strlen(user), crypt_pwd, &errstr))
# 1243|   	{
# 1244|   		free(crypt_pwd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1013]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1355:30: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1283:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1286:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1289:12: branch_false: following ‘false’ branch (when ‘algorithm’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1331:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1338:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1348:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1348:17: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1350:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1350:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1351:20: branch_true: following ‘true’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1353:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1355:30: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-auth.c:1355:30: danger: ‘crypt_pwd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 1353|   			const char *errstr = NULL;
# 1354|   
# 1355|-> 			if (!pg_md5_encrypt(passwd, user, strlen(user), crypt_pwd, &errstr))
# 1356|   			{
# 1357|   				libpq_append_conn_error(conn, "could not encrypt password: %s", errstr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1014]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:374:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:353:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:360:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:363:32: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:372:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:374:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:374:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:374:22: danger: ‘cancel’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  372|   	if (conn->pgtcp_user_timeout != NULL)
#  373|   	{
#  374|-> 		if (!pqParseIntParam(conn->pgtcp_user_timeout,
#  375|   							 &cancel->pgtcp_user_timeout,
#  376|   							 conn, "tcp_user_timeout"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1015]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:381:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:353:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:360:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:363:32: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:372:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:381:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:381:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:381:22: danger: ‘cancel’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  379|   	if (conn->keepalives != NULL)
#  380|   	{
#  381|-> 		if (!pqParseIntParam(conn->keepalives,
#  382|   							 &cancel->keepalives,
#  383|   							 conn, "keepalives"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1016]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:388:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:353:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:360:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:363:32: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:372:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:386:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:386:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:388:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:388:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:388:22: danger: ‘cancel’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  386|   	if (conn->keepalives_idle != NULL)
#  387|   	{
#  388|-> 		if (!pqParseIntParam(conn->keepalives_idle,
#  389|   							 &cancel->keepalives_idle,
#  390|   							 conn, "keepalives_idle"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1017]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:395:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:353:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:360:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:363:32: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:372:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:386:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:386:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:393:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:393:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:395:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:395:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:395:22: danger: ‘cancel’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  393|   	if (conn->keepalives_interval != NULL)
#  394|   	{
#  395|-> 		if (!pqParseIntParam(conn->keepalives_interval,
#  396|   							 &cancel->keepalives_interval,
#  397|   							 conn, "keepalives_interval"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1018]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:402:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:353:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:356:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:359:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:360:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:363:32: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:372:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:379:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:386:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:386:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:393:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:393:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:400:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:400:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:402:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:402:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:402:22: danger: ‘cancel’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  400|   	if (conn->keepalives_count != NULL)
#  401|   	{
#  402|-> 		if (!pqParseIntParam(conn->keepalives_count,
#  403|   							 &cancel->keepalives_count,
#  404|   							 conn, "keepalives_count"))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1019]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:564:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmpsock’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:474:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:486:31: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:486:24: acquire_resource: stream socket created here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:486:12: branch_false: following ‘false’ branch (when ‘tmpsock != -1’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:502:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:564:13: throw: if ‘connect’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-cancel.c:564:13: danger: ‘tmpsock’ leaks here
#  562|   
#  563|   retry3:
#  564|-> 	if (connect(tmpsock, (struct sockaddr *) &cancel->raddr.addr,
#  565|   				cancel->raddr.salen) < 0)
#  566|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1020]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:192:43: warning[-Wanalyzer-malloc-leak]: leak of ‘PQmakeEmptyPGresult(conn, 0)’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:2344:1: enter_function: entry to ‘PQexecStart’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:2369:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
#  190|   		/* copy connection data we might need for operations on PGresult */
#  191|   		result->noticeHooks = conn->noticeHooks;
#  192|-> 		result->client_encoding = conn->client_encoding;
#  193|   
#  194|   		/* consider copying conn's errorMessage */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1021]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:713:31: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:2344:1: enter_function: entry to ‘PQexecStart’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:2369:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
#  711|   		res->errMsg = msg;
#  712|   	else
#  713|-> 		res->errMsg = libpq_gettext("out of memory\n");
#  714|   }
#  715|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1022]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:737:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:2344:1: enter_function: entry to ‘PQexecStart’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-exec.c:2369:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
#  735|   	{
#  736|   		/* only send DESTROY to successfully-initialized event procs */
#  737|-> 		if (res->events[i].resultInitialized)
#  738|   		{
#  739|   			PGEventResultDestroy evt;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1023]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:112:9: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_gbuf.value’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:94:16: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:95:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:106:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:107:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:112:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:112:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-gssapi-common.c:112:9: danger: ‘temp_gbuf.value’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  110|   		return STATUS_ERROR;
#  111|   	}
#  112|-> 	snprintf(temp_gbuf.value, maxlen, "%s@%s",
#  113|   			 conn->krbsrvname, host);
#  114|   	temp_gbuf.length = strlen(temp_gbuf.value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1024]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:897:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:897:15: throw: if ‘PQexec’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:897:15: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  895|   		"where nspname = 'pg_catalog')";
#  896|   
#  897|-> 	res = PQexec(conn, query);
#  898|   	if (res == NULL)
#  899|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1025]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:25: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:25: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  913|   	 * Examine the result and put the OID's into the struct
#  914|   	 */
#  915|-> 	for (n = 0; n < PQntuples(res); n++)
#  916|   	{
#  917|   		fname = PQgetvalue(res, n, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1026]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:917:25: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:917:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:917:25: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  915|   	for (n = 0; n < PQntuples(res); n++)
#  916|   	{
#  917|-> 		fname = PQgetvalue(res, n, 0);
#  918|   		foid = (Oid) atoi(PQgetvalue(res, n, 1));
#  919|   		if (strcmp(fname, "lo_open") == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1027]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:918:35: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:918:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:918:35: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  916|   	{
#  917|   		fname = PQgetvalue(res, n, 0);
#  918|-> 		foid = (Oid) atoi(PQgetvalue(res, n, 1));
#  919|   		if (strcmp(fname, "lo_open") == 0)
#  920|   			lobjfuncs->fn_lo_open = foid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1028]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:947:9: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:947:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:947:9: throw: if ‘PQclear’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:947:9: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  945|   	}
#  946|   
#  947|-> 	PQclear(res);
#  948|   
#  949|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1029]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:956:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:947:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:954:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:956:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:956:17: throw: if ‘libpq_append_conn_error’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:956:17: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  954|   	if (lobjfuncs->fn_lo_open == 0)
#  955|   	{
#  956|-> 		libpq_append_conn_error(conn, "cannot determine OID of function %s",
#  957|   								"lo_open");
#  958|   		free(lobjfuncs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1030]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:963:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:919:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:920:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:954:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:961:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:961:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:963:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:963:17: throw: if ‘libpq_append_conn_error’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-lobj.c:963:17: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  961|   	if (lobjfuncs->fn_lo_close == 0)
#  962|   	{
#  963|-> 		libpq_append_conn_error(conn, "cannot determine OID of function %s",
#  964|   								"lo_close");
#  965|   		free(lobjfuncs);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1031]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1344:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1336:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1343:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1344:24: throw: if ‘appendPQExpBufferVA’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1344:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1342|   		errno = save_errno;
# 1343|   		va_start(args, fmt);
# 1344|-> 		done = appendPQExpBufferVA(errorMessage, libpq_gettext(fmt), args);
# 1345|   		va_end(args);
# 1346|   	} while (!done);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1032]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1373:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1365:13: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1365:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1372:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1373:24: throw: if ‘appendPQExpBufferVA’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-misc.c:1373:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1371|   		errno = save_errno;
# 1372|   		va_start(args, fmt);
# 1373|-> 		done = appendPQExpBufferVA(&conn->errorMessage, libpq_gettext(fmt), args);
# 1374|   		va_end(args);
# 1375|   	} while (!done);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1033]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1034]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1035]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:25: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1036]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1037]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1038]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:113:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1039]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  122|   			int			len;
#  123|   			const char *s = (j < numFieldName && po->fieldName[j][0]) ?
#  124|-> 				po->fieldName[j] : PQfname(res, j);
#  125|   
#  126|   			fieldNames[j] = s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1040]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  122|   			int			len;
#  123|   			const char *s = (j < numFieldName && po->fieldName[j][0]) ?
#  124|-> 				po->fieldName[j] : PQfname(res, j);
#  125|   
#  126|   			fieldNames[j] = s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1041]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:124:52: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  122|   			int			len;
#  123|   			const char *s = (j < numFieldName && po->fieldName[j][0]) ?
#  124|-> 				po->fieldName[j] : PQfname(res, j);
#  125|   
#  126|   			fieldNames[j] = s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1042]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  178|   				  )))
#  179|   			{
#  180|-> 				fflush(NULL);
#  181|   				fout = popen(pagerenv, "w");
#  182|   				if (fout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1043]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  178|   				  )))
#  179|   			{
#  180|-> 				fflush(NULL);
#  181|   				fout = popen(pagerenv, "w");
#  182|   				if (fout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1044]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:180:33: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  178|   				  )))
#  179|   			{
#  180|-> 				fflush(NULL);
#  181|   				fout = popen(pagerenv, "w");
#  182|   				if (fout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1045]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: throw: if ‘popen’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  179|   			{
#  180|   				fflush(NULL);
#  181|-> 				fout = popen(pagerenv, "w");
#  182|   				if (fout)
#  183|   				{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1046]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: throw: if ‘popen’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  179|   			{
#  180|   				fflush(NULL);
#  181|-> 				fout = popen(pagerenv, "w");
#  182|   				if (fout)
#  183|   				{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1047]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: throw: if ‘popen’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  179|   			{
#  180|   				fflush(NULL);
#  181|-> 				fout = popen(pagerenv, "w");
#  182|   				if (fout)
#  183|   				{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1048]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1049]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1050]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1051]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(pagerenv, "w")’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: danger: ‘popen(pagerenv, "w")’ leaks here; was allocated at [(27)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/26)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1052]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1053]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1054]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1055]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/26)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1056]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1057]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1058]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1059]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/26)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1060]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1061]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1062]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1063]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/26)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1064]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1065]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1066]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1067]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/26)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1068]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1069]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1070]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1071]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/26)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1072]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1073]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1074]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1075]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/26)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1076]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/2)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1077]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/2)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1078]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/2)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1079]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fields’ leaks here; was allocated at [(15)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/14)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1080]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/26)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1081]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/2)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1082]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/2)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1083]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/2)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1084]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fields’ leaks here; was allocated at [(15)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/14)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1085]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/26)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1086]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/2)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1087]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/2)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1088]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/2)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1089]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fields’ leaks here; was allocated at [(15)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/14)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1090]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/26)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1091]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:318:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:303:20: branch_false: following ‘false’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:312:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:313:20: branch_true: following ‘true’ branch (when ‘usePipe != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:318:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:318:25: throw: if ‘pclose’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:318:25: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/26)
#  316|   			_pclose(fout);
#  317|   #else
#  318|-> 			pclose(fout);
#  319|   
#  320|   			/* we can't easily verify if EPIPE occurred, so say it did */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1092]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1093]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1094]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1095]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1096]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1097]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1098]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1099]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1100]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1101]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1102]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1103]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1104]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1105]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1106]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1107]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1108]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1109]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1110]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1111]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1112]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1113]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1114]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1115]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1116]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:493:25: warning[-Wanalyzer-malloc-leak]: leak of ‘border’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:452:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:452:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:464:26: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:465:20: branch_false: following ‘false’ branch (when ‘border’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:471:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:471:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:473:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:475:32: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:476:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:492:20: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:493:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:493:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:493:25: danger: ‘border’ leaks here; was allocated at [(3)](sarif:/runs/0/results/95/codeFlows/0/threadFlows/0/locations/2)
#  491|   		*p = '\0';
#  492|   		if (po->standard)
#  493|-> 			fprintf(fout, "%s\n", border);
#  494|   	}
#  495|   	if (po->standard)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1117]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/96/codeFlows/0/threadFlows/0/locations/2)
#  611|   		for (j = 0; j < nFields; j++)
#  612|   		{
#  613|-> 			fLength[j] = strlen(PQfname(res, j));
#  614|   			for (i = 0; i < nTuples; i++)
#  615|   			{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1118]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:616:64: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:614:37: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:616:64: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:616:64: throw: if ‘PQgetlength’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:616:64: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/97/codeFlows/0/threadFlows/0/locations/2)
#  614|   			for (i = 0; i < nTuples; i++)
#  615|   			{
#  616|-> 				int			flen = PQgetlength(res, i, j);
#  617|   
#  618|   				if (flen > fLength[j])

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1119]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:629:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:627:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:629:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:629:31: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:629:31: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/98/codeFlows/0/threadFlows/0/locations/2)
#  627|   		for (i = 0; i < nFields; i++)
#  628|   		{
#  629|-> 			fputs(PQfname(res, i), fp);
#  630|   			if (fillAlign)
#  631|   				fill(strlen(PQfname(res, i)), fLength[i], ' ', fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1120]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:631:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:627:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:629:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:630:28: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:631:70: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:631:45: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:631:45: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/99/codeFlows/0/threadFlows/0/locations/2)
#  629|   			fputs(PQfname(res, i), fp);
#  630|   			if (fillAlign)
#  631|-> 				fill(strlen(PQfname(res, i)), fLength[i], ' ', fp);
#  632|   			fputs(fieldSep, fp);
#  633|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1121]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:634:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:627:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:634:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:634:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:634:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/100/codeFlows/0/threadFlows/0/locations/2)
#  632|   			fputs(fieldSep, fp);
#  633|   		}
#  634|-> 		fprintf(fp, "\n");
#  635|   
#  636|   		/* Underline the attribute names */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1122]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:643:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:627:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:634:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:637:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:643:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:643:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:643:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/101/codeFlows/0/threadFlows/0/locations/2)
#  641|   			fputs(fieldSep, fp);
#  642|   		}
#  643|-> 		fprintf(fp, "\n");
#  644|   	}
#  645|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1123]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:651:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:618:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:619:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:611:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:647:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:647:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:649:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:651:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:651:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:651:25: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/102/codeFlows/0/threadFlows/0/locations/2)
#  649|   		for (j = 0; j < nFields; j++)
#  650|   		{
#  651|-> 			fprintf(fp, "%s", PQgetvalue(res, i, j));
#  652|   			if (fillAlign)
#  653|   				fill(strlen(PQgetvalue(res, i, j)), fLength[j], ' ', fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1124]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:653:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:618:36: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:619:41: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:611:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:624:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:647:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:647:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:649:29: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:651:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:652:28: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:653:76: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:653:45: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:653:45: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/104/codeFlows/0/threadFlows/0/locations/2)
#  651|   			fprintf(fp, "%s", PQgetvalue(res, i, j));
#  652|   			if (fillAlign)
#  653|-> 				fill(strlen(PQgetvalue(res, i, j)), fLength[j], ' ', fp);
#  654|   			fputs(fieldSep, fp);
#  655|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1125]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:656:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:647:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:647:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:649:29: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:656:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:656:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:656:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/105/codeFlows/0/threadFlows/0/locations/2)
#  654|   			fputs(fieldSep, fp);
#  655|   		}
#  656|-> 		fprintf(fp, "\n");
#  657|   	}
#  658|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1126]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:660:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:659:12: branch_true: following ‘true’ branch (when ‘quiet == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:661:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:660:17: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:660:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/106/codeFlows/0/threadFlows/0/locations/2)
#  658|   
#  659|   	if (!quiet)
#  660|-> 		fprintf(fp, "\nQuery returned %d row%s.\n", PQntuples(res),
#  661|   				(PQntuples(res) == 1) ? "" : "s");
#  662|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1127]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:661:34: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:659:12: branch_true: following ‘true’ branch (when ‘quiet == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:661:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:661:34: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:661:34: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/108/codeFlows/0/threadFlows/0/locations/2)
#  659|   	if (!quiet)
#  660|   		fprintf(fp, "\nQuery returned %d row%s.\n", PQntuples(res),
#  661|-> 				(PQntuples(res) == 1) ? "" : "s");
#  662|   
#  663|   	fflush(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1128]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:663:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:663:9: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:663:9: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/109/codeFlows/0/threadFlows/0/locations/2)
#  661|   				(PQntuples(res) == 1) ? "" : "s");
#  662|   
#  663|-> 	fflush(fp);
#  664|   
#  665|   	free(fLength);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1129]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:710:25: warning[-Wanalyzer-malloc-leak]: leak of ‘tborder’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:693:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:696:20: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:696:20: branch_true: following ‘true’ branch (when ‘TerseOutput == 0’)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:700:25: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:701:44: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:702:28: branch_false: following ‘false’ branch (when ‘tborder’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:702:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:710:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-print.c:710:25: danger: ‘tborder’ leaks here; was allocated at [(5)](sarif:/runs/0/results/110/codeFlows/0/threadFlows/0/locations/4)
#  708|   				tborder[i] = '-';
#  709|   			tborder[width] = '\0';
#  710|-> 			fprintf(fout, "%s\n", tborder);
#  711|   		}
#  712|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1130]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1241:24: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1239|   
# 1240|   	/* We can optimize a bit if it's a single-byte encoding */
# 1241|-> 	mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1242|   
# 1243|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1131]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1241:24: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1239|   
# 1240|   	/* We can optimize a bit if it's a single-byte encoding */
# 1241|-> 	mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1242|   
# 1243|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1132]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1241:24: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1239|   
# 1240|   	/* We can optimize a bit if it's a single-byte encoding */
# 1241|-> 	mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1242|   
# 1243|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1133]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1302:29: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1300|   			int			w;
# 1301|   
# 1302|-> 			w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1303|   			/* treat any non-tab control chars as width 1 */
# 1304|   			if (w <= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1134]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1302:29: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1300|   			int			w;
# 1301|   
# 1302|-> 			w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1303|   			/* treat any non-tab control chars as width 1 */
# 1304|   			if (w <= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1135]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1302:29: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1300|   			int			w;
# 1301|   
# 1302|-> 			w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1303|   			/* treat any non-tab control chars as width 1 */
# 1304|   			if (w <= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1136]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1307:36: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1305|   				w = 1;
# 1306|   			scroffset += w;
# 1307|-> 			qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1308|   		}
# 1309|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1137]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1307:36: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1305|   				w = 1;
# 1306|   			scroffset += w;
# 1307|-> 			qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1308|   		}
# 1309|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1138]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1307:36: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1642:1: enter_function: entry to ‘getCopyDataMessage’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1658:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1660:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1665:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1666:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1693:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1700:37: call_function: calling ‘pqGetErrorNotice3’ from ‘getCopyDataMessage’
# 1305|   				w = 1;
# 1306|   			scroffset += w;
# 1307|-> 			qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1308|   		}
# 1309|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1139]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1514:13: warning[-Wanalyzer-malloc-leak]: leak of ‘svname’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1506:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1508:20: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1508:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1511:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1511:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1512:12: branch_false: following ‘false’ branch (when ‘svname’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1514:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1514:13: throw: if ‘pqGets’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:1514:13: danger: ‘svname’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 1512|   	if (!svname)
# 1513|   		return EOF;
# 1514|-> 	if (pqGets(&conn->workBuffer, conn))
# 1515|   	{
# 1516|   		free(svname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1140]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2312:29: warning[-Wanalyzer-malloc-leak]: leak of ‘startpacket’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2237:1: enter_function: entry to ‘pqBuildStartupPacket3’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2242:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2242:22: return_function: returning to ‘pqBuildStartupPacket3’ from ‘build_startup_packet’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2243:32: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2244:12: branch_false: following ‘false’ branch (when ‘startpacket’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2246:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2246:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
# 2310|   		if ((val = getenv(next_eo->envName)) != NULL)
# 2311|   		{
# 2312|-> 			if (pg_strcasecmp(val, "default") != 0)
# 2313|   				ADD_STARTUP_OPTION(next_eo->pgName, val);
# 2314|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1141]
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/pqexpbuffer.c:308:28: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/pqexpbuffer.c:265:1: enter_function: entry to ‘appendPQExpBuffer’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/pqexpbuffer.c:271:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/pqexpbuffer.c:278:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/pqexpbuffer.c:279:24: call_function: calling ‘appendPQExpBufferVA’ from ‘appendPQExpBuffer’
#  306|   		avail = str->maxlen - str->len;
#  307|   
#  308|-> 		nprinted = vsnprintf(str->data + str->len, avail, fmt, args);
#  309|   
#  310|   		/*

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1142]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1298:45: warning[-Wanalyzer-null-argument]: use of NULL ‘colname’ where non-null expected
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1175:1: enter_function: entry to ‘resolve_column_ref’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1206:17: call_function: inlined call to ‘list_length’ from ‘resolve_column_ref’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1272:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1275:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1282:28: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1284:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1284:28: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1287:68: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1292:40: branch_true: following ‘true’ branch (when ‘i >= 0’)...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1294:100: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1298:45: danger: argument 2 (‘colname’) NULL where non-null expected
# 1296|   					Assert(fld->dtype == PLPGSQL_DTYPE_RECFIELD &&
# 1297|   						   fld->recparentno == nse->itemno);
# 1298|-> 					if (strcmp(fld->fieldname, colname) == 0)
# 1299|   					{
# 1300|   						return make_datum_param(expr, i, cref->location);

Error: CPPCHECK_WARNING (CWE-768): [#def1143]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1448: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1446|   	int			nnames;
# 1447|   
# 1448|-> 	idents = list_make2(makeString(word1),
# 1449|   						makeString(word2));
# 1450|   

Error: CPPCHECK_WARNING (CWE-768): [#def1144]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1565: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1563|   							 */
# 1564|   							new = plpgsql_build_recfield(rec, word2);
# 1565|-> 							idents = list_make2(makeString(word1),
# 1566|   												makeString(word2));
# 1567|   						}

Error: CPPCHECK_WARNING (CWE-768): [#def1145]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1572: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1570|   							/* Block-qualified reference to record variable. */
# 1571|   							new = plpgsql_build_recfield(rec, word3);
# 1572|-> 							idents = list_make3(makeString(word1),
# 1573|   												makeString(word2),
# 1574|   												makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def1146]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1572: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))},(union ListCell){.ptr_value=(makeString(word3))}' depends on order of evaluation of side effects
# 1570|   							/* Block-qualified reference to record variable. */
# 1571|   							new = plpgsql_build_recfield(rec, word3);
# 1572|-> 							idents = list_make3(makeString(word1),
# 1573|   												makeString(word2),
# 1574|   												makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def1147]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1590: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1588|   
# 1589|   	/* Nothing found */
# 1590|-> 	idents = list_make3(makeString(word1),
# 1591|   						makeString(word2),
# 1592|   						makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def1148]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_comp.c:1590: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))},(union ListCell){.ptr_value=(makeString(word3))}' depends on order of evaluation of side effects
# 1588|   
# 1589|   	/* Nothing found */
# 1590|-> 	idents = list_make3(makeString(word1),
# 1591|   						makeString(word2),
# 1592|   						makeString(word3));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1149]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1865:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1820:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1826:34: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1852:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1854:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1863:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1863:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1865:9: danger: use of uninitialized value ‘yyss’ here
# 1863|           if (! yyptr)
# 1864|             YYNOMEM;
# 1865|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1866|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1867|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1150]
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1996:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1820:6: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1889:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1889:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1892:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1904:6: branch_true: following ‘true’ branch (when ‘yyn == -249’)...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1905:5: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1976:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1978:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/pl/plpgsql/src/pl_gram.c:1996:3: danger: use of uninitialized value ‘*<unknown>’ here
# 1994|        unconditionally makes the parser a bit smaller, and it avoids a
# 1995|        GCC warning that YYVAL may be used uninitialized.  */
# 1996|->   yyval = yyvsp[1-yylen];
# 1997|   
# 1998|     /* Default location. */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1151]
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:478:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:477:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:478:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:478:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  476|   
#  477|   	va_start(ap, fmt);
#  478|-> 	vsnprintf(buf, sizeof(buf), dgettext(TEXTDOMAIN, fmt), ap);
#  479|   	va_end(ap);
#  480|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1152]
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:494:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:493:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:494:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/pl/plpython/plpy_elog.c:494:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  492|   
#  493|   	va_start(ap, n);
#  494|-> 	vsnprintf(buf, sizeof(buf),
#  495|   			  dngettext(TEXTDOMAIN, fmt_singular, fmt_plural, n),
#  496|   			  ap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1153]
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:21: warning[-Wanalyzer-malloc-leak]: leak of ‘sys’
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:312:12: branch_false: following ‘false’ branch (when ‘ctype’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:351:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:352:20: branch_false: following ‘false’ branch (when ‘ctype’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:357:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:361:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:362:20: branch_true: following ‘true’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:363:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:363:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:369:12: branch_false: following ‘false’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:369:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:21: throw: if ‘pg_strcasecmp’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:21: danger: ‘sys’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  373|   	for (i = 0; encoding_match_list[i].system_enc_name; i++)
#  374|   	{
#  375|-> 		if (pg_strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0)
#  376|   		{
#  377|   			free(sys);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1154]
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:404:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sys’
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:312:12: branch_false: following ‘false’ branch (when ‘ctype’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:351:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:352:20: branch_false: following ‘false’ branch (when ‘ctype’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:357:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:361:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:362:20: branch_true: following ‘true’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:363:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:363:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:369:12: branch_false: following ‘false’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:369:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:61: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:61: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:401:12: branch_true: following ‘true’ branch (when ‘write_message != 0’)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:404:33: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:404:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:404:17: danger: ‘sys’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  402|   	{
#  403|   #ifdef FRONTEND
#  404|-> 		fprintf(stderr, _("could not determine encoding for locale \"%s\": codeset is \"%s\""),
#  405|   				ctype, sys);
#  406|   		/* keep newline separate so there's only one translatable string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1155]
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:409:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sys’
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:312:12: branch_false: following ‘false’ branch (when ‘ctype’ is NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:351:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:352:20: branch_false: following ‘false’ branch (when ‘ctype’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:357:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:356:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:361:23: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:362:20: branch_true: following ‘true’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:363:31: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:363:31: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:369:12: branch_false: following ‘false’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:369:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:21: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:21: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:61: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:375:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:373:61: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:401:12: branch_true: following ‘true’ branch (when ‘write_message != 0’)...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:409:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:409:17: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/port/chklocale.c:409:17: danger: ‘sys’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  407|   		fputc('\n', stderr);
#  408|   #else
#  409|-> 		ereport(WARNING,
#  410|   				(errmsg("could not determine encoding for locale \"%s\": codeset is \"%s\"",
#  411|   						ctype, sys)));

Error: COMPILER_WARNING: [#def1156]
postgresql-18beta1/postgresql-17.2/src/port/pg_crc32c_sse42.c:38:32: note[note]: called from here
#   36|   	while (p + 8 <= pend)
#   37|   	{
#   38|-> 		crc = (uint32) _mm_crc32_u64(crc, *((const uint64 *) p));
#   39|   		p += 8;
#   40|   	}

Error: COMPILER_WARNING: [#def1157]
postgresql-18beta1/postgresql-17.2/src/port/pg_crc32c_sse42.c:45:23: note[note]: called from here
#   43|   	if (p + 4 <= pend)
#   44|   	{
#   45|-> 		crc = _mm_crc32_u32(crc, *((const unsigned int *) p));
#   46|   		p += 4;
#   47|   	}

Error: COMPILER_WARNING: [#def1158]
postgresql-18beta1/postgresql-17.2/src/port/pg_crc32c_sse42.c:64:23: note[note]: called from here
#   62|   	while (p < pend)
#   63|   	{
#   64|-> 		crc = _mm_crc32_u8(crc, *p);
#   65|   		p++;
#   66|   	}

Error: COMPILER_WARNING: [#def1159]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:35:25: warning[-Wpsabi]: AVX512F vector return without AVX512F enabled changes the ABI
#   33|   	__m512i		val,
#   34|   				cnt;
#   35|-> 	__m512i		accum = _mm512_setzero_si512();
#   36|   	const char *final;
#   37|   	int			tail_idx;

Error: COMPILER_WARNING: [#def1160]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:35:33: note[note]: called from here
#   33|   	__m512i		val,
#   34|   				cnt;
#   35|-> 	__m512i		accum = _mm512_setzero_si512();
#   36|   	const char *final;
#   37|   	int			tail_idx;

Error: COMPILER_WARNING: [#def1161]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:56:23: note[note]: called from here
#   54|   	if (buf < final)
#   55|   	{
#   56|-> 		val = _mm512_maskz_loadu_epi8(mask, (const __m512i *) buf);
#   57|   		cnt = _mm512_popcnt_epi64(val);
#   58|   		accum = _mm512_add_epi64(accum, cnt);

Error: COMPILER_WARNING: [#def1162]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:57:23: note[note]: called from here
#   55|   	{
#   56|   		val = _mm512_maskz_loadu_epi8(mask, (const __m512i *) buf);
#   57|-> 		cnt = _mm512_popcnt_epi64(val);
#   58|   		accum = _mm512_add_epi64(accum, cnt);
#   59|   

Error: COMPILER_WARNING: [#def1163]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:58:25: note[note]: called from here
#   56|   		val = _mm512_maskz_loadu_epi8(mask, (const __m512i *) buf);
#   57|   		cnt = _mm512_popcnt_epi64(val);
#   58|-> 		accum = _mm512_add_epi64(accum, cnt);
#   59|   
#   60|   		buf += sizeof(__m512i);

Error: COMPILER_WARNING: [#def1164]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:65:31: note[note]: called from here
#   63|   		for (; buf < final; buf += sizeof(__m512i))
#   64|   		{
#   65|-> 			val = _mm512_load_si512((const __m512i *) buf);
#   66|   			cnt = _mm512_popcnt_epi64(val);
#   67|   			accum = _mm512_add_epi64(accum, cnt);

Error: COMPILER_WARNING: [#def1165]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:66:31: note[note]: called from here
#   64|   		{
#   65|   			val = _mm512_load_si512((const __m512i *) buf);
#   66|-> 			cnt = _mm512_popcnt_epi64(val);
#   67|   			accum = _mm512_add_epi64(accum, cnt);
#   68|   		}

Error: COMPILER_WARNING: [#def1166]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:67:33: note[note]: called from here
#   65|   			val = _mm512_load_si512((const __m512i *) buf);
#   66|   			cnt = _mm512_popcnt_epi64(val);
#   67|-> 			accum = _mm512_add_epi64(accum, cnt);
#   68|   		}
#   69|   	}

Error: COMPILER_WARNING: [#def1167]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:74:15: note[note]: called from here
#   72|   	mask &= (~UINT64CONST(0) >> (sizeof(__m512i) - tail_idx));
#   73|   
#   74|-> 	val = _mm512_maskz_loadu_epi8(mask, (const __m512i *) buf);
#   75|   	cnt = _mm512_popcnt_epi64(val);
#   76|   	accum = _mm512_add_epi64(accum, cnt);

Error: COMPILER_WARNING: [#def1168]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:75:15: note[note]: called from here
#   73|   
#   74|   	val = _mm512_maskz_loadu_epi8(mask, (const __m512i *) buf);
#   75|-> 	cnt = _mm512_popcnt_epi64(val);
#   76|   	accum = _mm512_add_epi64(accum, cnt);
#   77|   

Error: COMPILER_WARNING: [#def1169]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:76:17: note[note]: called from here
#   74|   	val = _mm512_maskz_loadu_epi8(mask, (const __m512i *) buf);
#   75|   	cnt = _mm512_popcnt_epi64(val);
#   76|-> 	accum = _mm512_add_epi64(accum, cnt);
#   77|   
#   78|   	return _mm512_reduce_add_epi64(accum);

Error: COMPILER_WARNING: [#def1170]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512.c:78:16: note[note]: called from here
#   76|   	accum = _mm512_add_epi64(accum, cnt);
#   77|   
#   78|-> 	return _mm512_reduce_add_epi64(accum);
#   79|   }
#   80|   

Error: COMPILER_WARNING: [#def1171]
postgresql-18beta1/postgresql-17.2/src/port/pg_popcount_avx512_choose.c:64:17: note[note]: called from here
#   62|   {
#   63|   #ifdef HAVE_XSAVE_INTRINSICS
#   64|-> 	return (_xgetbv(0) & 0xe6) == 0xe6;
#   65|   #else
#   66|   	return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1172]
postgresql-18beta1/postgresql-17.2/src/port/pgcheckdir.c:46:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
postgresql-18beta1/postgresql-17.2/src/port/pgcheckdir.c:42:18: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/port/pgcheckdir.c:43:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/port/pgcheckdir.c:43:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/port/pgcheckdir.c:46:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/port/pgcheckdir.c:46:35: danger: ‘opendir(dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   44|   		return (errno == ENOENT) ? 0 : -1;
#   45|   
#   46|-> 	while (errno = 0, (file = readdir(chkdir)) != NULL)
#   47|   	{
#   48|   		if (strcmp(".", file->d_name) == 0 ||

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1173]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1002:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:960:6: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:966:28: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:989:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:991:7: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1000:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1002:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1002:9: danger: use of uninitialized value ‘yyss’ here
# 1000|           if (! yyptr)
# 1001|             YYNOMEM;
# 1002|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1003|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1004|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1174]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1129:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:960:6: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1024:6: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1024:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1027:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1039:6: branch_true: following ‘true’ branch (when ‘yyn == -14’)...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1040:5: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1109:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1111:3: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specparse.c:1129:3: danger: use of uninitialized value ‘*<unknown>’ here
# 1127|        unconditionally makes the parser a bit smaller, and it avoids a
# 1128|        GCC warning that YYVAL may be used uninitialized.  */
# 1129|->   yyval = yyvsp[1-yylen];
# 1130|   
# 1131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1175]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1727:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1714:21: enter_function: entry to ‘spec_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1718:24: call_function: inlined call to ‘spec_yyalloc’ from ‘spec_yy_create_buffer’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1719:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1722:2: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1727:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1725|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1726|   	 * we need to put in 2 end-of-buffer characters.
# 1727|-> 	 */
# 1728|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1729|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def1176]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1768: warning[nullPointer]: Possible null pointer dereference: b
# 1766|       
# 1767|   	yy_flush_buffer( b );
# 1768|-> 
# 1769|   	b->yy_input_file = file;
# 1770|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1177]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1769: warning[nullPointer]: Possible null pointer dereference: b
# 1767|   	yy_flush_buffer( b );
# 1768|   
# 1769|-> 	b->yy_input_file = file;
# 1770|   	b->yy_fill_buffer = 1;
# 1771|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1178]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1930:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1916:17: enter_function: entry to ‘spec_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1926:24: call_function: inlined call to ‘spec_yyalloc’ from ‘spec_yy_scan_buffer’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1927:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1930:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1940:2: call_function: calling ‘spec_yy_switch_to_buffer’ from ‘spec_yy_scan_buffer’
# 1928|   	if ( ! b )
# 1929|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 1930|-> 
# 1931|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 1932|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1179]
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1982:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1966:17: enter_function: entry to ‘spec_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1975:24: call_function: inlined call to ‘spec_yyalloc’ from ‘spec_yy_scan_bytes’
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1976:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1976:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/isolation/specscanner.c:1984:6: call_function: calling ‘spec_yy_scan_buffer’ from ‘spec_yy_scan_bytes’
# 1980|   	for ( i = 0; i < _yybytes_len; ++i )
# 1981|   		buf[i] = yybytes[i];
# 1982|-> 
# 1983|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1984|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1180]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:386:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1281:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1289:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  384|   		|| (type == NOTE_DETAIL && !in_note))
#  385|   	{
#  386|-> 		fprintf(fp, "# ");
#  387|   		if (logfile)
#  388|   			fprintf(logfile, "# ");

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1181]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:388:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1281:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1289:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  386|   		fprintf(fp, "# ");
#  387|   		if (logfile)
#  388|-> 			fprintf(logfile, "# ");
#  389|   	}
#  390|   	errno = save_errno;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1182]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:391:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1281:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1289:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  389|   	}
#  390|   	errno = save_errno;
#  391|-> 	vfprintf(fp, fmt, argp);
#  392|   	if (logfile)
#  393|   	{

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1183]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:395:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1281:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1289:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  393|   	{
#  394|   		errno = save_errno;
#  395|-> 		vfprintf(logfile, fmt, argp_logfile);
#  396|   	}
#  397|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1184]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:412:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1326:1: enter_function: entry to ‘make_directory’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1329:17: call_function: calling ‘bail_out’ from ‘make_directory’
#  410|   	if (type == BAIL)
#  411|   	{
#  412|-> 		fprintf(stdout, "Bail out!");
#  413|   		if (logfile)
#  414|   			fprintf(logfile, "Bail out!");

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1185]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:414:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1911:1: enter_function: entry to ‘open_result_files’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1917:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1921:9: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1924:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1925:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1925:17: call_function: calling ‘bail_out’ from ‘open_result_files’
#  412|   		fprintf(stdout, "Bail out!");
#  413|   		if (logfile)
#  414|-> 			fprintf(logfile, "Bail out!");
#  415|   	}
#  416|   

Error: COMPILER_WARNING (CWE-704): [#def1186]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c: scope_hint: In function ‘get_expectfile’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:698:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  698 |         if (!file || !(file_type = strrchr(file, '.')))
#      |                                  ^
#  696|   	 * following the last dot in the file name.
#  697|   	 */
#  698|-> 	if (!file || !(file_type = strrchr(file, '.')))
#  699|   		return NULL;
#  700|   

Error: COMPILER_WARNING (CWE-704): [#def1187]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:698:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  696|   	 * following the last dot in the file name.
#  697|   	 */
#  698|-> 	if (!file || !(file_type = strrchr(file, '.')))
#  699|   		return NULL;
#  700|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1188]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1143:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1142:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1143:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1143:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1141|   
# 1142|   		va_start(args, query);
# 1143|-> 		needed = appendStringInfoVA(&cmdbuf, query, args);
# 1144|   		va_end(args);
# 1145|   		if (needed == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1189]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1264:25: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1266:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: throw: if ‘fseek’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1269|   		return -1;
# 1270|   	}
# 1271|-> 	fseek(f, 0, SEEK_END);
# 1272|   	r = ftell(f);
# 1273|   	fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1190]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1264:25: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1266:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: throw: if ‘fseek’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1269|   		return -1;
# 1270|   	}
# 1271|-> 	fseek(f, 0, SEEK_END);
# 1272|   	r = ftell(f);
# 1273|   	fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1191]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1272:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1264:25: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1266:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1272:13: throw: if ‘ftell’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1272:13: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1270|   	}
# 1271|   	fseek(f, 0, SEEK_END);
# 1272|-> 	r = ftell(f);
# 1273|   	fclose(f);
# 1274|   	return r;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1192]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1272:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1264:25: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1266:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1271:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1272:13: throw: if ‘ftell’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1272:13: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 1270|   	}
# 1271|   	fseek(f, 0, SEEK_END);
# 1272|-> 	r = ftell(f);
# 1273|   	fclose(f);
# 1274|   	return r;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1193]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1292:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1285:25: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1287:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1287:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1292:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1292:21: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1290|   		return -1;
# 1291|   	}
# 1292|-> 	while ((c = fgetc(f)) != EOF)
# 1293|   	{
# 1294|   		if (c == '\n')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1194]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1292:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1285:25: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1287:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1287:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1292:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1292:21: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 1290|   		return -1;
# 1291|   	}
# 1292|-> 	while ((c = fgetc(f)) != EOF)
# 1293|   	{
# 1294|   		if (c == '\n')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1195]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1361:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1343:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1346:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1346:28: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1346:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1352:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1354:12: branch_false: following ‘false’ branch (when ‘last_dot’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1360:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1361:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1361:9: danger: ‘s’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1359|   	}
# 1360|   	*last_dot = '\0';
# 1361|-> 	snprintf(s, ssize, "%s_%d.%s", tmp, i, last_dot + 1);
# 1362|   	free(tmp);
# 1363|   	return s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1196]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1361:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1343:30: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1343:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1346:28: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1346:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1352:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1354:12: branch_false: following ‘false’ branch (when ‘last_dot’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1360:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1361:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1361:9: danger: ‘tmp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
# 1359|   	}
# 1360|   	*last_dot = '\0';
# 1361|-> 	snprintf(s, ssize, "%s_%d.%s", tmp, i, last_dot + 1);
# 1362|   	free(tmp);
# 1363|   	return s;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1197]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1678:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(schedule, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1659:15: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1660:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1660:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1663:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1671:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1678:21: danger: ‘fopen(schedule, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 1676|   			scbuf[--i] = '\0';
# 1677|   
# 1678|-> 		if (scbuf[0] == '\0' || scbuf[0] == '#')
# 1679|   			continue;
# 1680|   		if (strncmp(scbuf, "test: ", 6) == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1198]
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1678:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(schedule, "r")’
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1659:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1660:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1660:12: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1663:16: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1671:17: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/test/regress/pg_regress.c:1678:21: danger: ‘fopen(schedule, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 1676|   			scbuf[--i] = '\0';
# 1677|   
# 1678|-> 		if (scbuf[0] == '\0' || scbuf[0] == '#')
# 1679|   			continue;
# 1680|   		if (strncmp(scbuf, "test: ", 6) == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1199]
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:233:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  231|   		++name;
#  232|   
#  233|-> 	fid = pg_open_tzfile(name, canonname);
#  234|   	if (fid < 0)
#  235|   		return ENOENT;			/* pg_open_tzfile may not set errno */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1200]
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  240|   		int			err = nread < 0 ? errno : EINVAL;
#  241|   
#  242|-> 		close(fid);
#  243|   		return err;
#  244|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1201]
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:245:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/postgresql-17.2/src/timezone/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  243|   		return err;
#  244|   	}
#  245|-> 	if (close(fid) < 0)
#  246|   		return errno;
#  247|   	for (stored = 4; stored <= 8; stored *= 2)

Error: COMPILER_WARNING: [#def1202]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:15:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_transaction__start_semaphore’
#   15 | __extension__ unsigned short postgresql_transaction__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1203]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:24:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_transaction__commit_semaphore’
#   24 | __extension__ unsigned short postgresql_transaction__commit_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1204]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:33:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_transaction__abort_semaphore’
#   33 | __extension__ unsigned short postgresql_transaction__abort_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1205]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:42:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__acquire_semaphore’
#   42 | __extension__ unsigned short postgresql_lwlock__acquire_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1206]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:51:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__release_semaphore’
#   51 | __extension__ unsigned short postgresql_lwlock__release_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1207]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:60:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__wait__start_semaphore’
#   60 | __extension__ unsigned short postgresql_lwlock__wait__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1208]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:69:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__wait__done_semaphore’
#   69 | __extension__ unsigned short postgresql_lwlock__wait__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1209]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:78:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__condacquire_semaphore’
#   78 | __extension__ unsigned short postgresql_lwlock__condacquire_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1210]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:87:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__condacquire__fail_semaphore’
#   87 | __extension__ unsigned short postgresql_lwlock__condacquire__fail_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1211]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:96:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__acquire__or__wait_semaphore’
#   96 | __extension__ unsigned short postgresql_lwlock__acquire__or__wait_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1212]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:105:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lwlock__acquire__or__wait__fail_semaphore’
#  105 | __extension__ unsigned short postgresql_lwlock__acquire__or__wait__fail_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1213]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:114:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lock__wait__start_semaphore’
#  114 | __extension__ unsigned short postgresql_lock__wait__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1214]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:123:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_lock__wait__done_semaphore’
#  123 | __extension__ unsigned short postgresql_lock__wait__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1215]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:132:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__parse__start_semaphore’
#  132 | __extension__ unsigned short postgresql_query__parse__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1216]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:141:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__parse__done_semaphore’
#  141 | __extension__ unsigned short postgresql_query__parse__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1217]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:150:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__rewrite__start_semaphore’
#  150 | __extension__ unsigned short postgresql_query__rewrite__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1218]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:159:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__rewrite__done_semaphore’
#  159 | __extension__ unsigned short postgresql_query__rewrite__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1219]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:168:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__plan__start_semaphore’
#  168 | __extension__ unsigned short postgresql_query__plan__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1220]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:177:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__plan__done_semaphore’
#  177 | __extension__ unsigned short postgresql_query__plan__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1221]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:186:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__execute__start_semaphore’
#  186 | __extension__ unsigned short postgresql_query__execute__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1222]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:195:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__execute__done_semaphore’
#  195 | __extension__ unsigned short postgresql_query__execute__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1223]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:204:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__start_semaphore’
#  204 | __extension__ unsigned short postgresql_query__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1224]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:213:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_query__done_semaphore’
#  213 | __extension__ unsigned short postgresql_query__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1225]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:222:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_statement__status_semaphore’
#  222 | __extension__ unsigned short postgresql_statement__status_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1226]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:231:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_sort__start_semaphore’
#  231 | __extension__ unsigned short postgresql_sort__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1227]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:240:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_sort__done_semaphore’
#  240 | __extension__ unsigned short postgresql_sort__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1228]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:249:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__read__start_semaphore’
#  249 | __extension__ unsigned short postgresql_buffer__read__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1229]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:258:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__read__done_semaphore’
#  258 | __extension__ unsigned short postgresql_buffer__read__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1230]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:267:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__flush__start_semaphore’
#  267 | __extension__ unsigned short postgresql_buffer__flush__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1231]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:276:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__flush__done_semaphore’
#  276 | __extension__ unsigned short postgresql_buffer__flush__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1232]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:285:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__extend__start_semaphore’
#  285 | __extension__ unsigned short postgresql_buffer__extend__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1233]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:294:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__extend__done_semaphore’
#  294 | __extension__ unsigned short postgresql_buffer__extend__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1234]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:303:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__checkpoint__start_semaphore’
#  303 | __extension__ unsigned short postgresql_buffer__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1235]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:312:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__checkpoint__sync__start_semaphore’
#  312 | __extension__ unsigned short postgresql_buffer__checkpoint__sync__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1236]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:321:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__checkpoint__done_semaphore’
#  321 | __extension__ unsigned short postgresql_buffer__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1237]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:330:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__sync__start_semaphore’
#  330 | __extension__ unsigned short postgresql_buffer__sync__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1238]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:339:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__sync__written_semaphore’
#  339 | __extension__ unsigned short postgresql_buffer__sync__written_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1239]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:348:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_buffer__sync__done_semaphore’
#  348 | __extension__ unsigned short postgresql_buffer__sync__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1240]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:357:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_deadlock__found_semaphore’
#  357 | __extension__ unsigned short postgresql_deadlock__found_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1241]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:366:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_checkpoint__start_semaphore’
#  366 | __extension__ unsigned short postgresql_checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1242]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:375:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_checkpoint__done_semaphore’
#  375 | __extension__ unsigned short postgresql_checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1243]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:384:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_clog__checkpoint__start_semaphore’
#  384 | __extension__ unsigned short postgresql_clog__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1244]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:393:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_clog__checkpoint__done_semaphore’
#  393 | __extension__ unsigned short postgresql_clog__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1245]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:402:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_subtrans__checkpoint__start_semaphore’
#  402 | __extension__ unsigned short postgresql_subtrans__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1246]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:411:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_subtrans__checkpoint__done_semaphore’
#  411 | __extension__ unsigned short postgresql_subtrans__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1247]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:420:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_multixact__checkpoint__start_semaphore’
#  420 | __extension__ unsigned short postgresql_multixact__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1248]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:429:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_multixact__checkpoint__done_semaphore’
#  429 | __extension__ unsigned short postgresql_multixact__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1249]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:438:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_twophase__checkpoint__start_semaphore’
#  438 | __extension__ unsigned short postgresql_twophase__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1250]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:447:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_twophase__checkpoint__done_semaphore’
#  447 | __extension__ unsigned short postgresql_twophase__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1251]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:456:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_smgr__md__read__start_semaphore’
#  456 | __extension__ unsigned short postgresql_smgr__md__read__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1252]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:465:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_smgr__md__read__done_semaphore’
#  465 | __extension__ unsigned short postgresql_smgr__md__read__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1253]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:474:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_smgr__md__write__start_semaphore’
#  474 | __extension__ unsigned short postgresql_smgr__md__write__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1254]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:483:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_smgr__md__write__done_semaphore’
#  483 | __extension__ unsigned short postgresql_smgr__md__write__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1255]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:492:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_wal__insert_semaphore’
#  492 | __extension__ unsigned short postgresql_wal__insert_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1256]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:501:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_wal__switch_semaphore’
#  501 | __extension__ unsigned short postgresql_wal__switch_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1257]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:510:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_wal__buffer__write__dirty__start_semaphore’
#  510 | __extension__ unsigned short postgresql_wal__buffer__write__dirty__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: COMPILER_WARNING: [#def1258]
postgresql-18beta1/src/backend/.dtrace-temp.a5ea52e2.c:519:30: warning[-Wmissing-variable-declarations]: no previous declaration for ‘postgresql_wal__buffer__write__dirty__done_semaphore’
#  519 | __extension__ unsigned short postgresql_wal__buffer__write__dirty__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1259]
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:813:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:721:1: enter_function: entry to ‘brin_range_deserialize’
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:789:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:798:9: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:798:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_true: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_true: following ‘true’ branch (when ‘typlen > 0’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:811:44: call_function: inlined call to ‘PointerGetDatum’ from ‘brin_range_deserialize’
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:813:25: danger: argument 1 (‘dataptr’) NULL where non-null expected
#  811|   			range->values[i] = PointerGetDatum(dataptr);
#  812|   
#  813|-> 			memcpy(dataptr, ptr, typlen);
#  814|   			dataptr += MAXALIGN(typlen);
#  815|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1260]
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:822:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:789:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:798:9: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:798:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_true: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: following ‘false’ branch (when ‘typlen <= 0’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:818:25: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:822:25: danger: argument 1 (‘dataptr’) NULL where non-null expected
#  820|   			range->values[i] = PointerGetDatum(dataptr);
#  821|   
#  822|-> 			memcpy(dataptr, ptr, VARSIZE_ANY(ptr));
#  823|   			dataptr += MAXALIGN(VARSIZE_ANY(ptr));
#  824|   			ptr += VARSIZE_ANY(ptr);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1261]
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:832:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:789:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:798:9: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:798:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_true: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: following ‘false’ branch (when ‘typlen <= 0’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:818:25: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:818:25: branch_false: following ‘false’ branch (when ‘typlen != -1’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:826:25: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:826:25: branch_true: following ‘true’ branch (when ‘typlen == -2’)...
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:828:48: branch_true: ...to here
postgresql-18beta1/src/backend/access/brin/brin_minmax_multi.c:832:25: danger: argument 1 (‘dataptr’) NULL where non-null expected
#  830|   			range->values[i] = PointerGetDatum(dataptr);
#  831|   
#  832|-> 			memcpy(dataptr, ptr, slen);
#  833|   			dataptr += MAXALIGN(slen);
#  834|   			ptr += slen;

Error: CPPCHECK_WARNING (CWE-476): [#def1262]
postgresql-18beta1/src/backend/access/common/heaptuple.c:972: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  970|   		len += targetDataLen;
#  971|   
#  972|-> 		*targetMinimalTuple = (MinimalTuple) palloc0(len);
#  973|   		(*targetMinimalTuple)->t_len = len;
#  974|   		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;

Error: CPPCHECK_WARNING (CWE-476): [#def1263]
postgresql-18beta1/src/backend/access/common/heaptuple.c:973: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  971|   
#  972|   		*targetMinimalTuple = (MinimalTuple) palloc0(len);
#  973|-> 		(*targetMinimalTuple)->t_len = len;
#  974|   		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
#  975|   		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;

Error: CPPCHECK_WARNING (CWE-476): [#def1264]
postgresql-18beta1/src/backend/access/common/heaptuple.c:974: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  972|   		*targetMinimalTuple = (MinimalTuple) palloc0(len);
#  973|   		(*targetMinimalTuple)->t_len = len;
#  974|-> 		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
#  975|   		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;
#  976|   		/* Same macro works for MinimalTuples */

Error: CPPCHECK_WARNING (CWE-476): [#def1265]
postgresql-18beta1/src/backend/access/common/heaptuple.c:975: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  973|   		(*targetMinimalTuple)->t_len = len;
#  974|   		(*targetMinimalTuple)->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
#  975|-> 		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;
#  976|   		/* Same macro works for MinimalTuples */
#  977|   		HeapTupleHeaderSetNatts(*targetMinimalTuple, natts);

Error: CPPCHECK_WARNING (CWE-476): [#def1266]
postgresql-18beta1/src/backend/access/common/heaptuple.c:977: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  975|   		(*targetMinimalTuple)->t_infomask = sourceTHeader->t_infomask;
#  976|   		/* Same macro works for MinimalTuples */
#  977|-> 		HeapTupleHeaderSetNatts(*targetMinimalTuple, natts);
#  978|   		if (targetNullLen > 0)
#  979|   			nullBits = (bits8 *) ((char *) *targetMinimalTuple

Error: CPPCHECK_WARNING (CWE-476): [#def1267]
postgresql-18beta1/src/backend/access/common/heaptuple.c:981: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  979|   			nullBits = (bits8 *) ((char *) *targetMinimalTuple
#  980|   								  + offsetof(MinimalTupleData, t_bits));
#  981|-> 		targetData = (char *) *targetMinimalTuple + hoff;
#  982|   		infoMask = &((*targetMinimalTuple)->t_infomask);
#  983|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def1268]
postgresql-18beta1/src/backend/access/common/heaptuple.c:982: warning[nullPointer]: Possible null pointer dereference: targetMinimalTuple
#  980|   								  + offsetof(MinimalTupleData, t_bits));
#  981|   		targetData = (char *) *targetMinimalTuple + hoff;
#  982|-> 		infoMask = &((*targetMinimalTuple)->t_infomask);
#  983|   	}
#  984|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1269]
postgresql-18beta1/src/backend/access/gin/ginbtree.c:412:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘childpage’
postgresql-18beta1/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18beta1/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginbtree.c:823:17: call_function: calling ‘ginFinishOldSplit’ from ‘ginInsertValue’
#  410|   		if (BufferIsValid(childbuf))
#  411|   		{
#  412|-> 			GinPageGetOpaque(childpage)->flags &= ~GIN_INCOMPLETE_SPLIT;
#  413|   			MarkBufferDirty(childbuf);
#  414|   			if (RelationNeedsWAL(btree->index) && !btree->isBuild)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1270]
postgresql-18beta1/src/backend/access/gin/ginbtree.c:484:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘childpage’
postgresql-18beta1/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18beta1/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginbtree.c:823:17: call_function: calling ‘ginFinishOldSplit’ from ‘ginInsertValue’
#  482|   		{
#  483|   			data.leftChildBlkno = BufferGetBlockNumber(childbuf);
#  484|-> 			data.rightChildBlkno = GinPageGetOpaque(childpage)->rightlink;
#  485|   		}
#  486|   		else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1271]
postgresql-18beta1/src/backend/access/gin/ginbtree.c:576:25: warning[-Wanalyzer-null-argument]: use of NULL ‘newrootpg’ where non-null expected
postgresql-18beta1/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18beta1/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginbtree.c:823:17: call_function: calling ‘ginFinishOldSplit’ from ‘ginInsertValue’
#  574|   			/* Splitting the root, three pages to update */
#  575|   			MarkBufferDirty(lbuffer);
#  576|-> 			memcpy(page, newrootpg, BLCKSZ);
#  577|   			memcpy(BufferGetPage(lbuffer), newlpage, BLCKSZ);
#  578|   			memcpy(BufferGetPage(rbuffer), newrpage, BLCKSZ);

Error: CPPCHECK_WARNING (CWE-457): [#def1272]
postgresql-18beta1/src/backend/access/gin/ginentrypage.c:630: error[legacyUninitvar]: Uninitialized variable: tupstore
#  628|   	 */
#  629|   	maxoff = PageGetMaxOffsetNumber(lpage);
#  630|-> 	ptr = tupstore[0].data;
#  631|   	for (i = FirstOffsetNumber; i <= maxoff; i++)
#  632|   	{

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1273]
postgresql-18beta1/src/backend/access/gin/ginget.c:1712:61: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘category[<unknown>]’
postgresql-18beta1/src/backend/access/gin/ginget.c:1656:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1658:47: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1660:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1662:54: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1677:40: branch_true: following ‘true’ branch (when ‘StopLow < StopHigh’)...
postgresql-18beta1/src/backend/access/gin/ginget.c:1681:65: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1687:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1692:44: branch_false: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1692:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1698:45: branch_false: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1698:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1706:45: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1706:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1709:53: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1709:52: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1712:61: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1712:61: danger: use of uninitialized value ‘category[<unknown>]’ here
# 1710|   						{
# 1711|   							/* match anything except NULL_ITEM */
# 1712|-> 							if (category[StopMiddle - 1] == GIN_CAT_NULL_ITEM)
# 1713|   								res = -1;
# 1714|   							else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1274]
postgresql-18beta1/src/backend/access/gin/ginget.c:1725:55: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘category[<unknown>]’
postgresql-18beta1/src/backend/access/gin/ginget.c:1656:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1658:47: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1660:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1662:54: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1677:40: branch_true: following ‘true’ branch (when ‘StopLow < StopHigh’)...
postgresql-18beta1/src/backend/access/gin/ginget.c:1681:65: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1687:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1692:44: branch_false: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1692:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1698:45: branch_false: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1698:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1706:45: branch_true: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1706:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/gin/ginget.c:1725:55: branch_false: ...to here
postgresql-18beta1/src/backend/access/gin/ginget.c:1725:55: danger: use of uninitialized value ‘category[<unknown>]’ here
# 1723|   					else
# 1724|   					{
# 1725|-> 						res = ginCompareEntries(&so->ginstate,
# 1726|   												entry->attnum,
# 1727|   												entry->queryKey,

Error: CPPCHECK_WARNING (CWE-457): [#def1275]
postgresql-18beta1/src/backend/access/gist/gistutil.c:207: error[uninitvar]: Uninitialized variable: &attrsize
#  205|   										giststate->supportCollation[i],
#  206|   										PointerGetDatum(evec),
#  207|-> 										PointerGetDatum(&attrsize));
#  208|   
#  209|   			isnull[i] = false;

Error: CPPCHECK_WARNING (CWE-457): [#def1276]
postgresql-18beta1/src/backend/access/gist/gistutil.c:276: error[uninitvar]: Uninitialized variable: &dstsize
#  274|   								 giststate->supportCollation[attno],
#  275|   								 PointerGetDatum(evec),
#  276|-> 								 PointerGetDatum(&dstsize));
#  277|   	}
#  278|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1277]
postgresql-18beta1/src/backend/access/hash/hashpage.c:1531:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
postgresql-18beta1/src/backend/access/hash/hashpage.c:1516:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/hash/hashpage.c:1521:21: branch_false: ...to here
postgresql-18beta1/src/backend/access/hash/hashpage.c:1529:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/hash/hashpage.c:1530:25: branch_true: ...to here
postgresql-18beta1/src/backend/access/hash/hashpage.c:1531:24: release_memory: using NULL here
postgresql-18beta1/src/backend/access/hash/hashpage.c:1531:17: danger: argument 1 (‘*rel.rd_amcache’) NULL where non-null expected
# 1529|   		if (rel->rd_amcache == NULL)
# 1530|   			rel->rd_amcache = cache;
# 1531|-> 		memcpy(rel->rd_amcache, HashPageGetMeta(page),
# 1532|   			   sizeof(HashMetaPageData));
# 1533|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1278]
postgresql-18beta1/src/backend/access/hash/hashpage.c:1531:17: warning[-Wanalyzer-null-argument]: use of NULL ‘*rel.rd_amcache’ where non-null expected
postgresql-18beta1/src/backend/access/hash/hashpage.c:1559:1: enter_function: entry to ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/src/backend/access/hash/hashpage.c:1573:17: call_function: calling ‘_hash_getcachedmetap’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/src/backend/access/hash/hashpage.c:1573:17: return_function: returning to ‘_hash_getbucketbuf_from_hashkey’ from ‘_hash_getcachedmetap’
postgresql-18beta1/src/backend/access/hash/hashpage.c:1592:23: call_function: calling ‘_hash_getbuf’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/src/backend/access/hash/hashpage.c:1592:23: return_function: returning to ‘_hash_getbucketbuf_from_hashkey’ from ‘_hash_getbuf’
postgresql-18beta1/src/backend/access/hash/hashpage.c:1601:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/hash/hashpage.c:1605:17: call_function: inlined call to ‘_hash_relbuf’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18beta1/src/backend/access/hash/hashpage.c:1606:25: call_function: calling ‘_hash_getcachedmetap’ from ‘_hash_getbucketbuf_from_hashkey’
# 1529|   		if (rel->rd_amcache == NULL)
# 1530|   			rel->rd_amcache = cache;
# 1531|-> 		memcpy(rel->rd_amcache, HashPageGetMeta(page),
# 1532|   			   sizeof(HashMetaPageData));
# 1533|   

Error: CPPCHECK_WARNING (CWE-457): [#def1279]
postgresql-18beta1/src/backend/access/heap/heapam.c:5880: error[legacyUninitvar]: Uninitialized variable: status
# 5878|   				}
# 5879|   
# 5880|-> 				result = test_lockmode_for_conflict(status, rawxmax, mode,
# 5881|   													&mytup, &needwait);
# 5882|   

Error: CPPCHECK_WARNING (CWE-457): [#def1280]
postgresql-18beta1/src/backend/access/heap/heapam.c:6436: error[legacyUninitvar]: Uninitialized variable: ret
# 6434|   	 * don't bother optimizing that.
# 6435|   	 */
# 6436|-> 	if (!ret)
# 6437|   	{
# 6438|   		UnlockTuple(relation, &oldtup.t_self, InplaceUpdateTupleLock);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1281]
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:882:63: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘<unknown>’
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:756:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:797:13: branch_false: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:828:12: branch_true: following ‘true’ branch (when ‘newaction == 0’)...
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:835:27: branch_true: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:841:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:844:21: branch_false: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:844:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:847:25: branch_true: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:850:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:857:17: branch_false: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:871:20: branch_true: following ‘true’ branch (when ‘prefixlen != 0’)...
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:876:31: branch_true: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_xlog.c:882:63: danger: dereference of NULL ‘oldtup.t_data’
#  880|   
#  881|   			/* copy prefix from old tuple */
#  882|-> 			memcpy(newp, (char *) oldtup.t_data + oldtup.t_data->t_hoff, prefixlen);
#  883|   			newp += prefixlen;
#  884|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1282]
postgresql-18beta1/src/backend/access/index/amvalidate.c:178:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/access/index/amvalidate.c:152:1: enter_function: entry to ‘check_amproc_signature’
postgresql-18beta1/src/backend/access/index/amvalidate.c:162:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/index/amvalidate.c:164:35: call_function: inlined call to ‘GETSTRUCT’ from ‘check_amproc_signature’
postgresql-18beta1/src/backend/access/index/amvalidate.c:170:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/access/index/amvalidate.c:171:21: branch_true: following ‘true’ branch (when ‘i < maxargs’)...
postgresql-18beta1/src/backend/access/index/amvalidate.c:173:41: branch_true: ...to here
postgresql-18beta1/src/backend/access/index/amvalidate.c:178:26: throw: if ‘IsBinaryCoercible’ throws an exception...
postgresql-18beta1/src/backend/access/index/amvalidate.c:178:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  176|   			continue;
#  177|   		if (exact ? (argtype != procform->proargtypes.values[i]) :
#  178|-> 			!IsBinaryCoercible(argtype, procform->proargtypes.values[i]))
#  179|   			result = false;
#  180|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1283]
postgresql-18beta1/src/backend/access/nbtree/nbtpreprocesskeys.c:871:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘array’
postgresql-18beta1/src/backend/access/nbtree/nbtpreprocesskeys.c:1218:1: enter_function: entry to ‘_bt_skiparray_shrink’
postgresql-18beta1/src/backend/access/nbtree/nbtpreprocesskeys.c:1259:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtpreprocesskeys.c:1262:38: branch_true: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtpreprocesskeys.c:1262:38: call_function: calling ‘_bt_compare_scankey_args’ from ‘_bt_skiparray_shrink’
#  869|   			/* Skip array will have no NULL element/IS NULL scan key */
#  870|   			Assert(array->num_elems == -1);
#  871|-> 			array->null_elem = false;
#  872|   
#  873|   			/* IS NOT NULL key (could be leftarg or rightarg) now redundant */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1284]
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:1163:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘split’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:934:1: enter_function: entry to ‘_bt_strategy’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:954:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:961:9: branch_true: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:961:9: call_function: calling ‘_bt_interval_edges’ from ‘_bt_strategy’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:961:9: return_function: returning to ‘_bt_strategy’ from ‘_bt_interval_edges’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:962:20: release_memory: ‘leftinterval’ is NULL
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:962:20: call_function: calling ‘_bt_split_lastleft’ from ‘_bt_strategy’
# 1161|   	ItemId		itemid;
# 1162|   
# 1163|-> 	if (split->newitemonleft && split->firstrightoff == state->newitemoff)
# 1164|   		return state->newitem;
# 1165|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1285]
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:1179:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘split’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:934:1: enter_function: entry to ‘_bt_strategy’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:954:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:961:9: branch_true: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:961:9: call_function: calling ‘_bt_interval_edges’ from ‘_bt_strategy’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:961:9: return_function: returning to ‘_bt_strategy’ from ‘_bt_interval_edges’
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:963:21: release_memory: ‘rightinterval’ is NULL
postgresql-18beta1/src/backend/access/nbtree/nbtsplitloc.c:963:21: call_function: calling ‘_bt_split_firstright’ from ‘_bt_strategy’
# 1177|   	ItemId		itemid;
# 1178|   
# 1179|-> 	if (!split->newitemonleft && split->firstrightoff == state->newitemoff)
# 1180|   		return state->newitem;
# 1181|   

Error: CPPCHECK_WARNING (CWE-476): [#def1286]
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:454: error[ctunullpointer]: Null pointer dereference: array
#  452|   	Assert(!ScanDirectionIsNoMovement(dir));
#  453|   
#  454|-> 	if (array->null_elem)
#  455|   	{
#  456|   		Assert(!array->low_compare && !array->high_compare);

Error: CPPCHECK_WARNING (CWE-476): [#def1287]
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:454: warning[nullPointer]: Possible null pointer dereference: array
#  452|   	Assert(!ScanDirectionIsNoMovement(dir));
#  453|   
#  454|-> 	if (array->null_elem)
#  455|   	{
#  456|   		Assert(!array->low_compare && !array->high_compare);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1288]
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:454:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘array’
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:3217:1: enter_function: entry to ‘_bt_checkkeys_look_ahead’
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:3228:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:3235:12: branch_false: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:3261:13: call_function: calling ‘_bt_tuple_before_array_skeys’ from ‘_bt_checkkeys_look_ahead’
#  452|   	Assert(!ScanDirectionIsNoMovement(dir));
#  453|   
#  454|-> 	if (array->null_elem)
#  455|   	{
#  456|   		Assert(!array->low_compare && !array->high_compare);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1289]
postgresql-18beta1/src/backend/access/spgist/spgscan.c:123:17: warning[-Wanalyzer-null-argument]: use of NULL ‘distances’ where non-null expected
postgresql-18beta1/src/backend/access/spgist/spgscan.c:942:1: enter_function: entry to ‘spggetbitmap’
postgresql-18beta1/src/backend/access/spgist/spgscan.c:952:9: call_function: calling ‘spgWalk’ from ‘spggetbitmap’
#  121|   
#  122|   	if (!isnull && so->numberOfNonNullOrderBys > 0)
#  123|-> 		memcpy(item->distances, distances,
#  124|   			   sizeof(item->distances[0]) * so->numberOfNonNullOrderBys);
#  125|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1290]
postgresql-18beta1/src/backend/access/spgist/spgutils.c:803:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1002:1: enter_function: entry to ‘spgFormInnerTuple’
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1045:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: ...to here
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: following ‘false’ branch (when ‘nNodes <= 8191’)...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1051:34: branch_false: ...to here
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1057:12: branch_true: following ‘true’ branch (when ‘hasPrefix != 0’)...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1058:17: branch_true: ...to here
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1058:17: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1058:17: call_function: inlined call to ‘memcpyInnerDatum’ from ‘spgFormInnerTuple’
#  801|   	if (att->attbyval)
#  802|   	{
#  803|-> 		memcpy(target, &datum, sizeof(Datum));
#  804|   	}
#  805|   	else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1291]
postgresql-18beta1/src/backend/access/spgist/spgutils.c:808:17: warning[-Wanalyzer-null-argument]: use of NULL ‘target’ where non-null expected
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1002:1: enter_function: entry to ‘spgFormInnerTuple’
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1045:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: ...to here
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: following ‘false’ branch (when ‘nNodes <= 8191’)...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1051:34: branch_false: ...to here
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1057:12: branch_true: following ‘true’ branch (when ‘hasPrefix != 0’)...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1058:17: branch_true: ...to here
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1058:17: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/spgist/spgutils.c:1058:17: call_function: inlined call to ‘memcpyInnerDatum’ from ‘spgFormInnerTuple’
#  806|   	{
#  807|   		size = (att->attlen > 0) ? att->attlen : VARSIZE_ANY(datum);
#  808|-> 		memcpy(target, DatumGetPointer(datum), size);
#  809|   	}
#  810|   }

Error: CPPCHECK_WARNING (CWE-457): [#def1292]
postgresql-18beta1/src/backend/access/transam/commit_ts.c:452: warning[uninitvar]: Uninitialized variable: values
#  450|   	}
#  451|   
#  452|-> 	htup = heap_form_tuple(tupdesc, values, nulls);
#  453|   
#  454|   	PG_RETURN_DATUM(HeapTupleGetDatum(htup));

Error: CPPCHECK_WARNING (CWE-457): [#def1293]
postgresql-18beta1/src/backend/access/transam/commit_ts.c:493: warning[uninitvar]: Uninitialized variable: values
#  491|   	}
#  492|   
#  493|-> 	htup = heap_form_tuple(tupdesc, values, nulls);
#  494|   
#  495|   	PG_RETURN_DATUM(HeapTupleGetDatum(htup));

Error: CPPCHECK_WARNING (CWE-476): [#def1294]
postgresql-18beta1/src/backend/access/transam/twophase.c:1037: error[ctunullpointer]: Null pointer dereference: data
# 1035|   	}
# 1036|   
# 1037|-> 	memcpy(((char *) records.tail->data) + records.tail->len, data, len);
# 1038|   	records.tail->len += padlen;
# 1039|   	records.bytes_free -= padlen;

Error: CPPCHECK_WARNING (CWE-682): [#def1295]
postgresql-18beta1/src/backend/access/transam/xlog.c:1659: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1657|   		Assert(((XLogPageHeader) cachedPos)->xlp_magic == XLOG_PAGE_MAGIC);
# 1658|   		Assert(((XLogPageHeader) cachedPos)->xlp_pageaddr == ptr - (ptr % XLOG_BLCKSZ));
# 1659|-> 		return cachedPos + ptr % XLOG_BLCKSZ;
# 1660|   	}
# 1661|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1296]
postgresql-18beta1/src/backend/access/transam/xlogreader.c:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/access/transam/xlogreader.c:78:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/access/transam/xlogreader.c:79:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/backend/access/transam/xlogreader.c:79:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   77|   
#   78|   	va_start(args, fmt);
#   79|-> 	vsnprintf(state->errormsg_buf, MAX_ERRORMSG_LEN, fmt, args);
#   80|   	va_end(args);
#   81|   

Error: CPPCHECK_WARNING (CWE-457): [#def1297]
postgresql-18beta1/src/backend/backup/basebackup.c:648: warning[uninitvar]: Uninitialized variable: endptr
#  646|   
#  647|   	AddWALInfoToBackupManifest(&manifest, state.startptr, state.starttli,
#  648|-> 							   endptr, endtli);
#  649|   
#  650|   	SendBackupManifest(&manifest, sink);

Error: CPPCHECK_WARNING (CWE-457): [#def1298]
postgresql-18beta1/src/backend/backup/basebackup.c:648: warning[uninitvar]: Uninitialized variable: endtli
#  646|   
#  647|   	AddWALInfoToBackupManifest(&manifest, state.startptr, state.starttli,
#  648|-> 							   endptr, endtli);
#  649|   
#  650|   	SendBackupManifest(&manifest, sink);

Error: CPPCHECK_WARNING (CWE-457): [#def1299]
postgresql-18beta1/src/backend/backup/basebackup_copy.c:418: warning[uninitvar]: Uninitialized variable: values
#  416|   			nulls[2] = true;
#  417|   
#  418|-> 		do_tup_output(tstate, values, nulls);
#  419|   	}
#  420|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1300]
postgresql-18beta1/src/backend/backup/basebackup_incremental.c:1021:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/backup/basebackup_incremental.c:1020:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/backup/basebackup_incremental.c:1021:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18beta1/src/backend/backup/basebackup_incremental.c:1021:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1019|   
# 1020|   		va_start(ap, fmt);
# 1021|-> 		needed = appendStringInfoVA(&errbuf, fmt, ap);
# 1022|   		va_end(ap);
# 1023|   		if (needed == 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1301]
postgresql-18beta1/src/backend/backup/walsummary.c:332:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/backup/walsummary.c:331:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/backup/walsummary.c:332:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18beta1/src/backend/backup/walsummary.c:332:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  330|   	{
#  331|   		va_start(ap, fmt);
#  332|-> 		needed = appendStringInfoVA(&buf, fmt, ap);
#  333|   		va_end(ap);
#  334|   		if (needed == 0)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1302]
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1150:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1108:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1114:28: branch_true: ...to here
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1137:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1139:7: branch_false: ...to here
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1148:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1150:9: branch_false: ...to here
postgresql-18beta1/src/backend/bootstrap/bootparse.c:1150:9: danger: use of uninitialized value ‘yyss’ here
# 1148|           if (! yyptr)
# 1149|             YYNOMEM;
# 1150|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1151|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1152|   #  undef YYSTACK_RELOCATE

Error: CPPCHECK_WARNING (CWE-476): [#def1303]
postgresql-18beta1/src/backend/catalog/heap.c:3097: warning[nullPointer]: Possible null pointer dereference: conname
# 3095|   			foreach_ptr(char, thisname, nnnames)
# 3096|   			{
# 3097|-> 				if (strcmp(thisname, conname) == 0)
# 3098|   				{
# 3099|   					conname = NULL;

Error: CPPCHECK_WARNING (CWE-768): [#def1304]
postgresql-18beta1/src/backend/catalog/objectaddress.c:2327: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(typename)},((union ListCell){.ptr_value=((list_nth_cell(args,0)->ptr_value))})' depends on order of evaluation of side effects
# 2325|   		case OBJECT_DOMCONSTRAINT:
# 2326|   		case OBJECT_TRANSFORM:
# 2327|-> 			objnode = (Node *) list_make2(typename, linitial(args));
# 2328|   			break;
# 2329|   		case OBJECT_PUBLICATION_REL:

Error: CPPCHECK_WARNING (CWE-768): [#def1305]
postgresql-18beta1/src/backend/catalog/objectaddress.c:2330: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(name)},((union ListCell){.ptr_value=((list_nth_cell(args,0)->ptr_value))})' depends on order of evaluation of side effects
# 2328|   			break;
# 2329|   		case OBJECT_PUBLICATION_REL:
# 2330|-> 			objnode = (Node *) list_make2(name, linitial(args));
# 2331|   			break;
# 2332|   		case OBJECT_PUBLICATION_NAMESPACE:

Error: CPPCHECK_WARNING (CWE-768): [#def1306]
postgresql-18beta1/src/backend/catalog/objectaddress.c:2334: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=((list_nth_cell(name,0)->ptr_value))}),((union ListCell){.ptr_value=((list_nth_cell(args,0)->ptr_value))})' depends on order of evaluation of side effects
# 2332|   		case OBJECT_PUBLICATION_NAMESPACE:
# 2333|   		case OBJECT_USER_MAPPING:
# 2334|-> 			objnode = (Node *) list_make2(linitial(name), linitial(args));
# 2335|   			break;
# 2336|   		case OBJECT_DEFACL:

Error: CPPCHECK_WARNING (CWE-768): [#def1307]
postgresql-18beta1/src/backend/catalog/objectaddress.c:2341: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(name)},(union ListCell){.ptr_value=(args)}' depends on order of evaluation of side effects
# 2339|   		case OBJECT_AMOP:
# 2340|   		case OBJECT_AMPROC:
# 2341|-> 			objnode = (Node *) list_make2(name, args);
# 2342|   			break;
# 2343|   		case OBJECT_FUNCTION:

Error: CPPCHECK_WARNING (CWE-768): [#def1308]
postgresql-18beta1/src/backend/catalog/objectaddress.c:4985: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((coll->collname).data))}' depends on order of evaluation of side effects
# 4983|   																  NameStr(coll->collname)));
# 4984|   				if (objname)
# 4985|-> 					*objname = list_make2(schema,
# 4986|   										  pstrdup(NameStr(coll->collname)));
# 4987|   				ReleaseSysCache(collTup);

Error: CPPCHECK_WARNING (CWE-768): [#def1309]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5059: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((conForm->conname).data))}' depends on order of evaluation of side effects
# 5057|   																  NameStr(conForm->conname)));
# 5058|   				if (objname)
# 5059|-> 					*objname = list_make2(schema,
# 5060|   										  pstrdup(NameStr(conForm->conname)));
# 5061|   				ReleaseSysCache(conTup);

Error: CPPCHECK_WARNING (CWE-768): [#def1310]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5165: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(schema)}' depends on order of evaluation of side effects
# 5163|   								 quote_identifier(NameStr(amForm->amname)));
# 5164|   				if (objname)
# 5165|-> 					*objname = list_make3(pstrdup(NameStr(amForm->amname)),
# 5166|   										  schema,
# 5167|   										  pstrdup(NameStr(opcForm->opcname)));

Error: CPPCHECK_WARNING (CWE-768): [#def1311]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5165: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((opcForm->opcname).data))}' depends on order of evaluation of side effects
# 5163|   								 quote_identifier(NameStr(amForm->amname)));
# 5164|   				if (objname)
# 5165|-> 					*objname = list_make3(pstrdup(NameStr(amForm->amname)),
# 5166|   										  schema,
# 5167|   										  pstrdup(NameStr(opcForm->opcname)));

Error: CPPCHECK_WARNING (CWE-768): [#def1312]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5245: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltype)},(union ListCell){.ptr_value=(rtype)}' depends on order of evaluation of side effects
# 5243|   					*objname = lappend(*objname,
# 5244|   									   psprintf("%d", amopForm->amopstrategy));
# 5245|-> 					*objargs = list_make2(ltype, rtype);
# 5246|   				}
# 5247|   

Error: CPPCHECK_WARNING (CWE-768): [#def1313]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5307: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltype)},(union ListCell){.ptr_value=(rtype)}' depends on order of evaluation of side effects
# 5305|   					*objname = lappend(*objname,
# 5306|   									   psprintf("%d", amprocForm->amprocnum));
# 5307|-> 					*objargs = list_make2(ltype, rtype);
# 5308|   				}
# 5309|   

Error: CPPCHECK_WARNING (CWE-768): [#def1314]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5427: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formStatistic->stxname).data))}' depends on order of evaluation of side effects
# 5425|   																  NameStr(formStatistic->stxname)));
# 5426|   				if (objname)
# 5427|-> 					*objname = list_make2(schema,
# 5428|   										  pstrdup(NameStr(formStatistic->stxname)));
# 5429|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def1315]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5454: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formParser->prsname).data))}' depends on order of evaluation of side effects
# 5452|   																  NameStr(formParser->prsname)));
# 5453|   				if (objname)
# 5454|-> 					*objname = list_make2(schema,
# 5455|   										  pstrdup(NameStr(formParser->prsname)));
# 5456|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def1316]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5481: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formDict->dictname).data))}' depends on order of evaluation of side effects
# 5479|   																  NameStr(formDict->dictname)));
# 5480|   				if (objname)
# 5481|-> 					*objname = list_make2(schema,
# 5482|   										  pstrdup(NameStr(formDict->dictname)));
# 5483|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def1317]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5508: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formTmpl->tmplname).data))}' depends on order of evaluation of side effects
# 5506|   																  NameStr(formTmpl->tmplname)));
# 5507|   				if (objname)
# 5508|-> 					*objname = list_make2(schema,
# 5509|   										  pstrdup(NameStr(formTmpl->tmplname)));
# 5510|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def1318]
postgresql-18beta1/src/backend/catalog/objectaddress.c:5535: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((formCfg->cfgname).data))}' depends on order of evaluation of side effects
# 5533|   																  NameStr(formCfg->cfgname)));
# 5534|   				if (objname)
# 5535|-> 					*objname = list_make2(schema,
# 5536|   										  pstrdup(NameStr(formCfg->cfgname)));
# 5537|   				ReleaseSysCache(tup);

Error: CPPCHECK_WARNING (CWE-768): [#def1319]
postgresql-18beta1/src/backend/catalog/objectaddress.c:6084: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(pstrdup(schema))}' depends on order of evaluation of side effects
# 6082|   
# 6083|   	if (object)
# 6084|-> 		*object = list_make3(pstrdup(NameStr(amForm->amname)),
# 6085|   							 pstrdup(schema),
# 6086|   							 pstrdup(NameStr(opfForm->opfname)));

Error: CPPCHECK_WARNING (CWE-768): [#def1320]
postgresql-18beta1/src/backend/catalog/objectaddress.c:6084: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(pstrdup((amForm->amname).data))},(union ListCell){.ptr_value=(pstrdup(schema))},(union ListCell){.ptr_value=(pstrdup((opfForm->opfname).data))}' depends on order of evaluation of side effects
# 6082|   
# 6083|   	if (object)
# 6084|-> 		*object = list_make3(pstrdup(NameStr(amForm->amname)),
# 6085|   							 pstrdup(schema),
# 6086|   							 pstrdup(NameStr(opfForm->opfname)));

Error: CPPCHECK_WARNING (CWE-768): [#def1321]
postgresql-18beta1/src/backend/catalog/objectaddress.c:6122: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(schema)},(union ListCell){.ptr_value=(pstrdup((relForm->relname).data))}' depends on order of evaluation of side effects
# 6120|   													  NameStr(relForm->relname)));
# 6121|   	if (object)
# 6122|-> 		*object = list_make2(schema, pstrdup(NameStr(relForm->relname)));
# 6123|   
# 6124|   	ReleaseSysCache(relTup);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1322]
postgresql-18beta1/src/backend/catalog/partition.c:288:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partexprs_item’
postgresql-18beta1/src/backend/catalog/partition.c:255:1: enter_function: entry to ‘has_partition_attrs’
postgresql-18beta1/src/backend/catalog/partition.c:263:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/catalog/partition.c:270:26: call_function: inlined call to ‘list_head’ from ‘has_partition_attrs’
postgresql-18beta1/src/backend/catalog/partition.c:271:9: branch_false: ...to here
postgresql-18beta1/src/backend/catalog/partition.c:271:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/catalog/partition.c:273:45: call_function: inlined call to ‘get_partition_col_attnum’ from ‘has_partition_attrs’
postgresql-18beta1/src/backend/catalog/partition.c:275:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/catalog/partition.c:288:37: branch_false: ...to here
postgresql-18beta1/src/backend/catalog/partition.c:288:37: danger: dereference of NULL ‘partexprs_item’
#  286|   		{
#  287|   			/* Arbitrary expression */
#  288|-> 			Node	   *expr = (Node *) lfirst(partexprs_item);
#  289|   			Bitmapset  *expr_attrs = NULL;
#  290|   

Error: COMPILER_WARNING (CWE-704): [#def1323]
postgresql-18beta1/src/backend/catalog/pg_type.c: scope_hint: In function ‘makeMultirangeTypeName’
postgresql-18beta1/src/backend/catalog/pg_type.c:959:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  959 |         rangestr = strstr(rangeTypeName, "range");
#      |                  ^
#  957|   	 * "multirange". Otherwise add "_multirange" to the end.
#  958|   	 */
#  959|-> 	rangestr = strstr(rangeTypeName, "range");
#  960|   	if (rangestr)
#  961|   	{

Error: COMPILER_WARNING (CWE-704): [#def1324]
postgresql-18beta1/src/backend/catalog/pg_type.c:959:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  957|   	 * "multirange". Otherwise add "_multirange" to the end.
#  958|   	 */
#  959|-> 	rangestr = strstr(rangeTypeName, "range");
#  960|   	if (rangestr)
#  961|   	{

Error: CPPCHECK_WARNING (CWE-768): [#def1325]
postgresql-18beta1/src/backend/catalog/toasting.c:324: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=("chunk_id")},(union ListCell){.ptr_value=("chunk_seq")}' depends on order of evaluation of side effects
#  322|   				 InvalidOid, InvalidOid,
#  323|   				 indexInfo,
#  324|-> 				 list_make2("chunk_id", "chunk_seq"),
#  325|   				 BTREE_AM_OID,
#  326|   				 rel->rd_rel->reltablespace,

Error: CPPCHECK_WARNING (CWE-457): [#def1326]
postgresql-18beta1/src/backend/commands/conversioncmds.c:110: error[uninitvar]: Uninitialized variable: result
#  108|   	 * perform the requested conversion.
#  109|   	 */
#  110|-> 	funcresult = OidFunctionCall6(funcoid,
#  111|   								  Int32GetDatum(from_encoding),
#  112|   								  Int32GetDatum(to_encoding),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1327]
postgresql-18beta1/src/backend/commands/copy.c:300:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18beta1/src/backend/commands/copy.c:62:1: enter_function: entry to ‘DoCopy’
postgresql-18beta1/src/backend/commands/copy.c:112:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/commands/copy.c:284:25: call_function: inlined call to ‘newNode’ from ‘DoCopy’
postgresql-18beta1/src/backend/commands/copy.c:293:12: branch_true: following ‘true’ branch (when ‘is_from != 0’)...
postgresql-18beta1/src/backend/commands/copy.c:300:21: branch_true: ...to here
postgresql-18beta1/src/backend/commands/copy.c:300:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/commands/copy.c:300:38: branch_true: ...to here
postgresql-18beta1/src/backend/commands/copy.c:300:38: danger: dereference of NULL ‘rel’
#  298|   
#  299|   		/* check read-only transaction and parallel mode */
#  300|-> 		if (XactReadOnly && !rel->rd_islocaltemp)
#  301|   			PreventCommandIfReadOnly("COPY FROM");
#  302|   

Error: CPPCHECK_WARNING (CWE-457): [#def1328]
postgresql-18beta1/src/backend/commands/copy.c:443: error[legacyUninitvar]: Uninitialized variable: reject_limit
#  441|   		reject_limit = defGetInt64(def);
#  442|   
#  443|-> 	if (reject_limit <= 0)
#  444|   		ereport(ERROR,
#  445|   				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

Error: CPPCHECK_WARNING (CWE-476): [#def1329]
postgresql-18beta1/src/backend/commands/extension.c:280: error[ctunullpointer]: Null pointer dereference: versionname
#  278|   check_valid_version_name(const char *versionname)
#  279|   {
#  280|-> 	int			namelen = strlen(versionname);
#  281|   
#  282|   	/*

Error: CPPCHECK_WARNING (CWE-476): [#def1330]
postgresql-18beta1/src/backend/commands/extension.c:280: warning[nullPointer]: Possible null pointer dereference: versionname
#  278|   check_valid_version_name(const char *versionname)
#  279|   {
#  280|-> 	int			namelen = strlen(versionname);
#  281|   
#  282|   	/*

Error: CPPCHECK_WARNING (CWE-476): [#def1331]
postgresql-18beta1/src/backend/commands/extension.c:3367: warning[nullPointer]: Possible null pointer dereference: versionName
# 3365|   	 * If we're already at that version, just say so
# 3366|   	 */
# 3367|-> 	if (strcmp(oldVersionName, versionName) == 0)
# 3368|   	{
# 3369|   		ereport(NOTICE,

Error: CPPCHECK_WARNING (CWE-457): [#def1332]
postgresql-18beta1/src/backend/commands/policy.c:128: error[legacyUninitvar]: Uninitialized variable: polcmd
#  126|   		elog(ERROR, "unrecognized policy command");
#  127|   
#  128|-> 	return polcmd;
#  129|   }
#  130|   

Error: CPPCHECK_WARNING (CWE-457): [#def1333]
postgresql-18beta1/src/backend/commands/tablecmds.c:8994: warning[uninitvar]: Uninitialized variable: repl_val
# 8992|   	repl_repl[Anum_pg_attribute_attstattarget - 1] = true;
# 8993|   	newtuple = heap_modify_tuple(tuple, RelationGetDescr(attrelation),
# 8994|-> 								 repl_val, repl_null, repl_repl);
# 8995|   	CatalogTupleUpdate(attrelation, &tuple->t_self, newtuple);
# 8996|   

Error: CPPCHECK_WARNING (CWE-457): [#def1334]
postgresql-18beta1/src/backend/commands/tablecmds.c:9068: warning[uninitvar]: Uninitialized variable: repl_val
# 9066|   	repl_repl[Anum_pg_attribute_attoptions - 1] = true;
# 9067|   	newtuple = heap_modify_tuple(tuple, RelationGetDescr(attrelation),
# 9068|-> 								 repl_val, repl_null, repl_repl);
# 9069|   
# 9070|   	/* Update system catalog. */

Error: CPPCHECK_WARNING (CWE-768): [#def1335]
postgresql-18beta1/src/backend/commands/tablecmds.c:15773: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(get_namespace_name((rel)->rd_rel->relnamespace)))},(union ListCell){.ptr_value=(makeString(pstrdup((rel->rd_rel->relname).data)))}' depends on order of evaluation of side effects
#15771|   		cmd->objtype = OBJECT_TABCONSTRAINT;
#15772|   		cmd->object = (Node *)
#15773|-> 			list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
#15774|   					   makeString(pstrdup(RelationGetRelationName(rel))),
#15775|   					   makeString(pstrdup(conname)));

Error: CPPCHECK_WARNING (CWE-768): [#def1336]
postgresql-18beta1/src/backend/commands/tablecmds.c:15773: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(get_namespace_name((rel)->rd_rel->relnamespace)))},(union ListCell){.ptr_value=(makeString(pstrdup((rel->rd_rel->relname).data)))},(union ListCell){.ptr_value=(makeString(pstrdup(conname)))}' depends on order of evaluation of side effects
#15771|   		cmd->objtype = OBJECT_TABCONSTRAINT;
#15772|   		cmd->object = (Node *)
#15773|-> 			list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
#15774|   					   makeString(pstrdup(RelationGetRelationName(rel))),
#15775|   					   makeString(pstrdup(conname)));

Error: CPPCHECK_WARNING (CWE-768): [#def1337]
postgresql-18beta1/src/backend/commands/tablecmds.c:15781: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeTypeNameFromNameList((__typeof__(domname))copyObjectImpl(domname)))},(union ListCell){.ptr_value=(makeString(pstrdup(conname)))}' depends on order of evaluation of side effects
#15779|   		cmd->objtype = OBJECT_DOMCONSTRAINT;
#15780|   		cmd->object = (Node *)
#15781|-> 			list_make2(makeTypeNameFromNameList(copyObject(domname)),
#15782|   					   makeString(pstrdup(conname)));
#15783|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def1338]
postgresql-18beta1/src/backend/commands/tablespace.c:1068: warning[uninitvar]: Uninitialized variable: repl_val
# 1066|   		repl_null[Anum_pg_tablespace_spcoptions - 1] = true;
# 1067|   	repl_repl[Anum_pg_tablespace_spcoptions - 1] = true;
# 1068|-> 	newtuple = heap_modify_tuple(tup, RelationGetDescr(rel), repl_val,
# 1069|   								 repl_null, repl_repl);
# 1070|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1339]
postgresql-18beta1/src/backend/executor/execJunk.c:176:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘t’
postgresql-18beta1/src/backend/executor/execJunk.c:137:1: enter_function: entry to ‘ExecInitJunkFilterConversion’
postgresql-18beta1/src/backend/executor/execJunk.c:166:12: branch_true: following ‘true’ branch (when ‘cleanLength > 0’)...
postgresql-18beta1/src/backend/executor/execJunk.c:168:43: branch_true: ...to here
postgresql-18beta1/src/backend/executor/execJunk.c:169:21: call_function: inlined call to ‘list_head’ from ‘ExecInitJunkFilterConversion’
postgresql-18beta1/src/backend/executor/execJunk.c:170:17: branch_false: ...to here
postgresql-18beta1/src/backend/executor/execJunk.c:170:29: branch_true: following ‘true’ branch (when ‘i < cleanLength’)...
postgresql-18beta1/src/backend/executor/execJunk.c:172:29: branch_true: ...to here
postgresql-18beta1/src/backend/executor/execJunk.c:176:46: danger: dereference of NULL ‘t’
#  174|   			for (;;)
#  175|   			{
#  176|-> 				TargetEntry *tle = lfirst(t);
#  177|   
#  178|   				t = lnext(targetList, t);

Error: CPPCHECK_WARNING (CWE-476): [#def1340]
postgresql-18beta1/src/backend/executor/execProcnode.c:391: warning[nullPointer]: Possible null pointer dereference: result
#  389|   	}
#  390|   
#  391|-> 	ExecSetExecProcNode(result, result->ExecProcNode);
#  392|   
#  393|   	/*

Error: CPPCHECK_WARNING (CWE-476): [#def1341]
postgresql-18beta1/src/backend/executor/execProcnode.c:412: warning[nullPointer]: Possible null pointer dereference: result
#  410|   		subps = lappend(subps, sstate);
#  411|   	}
#  412|-> 	result->initPlan = subps;
#  413|   
#  414|   	/* Set up instrumentation for this node if requested */

Error: CPPCHECK_WARNING (CWE-476): [#def1342]
postgresql-18beta1/src/backend/executor/execProcnode.c:438: error[ctunullpointer]: Null pointer dereference: node
#  436|   	 * means we'll superfluously execute ExecProcNodeFirst, but that seems ok.
#  437|   	 */
#  438|-> 	node->ExecProcNodeReal = function;
#  439|   	node->ExecProcNode = ExecProcNodeFirst;
#  440|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1343]
postgresql-18beta1/src/backend/executor/execProcnode.c:438: warning[nullPointer]: Possible null pointer dereference: node
#  436|   	 * means we'll superfluously execute ExecProcNodeFirst, but that seems ok.
#  437|   	 */
#  438|-> 	node->ExecProcNodeReal = function;
#  439|   	node->ExecProcNode = ExecProcNodeFirst;
#  440|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1344]
postgresql-18beta1/src/backend/executor/execProcnode.c:439: warning[nullPointer]: Possible null pointer dereference: node
#  437|   	 */
#  438|   	node->ExecProcNodeReal = function;
#  439|-> 	node->ExecProcNode = ExecProcNodeFirst;
#  440|   }
#  441|   

Error: CPPCHECK_WARNING (CWE-457): [#def1345]
postgresql-18beta1/src/backend/executor/execScan.c:148: error[legacyUninitvar]: Uninitialized variable: relids
#  146|   					 (int) nodeTag(node->ps.plan));
#  147|   
#  148|-> 			while ((rtindex = bms_next_member(relids, rtindex)) >= 0)
#  149|   			{
#  150|   				Assert(rtindex > 0);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1346]
postgresql-18beta1/src/backend/executor/execTuples.c:2474:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘isnull’
postgresql-18beta1/src/backend/executor/execTuples.c:2492:1: enter_function: entry to ‘do_text_output_multiline’
postgresql-18beta1/src/backend/executor/execTuples.c:2497:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/execTuples.c:2502:23: branch_true: ...to here
postgresql-18beta1/src/backend/executor/execTuples.c:2503:20: branch_true: following ‘true’ branch (when ‘eol’ is non-NULL)...
postgresql-18beta1/src/backend/executor/execTuples.c:2505:31: branch_true: ...to here
postgresql-18beta1/src/backend/executor/execTuples.c:2515:17: call_function: calling ‘do_tup_output’ from ‘do_text_output_multiline’
# 2472|   	/* insert data */
# 2473|   	memcpy(slot->tts_values, values, natts * sizeof(Datum));
# 2474|-> 	memcpy(slot->tts_isnull, isnull, natts * sizeof(bool));
# 2475|   
# 2476|   	/* mark slot as containing a virtual tuple */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1347]
postgresql-18beta1/src/backend/executor/nodeAgg.c:630:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pergroupstate’
postgresql-18beta1/src/backend/executor/nodeAgg.c:2137:1: enter_function: entry to ‘initialize_hash_entry’
postgresql-18beta1/src/backend/executor/nodeAgg.c:2150:39: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘initialize_hash_entry’
postgresql-18beta1/src/backend/executor/nodeAgg.c:2156:9: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeAgg.c:2156:27: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeAgg.c:2158:46: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeAgg.c:2161:17: call_function: calling ‘initialize_aggregate’ from ‘initialize_hash_entry’
#  628|   	 */
#  629|   	if (pertrans->initValueIsNull)
#  630|-> 		pergroupstate->transValue = pertrans->initValue;
#  631|   	else
#  632|   	{

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1348]
postgresql-18beta1/src/backend/executor/nodeAgg.c:636:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pergroupstate’
postgresql-18beta1/src/backend/executor/nodeAgg.c:2137:1: enter_function: entry to ‘initialize_hash_entry’
postgresql-18beta1/src/backend/executor/nodeAgg.c:2150:39: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘initialize_hash_entry’
postgresql-18beta1/src/backend/executor/nodeAgg.c:2156:9: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeAgg.c:2156:27: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeAgg.c:2158:46: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeAgg.c:2161:17: call_function: calling ‘initialize_aggregate’ from ‘initialize_hash_entry’
#  634|   
#  635|   		oldContext = MemoryContextSwitchTo(aggstate->curaggcontext->ecxt_per_tuple_memory);
#  636|-> 		pergroupstate->transValue = datumCopy(pertrans->initValue,
#  637|   											  pertrans->transtypeByVal,
#  638|   											  pertrans->transtypeLen);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1349]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1233:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1214:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1220:25: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1233:31: danger: dereference of NULL ‘leftop’
# 1231|   			Assert(leftop != NULL);
# 1232|   
# 1233|-> 			if (!(IsA(leftop, Var) &&
# 1234|   				  ((Var *) leftop)->varno == INDEX_VAR))
# 1235|   				elog(ERROR, "indexqual doesn't have key on left side");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1350]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1265:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1158:1: enter_function: entry to ‘ExecIndexBuildScanKeys’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1214:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1220:25: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1226:43: call_function: inlined call to ‘get_leftop’ from ‘ExecIndexBuildScanKeys’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1228:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1228:39: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1233:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1234:35: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1233:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1237:25: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1238:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1265:29: danger: dereference of NULL ‘rightop’
# 1263|   			Assert(rightop != NULL);
# 1264|   
# 1265|-> 			if (IsA(rightop, Const))
# 1266|   			{
# 1267|   				/* OK, simple constant comparison value */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1351]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1350:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1329:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1350:39: danger: dereference of NULL ‘leftop’
# 1348|   				Assert(leftop != NULL);
# 1349|   
# 1350|-> 				if (!(IsA(leftop, Var) &&
# 1351|   					  ((Var *) leftop)->varno == INDEX_VAR))
# 1352|   					elog(ERROR, "indexqual doesn't have key on left side");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1352]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1389:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1329:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1345:36: branch_true: following ‘true’ branch (when ‘leftop’ is non-NULL)...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1345:47: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1350:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1351:43: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1350:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1354:33: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1360:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1360:37: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1360:37: branch_false: following ‘false’ branch (when ‘varattno > 0’)...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1360:37: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1360:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1363:44: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1370:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1373:44: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1377:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1384:36: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1389:37: danger: dereference of NULL ‘rightop’
# 1387|   				Assert(rightop != NULL);
# 1388|   
# 1389|-> 				if (IsA(rightop, Const))
# 1390|   				{
# 1391|   					/* OK, simple constant comparison value */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1353]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1474:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1311:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1451:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1461:25: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1469:28: branch_false: following ‘false’ branch (when ‘leftop’ is NULL)...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1474:31: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1474:31: danger: dereference of NULL ‘leftop’
# 1472|   			Assert(leftop != NULL);
# 1473|   
# 1474|-> 			if (!(IsA(leftop, Var) &&
# 1475|   				  ((Var *) leftop)->varno == INDEX_VAR))
# 1476|   				elog(ERROR, "indexqual doesn't have key on left side");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1354]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1507:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1311:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1451:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1461:25: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1469:28: branch_true: following ‘true’ branch (when ‘leftop’ is non-NULL)...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1469:39: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1474:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1475:35: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1474:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1478:25: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1479:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1498:28: branch_false: following ‘false’ branch (when ‘rightop’ is NULL)...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1503:29: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1503:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1507:37: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1507:37: danger: dereference of NULL ‘rightop’
# 1505|   				/* Index AM will handle this like a simple operator */
# 1506|   				flags |= SK_SEARCHARRAY;
# 1507|-> 				if (IsA(rightop, Const))
# 1508|   				{
# 1509|   					/* OK, simple constant comparison value */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1355]
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1588:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1311:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1570:25: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1570:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1581:25: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1583:28: branch_false: following ‘false’ branch (when ‘leftop’ is NULL)...
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1588:31: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeIndexscan.c:1588:31: danger: dereference of NULL ‘leftop’
# 1586|   			Assert(leftop != NULL);
# 1587|   
# 1588|-> 			if (!(IsA(leftop, Var) &&
# 1589|   				  ((Var *) leftop)->varno == INDEX_VAR))
# 1590|   				elog(ERROR, "NullTest indexqual has wrong key");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1356]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:127:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pergroup’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:504:1: enter_function: entry to ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:517:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:519:32: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:528:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:539:28: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:540:17: call_function: calling ‘set_output_count’ from ‘setop_retrieve_hash_table’
#  125|   	{
#  126|   		case SETOPCMD_INTERSECT:
#  127|-> 			if (pergroup->numLeft > 0 && pergroup->numRight > 0)
#  128|   				setopstate->numOutput = 1;
#  129|   			else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1357]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:134:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pergroup’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:504:1: enter_function: entry to ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:517:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:519:32: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:528:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:539:28: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:540:17: call_function: calling ‘set_output_count’ from ‘setop_retrieve_hash_table’
#  132|   		case SETOPCMD_INTERSECT_ALL:
#  133|   			setopstate->numOutput =
#  134|-> 				(pergroup->numLeft < pergroup->numRight) ?
#  135|   				pergroup->numLeft : pergroup->numRight;
#  136|   			break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1358]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:138:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pergroup’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:504:1: enter_function: entry to ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:517:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:519:32: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:528:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:539:28: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:540:17: call_function: calling ‘set_output_count’ from ‘setop_retrieve_hash_table’
#  136|   			break;
#  137|   		case SETOPCMD_EXCEPT:
#  138|-> 			if (pergroup->numLeft > 0 && pergroup->numRight == 0)
#  139|   				setopstate->numOutput = 1;
#  140|   			else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1359]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:145:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pergroup’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:504:1: enter_function: entry to ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:517:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:519:32: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:528:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:539:28: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘setop_retrieve_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:540:17: call_function: calling ‘set_output_count’ from ‘setop_retrieve_hash_table’
#  143|   		case SETOPCMD_EXCEPT_ALL:
#  144|   			setopstate->numOutput =
#  145|-> 				(pergroup->numLeft < pergroup->numRight) ?
#  146|   				0 : (pergroup->numLeft - pergroup->numRight);
#  147|   			break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1360]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:446:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:433:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:444:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:446:25: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:446:25: danger: dereference of NULL ‘<unknown>’
#  444|   		if (isnew)
#  445|   		{
#  446|-> 			pergroup->numLeft = 0;
#  447|   			pergroup->numRight = 0;
#  448|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1361]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:451:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:433:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:444:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:451:17: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:451:17: danger: dereference of NULL ‘<unknown>’
#  449|   
#  450|   		/* Advance the counts */
#  451|-> 		pergroup->numLeft++;
#  452|   
#  453|   		/* Must reset expression context after each hashtable lookup */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1362]
postgresql-18beta1/src/backend/executor/nodeSetOp.c:487:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:407:1: enter_function: entry to ‘setop_fill_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:442:28: call_function: inlined call to ‘TupleHashEntryGetAdditional’ from ‘setop_fill_hash_table’
postgresql-18beta1/src/backend/executor/nodeSetOp.c:461:12: branch_true: following ‘true’ branch (when ‘have_tuples != 0’)...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:461:12: branch_true: ...to here
postgresql-18beta1/src/backend/executor/nodeSetOp.c:474:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeSetOp.c:487:33: danger: dereference of NULL ‘<unknown>’
#  485|   				SetOpStatePerGroup pergroup = TupleHashEntryGetAdditional(hashtable, entry);
#  486|   
#  487|-> 				pergroup->numRight++;
#  488|   			}
#  489|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1363]
postgresql-18beta1/src/backend/lib/pairingheap.c:275:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pairs’
postgresql-18beta1/src/backend/lib/pairingheap.c:251:20: branch_true: following ‘true’ branch (when ‘next’ is NULL)...
postgresql-18beta1/src/backend/lib/pairingheap.c:275:9: branch_true: ...to here
postgresql-18beta1/src/backend/lib/pairingheap.c:275:9: danger: dereference of NULL ‘pairs’
#  273|   	 */
#  274|   	newroot = pairs;
#  275|-> 	next = pairs->next_sibling;
#  276|   	while (next)
#  277|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1364]
postgresql-18beta1/src/backend/libpq/auth.c:673:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  671|   	StringInfoData buf;
#  672|   
#  673|-> 	CHECK_FOR_INTERRUPTS();
#  674|   
#  675|   	pq_beginmessage(&buf, PqMsg_AuthenticationRequest);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1365]
postgresql-18beta1/src/backend/libpq/auth.c:675:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  673|   	CHECK_FOR_INTERRUPTS();
#  674|   
#  675|-> 	pq_beginmessage(&buf, PqMsg_AuthenticationRequest);
#  676|   	pq_sendint32(&buf, (int32) areq);
#  677|   	if (extralen > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1366]
postgresql-18beta1/src/backend/libpq/auth.c:680:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  678|   		pq_sendbytes(&buf, extradata, extralen);
#  679|   
#  680|-> 	pq_endmessage(&buf);
#  681|   
#  682|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1367]
postgresql-18beta1/src/backend/libpq/auth.c:688:17: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  686|   	 */
#  687|   	if (areq != AUTH_REQ_OK && areq != AUTH_REQ_SASL_FIN)
#  688|-> 		pq_flush();
#  689|   
#  690|   	CHECK_FOR_INTERRUPTS();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1368]
postgresql-18beta1/src/backend/libpq/auth.c:690:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  688|   		pq_flush();
#  689|   
#  690|-> 	CHECK_FOR_INTERRUPTS();
#  691|   }
#  692|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1369]
postgresql-18beta1/src/backend/libpq/auth.c:704:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/src/backend/libpq/auth.c:1968:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  702|   	int			mtype;
#  703|   
#  704|-> 	pq_startmsgread();
#  705|   
#  706|   	/* Expect 'p' message type */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1370]
postgresql-18beta1/src/backend/libpq/auth.c:707:17: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/src/backend/libpq/auth.c:1968:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  705|   
#  706|   	/* Expect 'p' message type */
#  707|-> 	mtype = pq_getbyte();
#  708|   	if (mtype != PqMsg_PasswordMessage)
#  709|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1371]
postgresql-18beta1/src/backend/libpq/auth.c:716:25: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/src/backend/libpq/auth.c:1968:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  714|   		 */
#  715|   		if (mtype != EOF)
#  716|-> 			ereport(ERROR,
#  717|   					(errcode(ERRCODE_PROTOCOL_VIOLATION),
#  718|   					 errmsg("expected password response, got message type %d",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1372]
postgresql-18beta1/src/backend/libpq/auth.c:723:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/src/backend/libpq/auth.c:1968:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  721|   	}
#  722|   
#  723|-> 	initStringInfo(&buf);
#  724|   	if (pq_getmessage(&buf, PG_MAX_AUTH_TOKEN_LENGTH))	/* receive password */
#  725|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1373]
postgresql-18beta1/src/backend/libpq/auth.c:724:13: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18beta1/src/backend/libpq/auth.c:1968:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
#  722|   
#  723|   	initStringInfo(&buf);
#  724|-> 	if (pq_getmessage(&buf, PG_MAX_AUTH_TOKEN_LENGTH))	/* receive password */
#  725|   	{
#  726|   		/* EOF - pq_getmessage already logged a suitable message */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1374]
postgresql-18beta1/src/backend/libpq/auth.c:1985:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1980:43: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1980:54: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1980:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1982:33: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1985:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/src/backend/libpq/auth.c:1985:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
# 1983|   				break;
# 1984|   			case PAM_ERROR_MSG:
# 1985|-> 				ereport(LOG,
# 1986|   						(errmsg("error from underlying PAM layer: %s",
# 1987|   								msg[i]->msg)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1375]
postgresql-18beta1/src/backend/libpq/auth.c:1985:33: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1985:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/src/backend/libpq/auth.c:1985:33: danger: ‘reply’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1983|   				break;
# 1984|   			case PAM_ERROR_MSG:
# 1985|-> 				ereport(LOG,
# 1986|   						(errmsg("error from underlying PAM layer: %s",
# 1987|   								msg[i]->msg)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1376]
postgresql-18beta1/src/backend/libpq/auth.c:1996:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1980:43: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1980:54: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1980:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1982:33: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1996:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/src/backend/libpq/auth.c:1996:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/10)
# 1994|   				break;
# 1995|   			default:
# 1996|-> 				ereport(LOG,
# 1997|   						(errmsg("unsupported PAM conversation %d/\"%s\"",
# 1998|   								msg[i]->msg_style,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1377]
postgresql-18beta1/src/backend/libpq/auth.c:1996:33: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1996:33: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/src/backend/libpq/auth.c:1996:33: danger: ‘reply’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1994|   				break;
# 1995|   			default:
# 1996|-> 				ereport(LOG,
# 1997|   						(errmsg("unsupported PAM conversation %d/\"%s\"",
# 1998|   								msg[i]->msg_style,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1378]
postgresql-18beta1/src/backend/libpq/auth.c:2832:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data’
postgresql-18beta1/src/backend/libpq/auth.c:2932:1: enter_function: entry to ‘PerformRadiusTransaction’
postgresql-18beta1/src/backend/libpq/auth.c:2972:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:2986:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:2993:22: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:3010:21: branch_false: following ‘false’ branch (when ‘i >= encryptedpasswordlen’)...
postgresql-18beta1/src/backend/libpq/auth.c:3041:9: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:3043:9: call_function: calling ‘radius_add_attribute’ from ‘PerformRadiusTransaction’
# 2830|   	attr->attribute = type;
# 2831|   	attr->length = len + 2;		/* total size includes type and length */
# 2832|-> 	memcpy(attr->data, data, len);
# 2833|   	packet->length += attr->length;
# 2834|   }

Error: CPPCHECK_WARNING (CWE-457): [#def1379]
postgresql-18beta1/src/backend/libpq/auth.c:3043: warning[uninitvar]: Uninitialized variable: encryptedpassword
# 3041|   	pfree(cryptvector);
# 3042|   
# 3043|-> 	radius_add_attribute(packet, RADIUS_PASSWORD, encryptedpassword, encryptedpasswordlen);
# 3044|   
# 3045|   	/* Length needs to be in network order on the wire */

Error: CPPCHECK_WARNING (CWE-457): [#def1380]
postgresql-18beta1/src/backend/libpq/be-fsstubs.c:523: warning[uninitvar]: Uninitialized variable: fd
#  521|   	}
#  522|   	PG_END_TRY();
#  523|-> 	if (fd < 0)
#  524|   		ereport(ERROR,
#  525|   				(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1381]
postgresql-18beta1/src/backend/libpq/crypt.c:99:13: warning[-Wanalyzer-null-argument]: use of NULL ‘shadow_pass’ where non-null expected
postgresql-18beta1/src/backend/libpq/crypt.c:117:1: enter_function: entry to ‘encrypt_password’
postgresql-18beta1/src/backend/libpq/crypt.c:163:12: branch_false: following ‘false’ branch (when ‘encrypted_password’ is NULL)...
postgresql-18beta1/src/backend/libpq/crypt.c:179:13: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/crypt.c:179:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/crypt.c:180:17: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/crypt.c:180:17: call_function: calling ‘get_password_type’ from ‘encrypt_password’
#   97|   	uint8		server_key[SCRAM_MAX_KEY_LEN];
#   98|   
#   99|-> 	if (strncmp(shadow_pass, "md5", 3) == 0 &&
#  100|   		strlen(shadow_pass) == MD5_PASSWD_LEN &&
#  101|   		strspn(shadow_pass + 3, MD5_PASSWD_CHARSET) == MD5_PASSWD_LEN - 3)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1382]
postgresql-18beta1/src/backend/libpq/hba.c:1353:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/libpq/hba.c:1328:1: enter_function: entry to ‘parse_hba_line’
postgresql-18beta1/src/backend/libpq/hba.c:1352:17: call_function: inlined call to ‘list_head’ from ‘parse_hba_line’
postgresql-18beta1/src/backend/libpq/hba.c:1353:9: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/hba.c:1353:9: danger: dereference of NULL ‘<unknown>’
# 1351|   	Assert(tok_line->fields != NIL);
# 1352|   	field = list_head(tok_line->fields);
# 1353|-> 	tokens = lfirst(field);
# 1354|   	if (tokens->length > 1)
# 1355|   	{

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1383]
postgresql-18beta1/src/backend/libpq/hba.c:2768:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/libpq/hba.c:2751:1: enter_function: entry to ‘parse_ident_line’
postgresql-18beta1/src/backend/libpq/hba.c:2762:17: call_function: inlined call to ‘list_head’ from ‘parse_ident_line’
postgresql-18beta1/src/backend/libpq/hba.c:2764:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/hba.c:2768:9: danger: dereference of NULL ‘<unknown>’
# 2766|   
# 2767|   	/* Get the map token (must exist) */
# 2768|-> 	tokens = lfirst(field);
# 2769|   	IDENT_MULTI_VALUE(tokens);
# 2770|   	token = linitial(tokens);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1384]
postgresql-18beta1/src/backend/libpq/pqcomm.c:553:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
postgresql-18beta1/src/backend/libpq/pqcomm.c:447:12: branch_true: following ‘true’ branch (when ‘family == 1’)...
postgresql-18beta1/src/backend/libpq/pqcomm.c:453:17: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:454:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/pqcomm.c:462:21: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:473:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/pqcomm.c:488:28: branch_true: following ‘true’ branch (when ‘addr’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/pqcomm.c:490:20: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:490:20: branch_false: following ‘false’ branch (when ‘family == 1’)...
postgresql-18beta1/src/backend/libpq/pqcomm.c:500:21: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:500:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/pqcomm.c:509:25: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:529:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/pqcomm.c:541:27: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:541:27: acquire_resource: stream socket created here
postgresql-18beta1/src/backend/libpq/pqcomm.c:541:20: branch_false: following ‘false’ branch (when ‘fd != -1’)...
postgresql-18beta1/src/backend/libpq/pqcomm.c:553:21: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/pqcomm.c:553:21: throw: if ‘fcntl’ throws an exception...
postgresql-18beta1/src/backend/libpq/pqcomm.c:553:21: danger: ‘fd’ leaks here
#  551|   #ifndef WIN32
#  552|   		/* Don't give the listen socket to any subprograms we execute. */
#  553|-> 		if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
#  554|   			elog(FATAL, "fcntl(F_SETFD) failed on socket: %m");
#  555|   

Error: CPPCHECK_WARNING (CWE-768): [#def1385]
postgresql-18beta1/src/backend/nodes/makefuncs.c:714: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},(union ListCell){.ptr_value=(rightop)}' depends on order of evaluation of side effects
#  712|   	expr->inputcollid = inputcollid;
#  713|   	if (rightop)
#  714|-> 		expr->args = list_make2(leftop, rightop);
#  715|   	else
#  716|   		expr->args = list_make1(leftop);

Error: CPPCHECK_WARNING (CWE-768): [#def1386]
postgresql-18beta1/src/backend/nodes/makefuncs.c:786: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(qual1)},(union ListCell){.ptr_value=(qual2)}' depends on order of evaluation of side effects
#  784|   	if (qual2 == NULL)
#  785|   		return qual1;
#  786|-> 	return (Node *) make_andclause(list_make2(qual1, qual2));
#  787|   }
#  788|   

Error: CPPCHECK_WARNING (CWE-768): [#def1387]
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3931: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(rightop)},(union ListCell){.ptr_value=(leftop)}' depends on order of evaluation of side effects
# 3929|   		newclause->opno = expr_op;
# 3930|   		newclause->opfuncid = InvalidOid;
# 3931|-> 		newclause->args = list_make2(rightop, leftop);
# 3932|   
# 3933|   		clause = (Expr *) newclause;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1388]
postgresql-18beta1/src/backend/optimizer/plan/analyzejoins.c:1227:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18beta1/src/backend/optimizer/plan/analyzejoins.c:973:1: enter_function: entry to ‘rel_is_distinct_for’
postgresql-18beta1/src/backend/optimizer/plan/analyzejoins.c:1053:21: call_function: calling ‘query_is_distinct_for’ from ‘rel_is_distinct_for’
# 1225|   				/* non-resjunk columns should have grouping clauses */
# 1226|   				Assert(lg != NULL);
# 1227|-> 				sgc = (SortGroupClause *) lfirst(lg);
# 1228|   				lg = lnext(topop->groupClauses, lg);
# 1229|   

Error: CPPCHECK_WARNING (CWE-768): [#def1389]
postgresql-18beta1/src/backend/optimizer/plan/initsplan.c:1417: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftjoinlist)},(union ListCell){.ptr_value=(rightjoinlist)}' depends on order of evaluation of side effects
# 1415|   		{
# 1416|   			/* force the join order exactly at this node */
# 1417|-> 			joinlist = list_make1(list_make2(leftjoinlist, rightjoinlist));
# 1418|   		}
# 1419|   		else if (list_length(leftjoinlist) + list_length(rightjoinlist) <=

Error: CPPCHECK_WARNING (CWE-768): [#def1390]
postgresql-18beta1/src/backend/optimizer/plan/initsplan.c:1440: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftpart)},(union ListCell){.ptr_value=(rightpart)}' depends on order of evaluation of side effects
# 1438|   			else
# 1439|   				rightpart = (Node *) rightjoinlist;
# 1440|-> 			joinlist = list_make2(leftpart, rightpart);
# 1441|   		}
# 1442|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1391]
postgresql-18beta1/src/backend/optimizer/plan/initsplan.c:2900:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sjinfo’
postgresql-18beta1/src/backend/optimizer/plan/initsplan.c:1616:1: enter_function: entry to ‘process_security_barrier_quals’
postgresql-18beta1/src/backend/optimizer/plan/initsplan.c:1629:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/initsplan.c:1639:17: call_function: calling ‘distribute_quals_to_rels’ from ‘process_security_barrier_quals’
# 2898|   				return;
# 2899|   			}
# 2900|-> 			if (sjinfo->jointype == JOIN_FULL)
# 2901|   			{
# 2902|   				/* FULL JOIN (above tests cannot match in this case) */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1392]
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4058:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partially_grouped_rel’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4024:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4045:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4045:9: release_memory: ‘partially_grouped_rel’ is NULL
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4048:12: branch_false: following ‘false’ branch (when ‘patype == 0’)...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4054:13: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4054:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4058:21: branch_true: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:4058:21: danger: dereference of NULL ‘partially_grouped_rel’
# 4056|   		Assert(partially_grouped_rel);
# 4057|   
# 4058|-> 		if (partially_grouped_rel->pathlist)
# 4059|   			set_cheapest(partially_grouped_rel);
# 4060|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1393]
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5737:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘orig_tlist_item’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5722:1: enter_function: entry to ‘postprocess_setop_tlist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5725:39: call_function: inlined call to ‘list_head’ from ‘postprocess_setop_tlist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5727:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5727:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5733:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5737:17: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:5737:17: danger: dereference of NULL ‘orig_tlist_item’
# 5735|   
# 5736|   		Assert(orig_tlist_item != NULL);
# 5737|-> 		orig_tle = lfirst_node(TargetEntry, orig_tlist_item);
# 5738|   		orig_tlist_item = lnext(orig_tlist, orig_tlist_item);
# 5739|   		if (orig_tle->resjunk)	/* should not happen */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1394]
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8229:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8204:1: enter_function: entry to ‘generate_setop_child_grouplist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8211:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8212:24: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8212:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8213:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8213:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8220:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8229:17: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8229:17: danger: dereference of NULL ‘lg’
# 8227|   		Assert(lg != NULL);
# 8228|   		Assert(ct != NULL);
# 8229|-> 		sgc = (SortGroupClause *) lfirst(lg);
# 8230|   		coltype = lfirst_oid(ct);
# 8231|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1395]
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8230:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ct’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8204:1: enter_function: entry to ‘generate_setop_child_grouplist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8211:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8212:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8213:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8213:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8220:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8229:17: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:8230:17: danger: dereference of NULL ‘ct’
# 8228|   		Assert(ct != NULL);
# 8229|   		sgc = (SortGroupClause *) lfirst(lg);
# 8230|-> 		coltype = lfirst_oid(ct);
# 8231|   
# 8232|   		/* reject if target type isn't the same as the setop target type */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1396]
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:2090:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*root.grouping_map’
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3633:1: enter_function: entry to ‘extract_query_dependencies’
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3653:16: call_function: calling ‘extract_query_dependencies_walker’ from ‘extract_query_dependencies’
# 2088|   	{
# 2089|   		GroupingFunc *g = (GroupingFunc *) node;
# 2090|-> 		AttrNumber *grouping_map = root->grouping_map;
# 2091|   
# 2092|   		/* If there are no grouping sets, we don't need this. */

Error: CPPCHECK_WARNING (CWE-476): [#def1397]
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:2186: warning[nullPointer]: Possible null pointer dereference: bestplan
# 2184|   
# 2185|   	/* Mark the subplan we selected */
# 2186|-> 	root->isUsedSubplan[bestplan->plan_id - 1] = true;
# 2187|   
# 2188|   	return (Node *) bestplan;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1398]
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:2186:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bestplan’
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3124:1: enter_function: entry to ‘fix_join_expr_mutator’
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3128:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3130:13: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3130:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3186:12: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3232:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3234:12: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3234:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3235:24: branch_true: ...to here
postgresql-18beta1/src/backend/optimizer/plan/setrefs.c:3235:24: call_function: calling ‘fix_alternative_subplan’ from ‘fix_join_expr_mutator’
# 2184|   
# 2185|   	/* Mark the subplan we selected */
# 2186|-> 	root->isUsedSubplan[bestplan->plan_id - 1] = true;
# 2187|   
# 2188|   	return (Node *) bestplan;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1399]
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:121:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘target_rte’
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:80:12: branch_false: following ‘false’ branch (when ‘result_relation == 0’)...
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:105:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:106:12: branch_false: following ‘false’ branch (when ‘command_type != 3’)...
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:108:17: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:108:17: branch_false: following ‘false’ branch (when ‘command_type != 2’)...
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:119:14: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:121:18: danger: dereference of NULL ‘target_rte’
#  119|   	if ((command_type == CMD_UPDATE || command_type == CMD_DELETE ||
#  120|   		 command_type == CMD_MERGE) &&
#  121|-> 		!target_rte->inh)
#  122|   	{
#  123|   		/* row-identity logic expects to add stuff to processed_tlist */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1400]
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:398:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:64:1: enter_function: entry to ‘preprocess_targetlist’
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:80:12: branch_false: following ‘false’ branch (when ‘result_relation == 0’)...
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:105:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:106:12: branch_true: following ‘true’ branch (when ‘command_type == 3’)...
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:107:25: branch_true: ...to here
postgresql-18beta1/src/backend/optimizer/prep/preptlist.c:107:25: call_function: calling ‘expand_insert_targetlist’ from ‘preprocess_targetlist’
#  396|   	 * sure we have all the user attributes in the right order.
#  397|   	 */
#  398|-> 	numattrs = RelationGetNumberOfAttributes(rel);
#  399|   
#  400|   	for (attrno = 1; attrno <= numattrs; attrno++)

Error: CPPCHECK_WARNING (CWE-768): [#def1401]
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:413: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lpath_tlist)},(union ListCell){.ptr_value=(rpath_tlist)}' depends on order of evaluation of side effects
#  411|   	 */
#  412|   	tlist = generate_append_tlist(setOp->colTypes, setOp->colCollations,
#  413|-> 								  list_make2(lpath_tlist, rpath_tlist),
#  414|   								  refnames_tlist);
#  415|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1402]
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1521:64: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘curColType’
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1508:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1515:17: branch_true: following ‘true’ branch (when ‘subtlist’ is non-NULL)...
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1515:17: branch_true: ...to here
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1521:64: danger: dereference of NULL ‘curColType’
# 1519|   			Assert(!subtle->resjunk);
# 1520|   			Assert(curColType != NULL);
# 1521|-> 			if (exprType((Node *) subtle->expr) == lfirst_oid(curColType))
# 1522|   			{
# 1523|   				/* If first subplan, copy the typmod; else compare */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1403]
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1613:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1594:1: enter_function: entry to ‘generate_setop_grouplist’
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1600:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_grouplist’
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1601:9: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1601:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/prep/prepunion.c:1613:17: danger: dereference of NULL ‘lg’
# 1611|   		/* non-resjunk columns should have grouping clauses */
# 1612|   		Assert(lg != NULL);
# 1613|-> 		sgc = (SortGroupClause *) lfirst(lg);
# 1614|   		lg = lnext(grouplist, lg);
# 1615|   		Assert(sgc->tleSortGroupRef == 0);

Error: COMPILER_WARNING (CWE-457): [#def1404]
postgresql-18beta1/src/backend/optimizer/util/clauses.c: scope_hint: In function ‘recheck_cast_function_args.isra.0’
postgresql-18beta1/src/backend/optimizer/util/clauses.c:4404:19: warning[-Wmaybe-uninitialized]: ‘actual_arg_types’ may be used uninitialized
# 4404 |         rettype = enforce_generic_type_consistency(actual_arg_types,
#      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4405 |                                                                                            declared_arg_types,
#      |                                                                                            ~~~~~~~~~~~~~~~~~~~
# 4406 |                                                                                            nargs,
#      |                                                                                            ~~~~~~
# 4407 |                                                                                            funcform->prorettype,
#      |                                                                                            ~~~~~~~~~~~~~~~~~~~~~
# 4408 |                                                                                            false);
#      |                                                                                            ~~~~~~
postgresql-18beta1/src/backend/optimizer/util/clauses.c:42: included_from: Included from here.
postgresql-18beta1/src/include/parser/parse_coerce.h:85:17: note: by argument 1 of type ‘const Oid *’ to ‘enforce_generic_type_consistency’ declared here
#   85 | extern Oid      enforce_generic_type_consistency(const Oid *actual_arg_types,
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
postgresql-18beta1/src/backend/optimizer/util/clauses.c:4390:33: note: ‘actual_arg_types’ declared here
# 4390 |         Oid                     actual_arg_types[FUNC_MAX_ARGS];
#      |                                 ^~~~~~~~~~~~~~~~
# 4402|   	Assert(nargs == pronargs);
# 4403|   	memcpy(declared_arg_types, proargtypes, pronargs * sizeof(Oid));
# 4404|-> 	rettype = enforce_generic_type_consistency(actual_arg_types,
# 4405|   											   declared_arg_types,
# 4406|   											   nargs,

Error: CPPCHECK_WARNING (CWE-768): [#def1405]
postgresql-18beta1/src/backend/optimizer/util/relnode.c:2483: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(larg)},(union ListCell){.ptr_value=(rarg)}' depends on order of evaluation of side effects
# 2481|   						c->coalescetype = exprType(larg);
# 2482|   						c->coalescecollid = exprCollation(larg);
# 2483|-> 						c->args = list_make2(larg, rarg);
# 2484|   						c->location = -1;
# 2485|   						nullable_partexpr = lappend(nullable_partexpr, c);

Error: CPPCHECK_WARNING (CWE-768): [#def1406]
postgresql-18beta1/src/backend/optimizer/util/restrictinfo.c:365: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=((list_nth_cell(clause->args,1)->ptr_value))}),((union ListCell){.ptr_value=((list_nth_cell(clause->args,0)->ptr_value))})' depends on order of evaluation of side effects
#  363|   	newclause->opno = comm_op;
#  364|   	newclause->opfuncid = InvalidOid;
#  365|-> 	newclause->args = list_make2(lsecond(clause->args),
#  366|   								 linitial(clause->args));
#  367|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1407]
postgresql-18beta1/src/backend/parser/analyze.c:368:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘stmt’
postgresql-18beta1/src/backend/parser/analyze.c:3246:1: enter_function: entry to ‘transformCreateTableAsStmt’
postgresql-18beta1/src/backend/parser/analyze.c:3252:17: call_function: calling ‘transformStmt’ from ‘transformCreateTableAsStmt’
#  366|   		Assert(stmt && IsA(stmt, SelectStmt) && stmt->larg == NULL);
#  367|   
#  368|-> 		if (stmt->intoClause)
#  369|   		{
#  370|   			CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1408]
postgresql-18beta1/src/backend/parser/analyze.c:1870:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftmostSelect’
postgresql-18beta1/src/backend/parser/analyze.c:3246:1: enter_function: entry to ‘transformCreateTableAsStmt’
postgresql-18beta1/src/backend/parser/analyze.c:3252:17: call_function: calling ‘transformStmt’ from ‘transformCreateTableAsStmt’
# 1868|   	Assert(leftmostSelect && IsA(leftmostSelect, SelectStmt) &&
# 1869|   		   leftmostSelect->larg == NULL);
# 1870|-> 	if (leftmostSelect->intoClause)
# 1871|   		ereport(ERROR,
# 1872|   				(errcode(ERRCODE_SYNTAX_ERROR),

Error: CPPCHECK_WARNING (CWE-768): [#def1409]
postgresql-18beta1/src/backend/parser/analyze.c:2335: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2333|   			/* select common type, same as CASE et al */
# 2334|   			rescoltype = select_common_type(pstate,
# 2335|-> 											list_make2(lcolnode, rcolnode),
# 2336|   											context,
# 2337|   											&bestexpr);

Error: CPPCHECK_WARNING (CWE-768): [#def1410]
postgresql-18beta1/src/backend/parser/analyze.c:2390: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2388|   
# 2389|   			rescoltypmod = select_common_typmod(pstate,
# 2390|-> 												list_make2(lcolnode, rcolnode),
# 2391|   												rescoltype);
# 2392|   

Error: CPPCHECK_WARNING (CWE-768): [#def1411]
postgresql-18beta1/src/backend/parser/analyze.c:2403: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2401|   			 */
# 2402|   			rescolcoll = select_common_collation(pstate,
# 2403|-> 												 list_make2(lcolnode, rcolnode),
# 2404|   												 (op->op == SETOP_UNION && op->all));
# 2405|   

Error: CPPCHECK_WARNING (CWE-768): [#def1412]
postgresql-18beta1/src/backend/parser/gram.y:1879: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(0x7FFF,-1))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-2].ival,yylsp[-2]))})' depends on order of evaluation of side effects
# 1877|   					TypeName   *t = $1;
# 1878|   
# 1879|-> 					t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
# 1880|   											makeIntConst($3, @3));
# 1881|   					$$ = makeStringConstCast($5, @5, t);

Error: CPPCHECK_WARNING (CWE-768): [#def1413]
postgresql-18beta1/src/backend/parser/gram.y:4428: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[-1].node)}' depends on order of evaluation of side effects
# 4426|   
# 4427|   opt_column_and_period_list:
# 4428|-> 			'(' columnList optionalPeriodName ')'			{ $$ = list_make2($2, $3); }
# 4429|   			| /*EMPTY*/								{ $$ = list_make2(NIL, NULL); }
# 4430|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1414]
postgresql-18beta1/src/backend/parser/gram.y:4429: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((struct List*)NULL)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
# 4427|   opt_column_and_period_list:
# 4428|   			'(' columnList optionalPeriodName ')'			{ $$ = list_make2($2, $3); }
# 4429|-> 			| /*EMPTY*/								{ $$ = list_make2(NIL, NULL); }
# 4430|   		;
# 4431|   

Error: CPPCHECK_WARNING (CWE-768): [#def1415]
postgresql-18beta1/src/backend/parser/gram.y:4472: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].ielem)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
# 4470|   ExclusionConstraintElem: index_elem WITH any_operator
# 4471|   			{
# 4472|-> 				$$ = list_make2($1, $3);
# 4473|   			}
# 4474|   			/* allow OPERATOR() decoration for the benefit of ruleutils.c */

Error: CPPCHECK_WARNING (CWE-768): [#def1416]
postgresql-18beta1/src/backend/parser/gram.y:4477: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-5].ielem)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
# 4475|   			| index_elem WITH OPERATOR '(' any_operator ')'
# 4476|   			{
# 4477|-> 				$$ = list_make2($1, $5);
# 4478|   			}
# 4479|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1417]
postgresql-18beta1/src/backend/parser/gram.y:5344: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(yyvsp[-1].typnam)}' depends on order of evaluation of side effects
# 5342|   					n->action = $4;
# 5343|   					n->objtype = OBJECT_CAST;
# 5344|-> 					n->object = (Node *) list_make2($7, $9);
# 5345|   					$$ = (Node *) n;
# 5346|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1418]
postgresql-18beta1/src/backend/parser/gram.y:5424: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].typnam)},(union ListCell){.ptr_value=(makeString(yyvsp[0].str))}' depends on order of evaluation of side effects
# 5422|   					n->action = $4;
# 5423|   					n->objtype = OBJECT_TRANSFORM;
# 5424|-> 					n->object = (Node *) list_make2($7, makeString($9));
# 5425|   					$$ = (Node *) n;
# 5426|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1419]
postgresql-18beta1/src/backend/parser/gram.y:6091: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(events1|events2))},((union ListCell){.ptr_value=(list_concat(columns1,columns2))})' depends on order of evaluation of side effects
# 6089|   					 * should just ignore the columns for non-UPDATE events.
# 6090|   					 */
# 6091|-> 					$$ = list_make2(makeInteger(events1 | events2),
# 6092|   									list_concat(columns1, columns2));
# 6093|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1420]
postgresql-18beta1/src/backend/parser/gram.y:6098: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<2))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 6096|   TriggerOneEvent:
# 6097|   			INSERT
# 6098|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
# 6099|   			| DELETE_P
# 6100|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }

Error: CPPCHECK_WARNING (CWE-768): [#def1421]
postgresql-18beta1/src/backend/parser/gram.y:6100: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<3))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 6098|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
# 6099|   			| DELETE_P
# 6100|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
# 6101|   			| UPDATE
# 6102|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }

Error: CPPCHECK_WARNING (CWE-768): [#def1422]
postgresql-18beta1/src/backend/parser/gram.y:6102: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<4))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 6100|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
# 6101|   			| UPDATE
# 6102|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
# 6103|   			| UPDATE OF columnList
# 6104|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }

Error: CPPCHECK_WARNING (CWE-768): [#def1423]
postgresql-18beta1/src/backend/parser/gram.y:6104: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<4))},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
# 6102|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
# 6103|   			| UPDATE OF columnList
# 6104|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
# 6105|   			| TRUNCATE
# 6106|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }

Error: CPPCHECK_WARNING (CWE-768): [#def1424]
postgresql-18beta1/src/backend/parser/gram.y:6106: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeInteger(1<<5))},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
# 6104|   				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
# 6105|   			| TRUNCATE
# 6106|-> 				{ $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }
# 6107|   		;
# 6108|   

Error: CPPCHECK_WARNING (CWE-768): [#def1425]
postgresql-18beta1/src/backend/parser/gram.y:7238: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeTypeNameFromNameList(yyvsp[-2].list))},(union ListCell){.ptr_value=(makeString(yyvsp[-5].str))}' depends on order of evaluation of side effects
# 7236|   					 * up here.
# 7237|   					 */
# 7238|-> 					n->object = (Node *) list_make2(makeTypeNameFromNameList($7), makeString($4));
# 7239|   					n->comment = $9;
# 7240|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def1426]
postgresql-18beta1/src/backend/parser/gram.y:7274: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].typnam)},(union ListCell){.ptr_value=(makeString(yyvsp[-2].str))}' depends on order of evaluation of side effects
# 7272|   
# 7273|   					n->objtype = OBJECT_TRANSFORM;
# 7274|-> 					n->object = (Node *) list_make2($5, makeString($7));
# 7275|   					n->comment = $9;
# 7276|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def1427]
postgresql-18beta1/src/backend/parser/gram.y:7310: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-5].typnam)},(union ListCell){.ptr_value=(yyvsp[-3].typnam)}' depends on order of evaluation of side effects
# 7308|   
# 7309|   					n->objtype = OBJECT_CAST;
# 7310|-> 					n->object = (Node *) list_make2($5, $7);
# 7311|   					n->comment = $10;
# 7312|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def1428]
postgresql-18beta1/src/backend/parser/gram.y:8669: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((struct List*)NULL)},(union ListCell){.ptr_value=(makeInteger(-1))}' depends on order of evaluation of side effects
# 8667|   aggr_args:	'(' '*' ')'
# 8668|   				{
# 8669|-> 					$$ = list_make2(NIL, makeInteger(-1));
# 8670|   				}
# 8671|   			| '(' aggr_args_list ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1429]
postgresql-18beta1/src/backend/parser/gram.y:8673: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].list)},(union ListCell){.ptr_value=(makeInteger(-1))}' depends on order of evaluation of side effects
# 8671|   			| '(' aggr_args_list ')'
# 8672|   				{
# 8673|-> 					$$ = list_make2($2, makeInteger(-1));
# 8674|   				}
# 8675|   			| '(' ORDER BY aggr_args_list ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1430]
postgresql-18beta1/src/backend/parser/gram.y:8677: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].list)},(union ListCell){.ptr_value=(makeInteger(0))}' depends on order of evaluation of side effects
# 8675|   			| '(' ORDER BY aggr_args_list ')'
# 8676|   				{
# 8677|-> 					$$ = list_make2($4, makeInteger(0));
# 8678|   				}
# 8679|   			| '(' aggr_args_list ORDER BY aggr_args_list ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1431]
postgresql-18beta1/src/backend/parser/gram.y:8821: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(yyvsp[-2].str))},(union ListCell){.ptr_value=(makeString(yyvsp[0].str))}' depends on order of evaluation of side effects
# 8819|   			| Sconst ',' Sconst
# 8820|   				{
# 8821|-> 					$$ = list_make2(makeString($1), makeString($3));
# 8822|   				}
# 8823|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1432]
postgresql-18beta1/src/backend/parser/gram.y:9101: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(yyvsp[-1].typnam)}' depends on order of evaluation of side effects
# 9099|   				}
# 9100|   			| '(' Typename ',' Typename ')'
# 9101|-> 					{ $$ = list_make2($2, $4); }
# 9102|   			| '(' NONE ',' Typename ')'					/* left unary */
# 9103|   					{ $$ = list_make2(NULL, $4); }

Error: CPPCHECK_WARNING (CWE-768): [#def1433]
postgresql-18beta1/src/backend/parser/gram.y:9103: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[-1].typnam)}' depends on order of evaluation of side effects
# 9101|   					{ $$ = list_make2($2, $4); }
# 9102|   			| '(' NONE ',' Typename ')'					/* left unary */
# 9103|-> 					{ $$ = list_make2(NULL, $4); }
# 9104|   			| '(' Typename ',' NONE ')'					/* right unary */
# 9105|   					{ $$ = list_make2($2, NULL); }

Error: CPPCHECK_WARNING (CWE-768): [#def1434]
postgresql-18beta1/src/backend/parser/gram.y:9105: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
# 9103|   					{ $$ = list_make2(NULL, $4); }
# 9104|   			| '(' Typename ',' NONE ')'					/* right unary */
# 9105|-> 					{ $$ = list_make2($2, NULL); }
# 9106|   		;
# 9107|   

Error: CPPCHECK_WARNING (CWE-768): [#def1435]
postgresql-18beta1/src/backend/parser/gram.y:9221: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].typnam)},(union ListCell){.ptr_value=(yyvsp[-2].typnam)}' depends on order of evaluation of side effects
# 9219|   
# 9220|   					n->removeType = OBJECT_CAST;
# 9221|-> 					n->objects = list_make1(list_make2($5, $7));
# 9222|   					n->behavior = $9;
# 9223|   					n->missing_ok = $3;

Error: CPPCHECK_WARNING (CWE-768): [#def1436]
postgresql-18beta1/src/backend/parser/gram.y:9255: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].objwithargs)},(union ListCell){.ptr_value=(yyvsp[0].objwithargs)}' depends on order of evaluation of side effects
# 9253|   transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes
# 9254|   				{
# 9255|-> 					$$ = list_make2($5, $11);
# 9256|   				}
# 9257|   				| TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes

Error: CPPCHECK_WARNING (CWE-768): [#def1437]
postgresql-18beta1/src/backend/parser/gram.y:9259: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].objwithargs)},(union ListCell){.ptr_value=(yyvsp[-6].objwithargs)}' depends on order of evaluation of side effects
# 9257|   				| TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes
# 9258|   				{
# 9259|-> 					$$ = list_make2($11, $5);
# 9260|   				}
# 9261|   				| FROM SQL_P WITH FUNCTION function_with_argtypes

Error: CPPCHECK_WARNING (CWE-768): [#def1438]
postgresql-18beta1/src/backend/parser/gram.y:9263: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].objwithargs)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
# 9261|   				| FROM SQL_P WITH FUNCTION function_with_argtypes
# 9262|   				{
# 9263|-> 					$$ = list_make2($5, NULL);
# 9264|   				}
# 9265|   				| TO SQL_P WITH FUNCTION function_with_argtypes

Error: CPPCHECK_WARNING (CWE-768): [#def1439]
postgresql-18beta1/src/backend/parser/gram.y:9267: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[0].objwithargs)}' depends on order of evaluation of side effects
# 9265|   				| TO SQL_P WITH FUNCTION function_with_argtypes
# 9266|   				{
# 9267|-> 					$$ = list_make2(NULL, $5);
# 9268|   				}
# 9269|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1440]
postgresql-18beta1/src/backend/parser/gram.y:9277: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].typnam)},(union ListCell){.ptr_value=(makeString(yyvsp[-1].str))}' depends on order of evaluation of side effects
# 9275|   
# 9276|   					n->removeType = OBJECT_TRANSFORM;
# 9277|-> 					n->objects = list_make1(list_make2($5, makeString($7)));
# 9278|   					n->behavior = $8;
# 9279|   					n->missing_ok = $3;

Error: CPPCHECK_WARNING (CWE-768): [#def1441]
postgresql-18beta1/src/backend/parser/gram.y:11755: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
#11753|   					n->cfgname = $5;
#11754|   					n->tokentype = NIL;
#11755|-> 					n->dicts = list_make2($9,$11);
#11756|   					n->override = false;
#11757|   					n->replace = true;

Error: CPPCHECK_WARNING (CWE-768): [#def1442]
postgresql-18beta1/src/backend/parser/gram.y:11767: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
#11765|   					n->cfgname = $5;
#11766|   					n->tokentype = $9;
#11767|-> 					n->dicts = list_make2($11,$13);
#11768|   					n->override = false;
#11769|   					n->replace = true;

Error: CPPCHECK_WARNING (CWE-768): [#def1443]
postgresql-18beta1/src/backend/parser/gram.y:13879: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].alias)},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
#13877|   			alias_clause
#13878|   				{
#13879|-> 					$$ = list_make2($1, NIL);
#13880|   				}
#13881|   			| AS '(' TableFuncElementList ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1444]
postgresql-18beta1/src/backend/parser/gram.y:13883: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
#13881|   			| AS '(' TableFuncElementList ')'
#13882|   				{
#13883|-> 					$$ = list_make2(NULL, $3);
#13884|   				}
#13885|   			| AS ColId '(' TableFuncElementList ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1445]
postgresql-18beta1/src/backend/parser/gram.y:13890: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(a)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
#13888|   
#13889|   					a->aliasname = $2;
#13890|-> 					$$ = list_make2(a, $4);
#13891|   				}
#13892|   			| ColId '(' TableFuncElementList ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1446]
postgresql-18beta1/src/backend/parser/gram.y:13897: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(a)},(union ListCell){.ptr_value=(yyvsp[-1].list)}' depends on order of evaluation of side effects
#13895|   
#13896|   					a->aliasname = $1;
#13897|-> 					$$ = list_make2(a, $3);
#13898|   				}
#13899|   			| /*EMPTY*/

Error: CPPCHECK_WARNING (CWE-768): [#def1447]
postgresql-18beta1/src/backend/parser/gram.y:13901: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
#13899|   			| /*EMPTY*/
#13900|   				{
#13901|-> 					$$ = list_make2(NULL, NIL);
#13902|   				}
#13903|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1448]
postgresql-18beta1/src/backend/parser/gram.y:13930: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].list)},(union ListCell){.ptr_value=(yyvsp[0].alias)}' depends on order of evaluation of side effects
#13928|   join_qual: USING '(' name_list ')' opt_alias_clause_for_join_using
#13929|   				{
#13930|-> 					$$ = (Node *) list_make2($3, $5);
#13931|   				}
#13932|   			| ON a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1449]
postgresql-18beta1/src/backend/parser/gram.y:14056: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].node)},(union ListCell){.ptr_value=((struct List*)NULL)}' depends on order of evaluation of side effects
#14054|   					n->ordinality = $2;
#14055|   					n->is_rowsfrom = false;
#14056|-> 					n->functions = list_make1(list_make2($1, NIL));
#14057|   					/* alias and coldeflist are set by table_ref production */
#14058|   					$$ = (Node *) n;

Error: CPPCHECK_WARNING (CWE-768): [#def1450]
postgresql-18beta1/src/backend/parser/gram.y:14074: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-1].node)},(union ListCell){.ptr_value=(yyvsp[0].list)}' depends on order of evaluation of side effects
#14072|   
#14073|   rowsfrom_item: func_expr_windowless opt_col_def_list
#14074|-> 				{ $$ = list_make2($1, $2); }
#14075|   		;
#14076|   

Error: CPPCHECK_WARNING (CWE-768): [#def1451]
postgresql-18beta1/src/backend/parser/gram.y:14528: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(0x7FFF,-1))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-1].ival,yylsp[-1]))})' depends on order of evaluation of side effects
#14526|   				{
#14527|   					$$ = $1;
#14528|-> 					$$->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
#14529|   											 makeIntConst($3, @3));
#14530|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1452]
postgresql-18beta1/src/backend/parser/gram.y:14914: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(1<<12,yylsp[-3]))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-1].ival,yylsp[-1]))})' depends on order of evaluation of side effects
#14912|   			| SECOND_P '(' Iconst ')'
#14913|   				{
#14914|-> 					$$ = list_make2(makeIntConst(INTERVAL_MASK(SECOND), @1),
#14915|   									makeIntConst($3, @3));
#14916|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1453]
postgresql-18beta1/src/backend/parser/gram.y:14970: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)}' depends on order of evaluation of side effects
#14968|   				{
#14969|   					$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
#14970|-> 											   list_make2($5, $1),
#14971|   											   COERCE_SQL_SYNTAX,
#14972|   											   @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1454]
postgresql-18beta1/src/backend/parser/gram.y:15041: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15039|   				{
#15040|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#15041|-> 												 list_make2($3, $5),
#15042|   												 COERCE_EXPLICIT_CALL,
#15043|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1455]
postgresql-18beta1/src/backend/parser/gram.y:15055: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15053|   				{
#15054|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#15055|-> 												 list_make2($4, $6),
#15056|   												 COERCE_EXPLICIT_CALL,
#15057|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1456]
postgresql-18beta1/src/backend/parser/gram.y:15069: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15067|   				{
#15068|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#15069|-> 												 list_make2($3, $5),
#15070|   												 COERCE_EXPLICIT_CALL,
#15071|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1457]
postgresql-18beta1/src/backend/parser/gram.y:15083: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15081|   				{
#15082|   					FuncCall   *n = makeFuncCall(SystemFuncName("like_escape"),
#15083|-> 												 list_make2($4, $6),
#15084|   												 COERCE_EXPLICIT_CALL,
#15085|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1458]
postgresql-18beta1/src/backend/parser/gram.y:15102: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15100|   				{
#15101|   					FuncCall   *n = makeFuncCall(SystemFuncName("similar_to_escape"),
#15102|-> 												 list_make2($4, $6),
#15103|   												 COERCE_EXPLICIT_CALL,
#15104|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1459]
postgresql-18beta1/src/backend/parser/gram.y:15120: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15118|   				{
#15119|   					FuncCall   *n = makeFuncCall(SystemFuncName("similar_to_escape"),
#15120|-> 												 list_make2($5, $7),
#15121|   												 COERCE_EXPLICIT_CALL,
#15122|   												 @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1460]
postgresql-18beta1/src/backend/parser/gram.y:15256: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15254|   												   "BETWEEN",
#15255|   												   $1,
#15256|-> 												   (Node *) list_make2($4, $6),
#15257|   												   @2);
#15258|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1461]
postgresql-18beta1/src/backend/parser/gram.y:15264: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15262|   												   "NOT BETWEEN",
#15263|   												   $1,
#15264|-> 												   (Node *) list_make2($5, $7),
#15265|   												   @2);
#15266|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1462]
postgresql-18beta1/src/backend/parser/gram.y:15272: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15270|   												   "BETWEEN SYMMETRIC",
#15271|   												   $1,
#15272|-> 												   (Node *) list_make2($4, $6),
#15273|   												   @2);
#15274|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1463]
postgresql-18beta1/src/backend/parser/gram.y:15280: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#15278|   												   "NOT BETWEEN SYMMETRIC",
#15279|   												   $1,
#15280|-> 												   (Node *) list_make2($5, $7),
#15281|   												   @2);
#15282|   				}

Error: CPPCHECK_WARNING (CWE-768): [#def1464]
postgresql-18beta1/src/backend/parser/gram.y:15383: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].node)},((union ListCell){.ptr_value=(makeStringConst(yyvsp[-1].str,yylsp[-1]))})' depends on order of evaluation of side effects
#15381|   				{
#15382|   					$$ = (Node *) makeFuncCall(SystemFuncName("is_normalized"),
#15383|-> 											   list_make2($1, makeStringConst($3, @3)),
#15384|   											   COERCE_SQL_SYNTAX,
#15385|   											   @2);

Error: CPPCHECK_WARNING (CWE-768): [#def1465]
postgresql-18beta1/src/backend/parser/gram.y:15398: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},((union ListCell){.ptr_value=(makeStringConst(yyvsp[-1].str,yylsp[-1]))})' depends on order of evaluation of side effects
#15396|   				{
#15397|   					$$ = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"),
#15398|-> 														   list_make2($1, makeStringConst($4, @4)),
#15399|   														   COERCE_SQL_SYNTAX,
#15400|   														   @2),

Error: CPPCHECK_WARNING (CWE-768): [#def1466]
postgresql-18beta1/src/backend/parser/gram.y:15915: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-3].node)},((union ListCell){.ptr_value=(makeStringConst(yyvsp[-1].str,yylsp[-1]))})' depends on order of evaluation of side effects
#15913|   				{
#15914|   					$$ = (Node *) makeFuncCall(SystemFuncName("normalize"),
#15915|-> 											   list_make2($3, makeStringConst($5, @5)),
#15916|   											   COERCE_SQL_SYNTAX,
#15917|   											   @1);

Error: CPPCHECK_WARNING (CWE-768): [#def1467]
postgresql-18beta1/src/backend/parser/gram.y:16074: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[-1].node)}' depends on order of evaluation of side effects
#16072|   					 * converted to xmlexists(A, B)*/
#16073|   					$$ = (Node *) makeFuncCall(SystemFuncName("xmlexists"),
#16074|-> 											   list_make2($3, $4),
#16075|   											   COERCE_SQL_SYNTAX,
#16076|   											   @1);

Error: CPPCHECK_WARNING (CWE-768): [#def1468]
postgresql-18beta1/src/backend/parser/gram.y:16086: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},((union ListCell){.ptr_value=(makeBoolAConst(yyvsp[-1].boolean,-1))})' depends on order of evaluation of side effects
#16084|   					XmlExpr *x = (XmlExpr *)
#16085|   						makeXmlExpr(IS_XMLPARSE, NULL, NIL,
#16086|-> 									list_make2($4, makeBoolAConst($5, -1)),
#16087|   									@1);
#16088|   

Error: CPPCHECK_WARNING (CWE-768): [#def1469]
postgresql-18beta1/src/backend/parser/gram.y:16103: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16101|   				{
#16102|   					$$ = makeXmlExpr(IS_XMLROOT, NULL, NIL,
#16103|-> 									 list_make3($3, $5, $6), @1);
#16104|   				}
#16105|   			| XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1470]
postgresql-18beta1/src/backend/parser/gram.y:16103: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[-1].node)}' depends on order of evaluation of side effects
#16101|   				{
#16102|   					$$ = makeXmlExpr(IS_XMLROOT, NULL, NIL,
#16103|-> 									 list_make3($3, $5, $6), @1);
#16104|   				}
#16105|   			| XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'

Error: CPPCHECK_WARNING (CWE-768): [#def1471]
postgresql-18beta1/src/backend/parser/gram.y:16780: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeStringConst(yyvsp[-2].str,yylsp[-2]))}),(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16778|   			extract_arg FROM a_expr
#16779|   				{
#16780|-> 					$$ = list_make2(makeStringConst($1, @1), $3);
#16781|   				}
#16782|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1472]
postgresql-18beta1/src/backend/parser/gram.y:16810: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)}' depends on order of evaluation of side effects
#16808|   				{
#16809|   					/* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16810|-> 					$$ = list_make4($1, $3, $5, $7);
#16811|   				}
#16812|   			| a_expr PLACING a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1473]
postgresql-18beta1/src/backend/parser/gram.y:16810: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16808|   				{
#16809|   					/* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16810|-> 					$$ = list_make4($1, $3, $5, $7);
#16811|   				}
#16812|   			| a_expr PLACING a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1474]
postgresql-18beta1/src/backend/parser/gram.y:16810: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-6].node)},(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16808|   				{
#16809|   					/* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16810|-> 					$$ = list_make4($1, $3, $5, $7);
#16811|   				}
#16812|   			| a_expr PLACING a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1475]
postgresql-18beta1/src/backend/parser/gram.y:16815: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16813|   				{
#16814|   					/* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */
#16815|-> 					$$ = list_make3($1, $3, $5);
#16816|   				}
#16817|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1476]
postgresql-18beta1/src/backend/parser/gram.y:16815: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16813|   				{
#16814|   					/* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */
#16815|-> 					$$ = list_make3($1, $3, $5);
#16816|   				}
#16817|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1477]
postgresql-18beta1/src/backend/parser/gram.y:16821: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[0].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16819|   /* position_list uses b_expr not a_expr to avoid conflict with general IN */
#16820|   position_list:
#16821|-> 			b_expr IN_P b_expr						{ $$ = list_make2($3, $1); }
#16822|   		;
#16823|   

Error: CPPCHECK_WARNING (CWE-768): [#def1478]
postgresql-18beta1/src/backend/parser/gram.y:16844: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16842|   			a_expr FROM a_expr FOR a_expr
#16843|   				{
#16844|-> 					$$ = list_make3($1, $3, $5);
#16845|   				}
#16846|   			| a_expr FOR a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1479]
postgresql-18beta1/src/backend/parser/gram.y:16844: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16842|   			a_expr FROM a_expr FOR a_expr
#16843|   				{
#16844|-> 					$$ = list_make3($1, $3, $5);
#16845|   				}
#16846|   			| a_expr FOR a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1480]
postgresql-18beta1/src/backend/parser/gram.y:16849: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16847|   				{
#16848|   					/* not legal per SQL, but might as well allow it */
#16849|-> 					$$ = list_make3($1, $5, $3);
#16850|   				}
#16851|   			| a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1481]
postgresql-18beta1/src/backend/parser/gram.y:16849: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[0].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16847|   				{
#16848|   					/* not legal per SQL, but might as well allow it */
#16849|-> 					$$ = list_make3($1, $5, $3);
#16850|   				}
#16851|   			| a_expr FROM a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1482]
postgresql-18beta1/src/backend/parser/gram.y:16860: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16858|   					 * such a call in regular function call syntax.
#16859|   					 */
#16860|-> 					$$ = list_make2($1, $3);
#16861|   				}
#16862|   			| a_expr FOR a_expr

Error: CPPCHECK_WARNING (CWE-768): [#def1483]
postgresql-18beta1/src/backend/parser/gram.y:16875: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},((union ListCell){.ptr_value=(makeIntConst(1,-1))})' depends on order of evaluation of side effects
#16873|   					 * is unknown or doesn't have an implicit cast to int4.
#16874|   					 */
#16875|-> 					$$ = list_make3($1, makeIntConst(1, -1),
#16876|   									makeTypeCast($3,
#16877|   												 SystemTypeName("int4"), -1));

Error: CPPCHECK_WARNING (CWE-768): [#def1484]
postgresql-18beta1/src/backend/parser/gram.y:16875: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},((union ListCell){.ptr_value=(makeIntConst(1,-1))}),((union ListCell){.ptr_value=(makeTypeCast(yyvsp[0].node,SystemTypeName("int4"),-1))})' depends on order of evaluation of side effects
#16873|   					 * is unknown or doesn't have an implicit cast to int4.
#16874|   					 */
#16875|-> 					$$ = list_make3($1, makeIntConst(1, -1),
#16876|   									makeTypeCast($3,
#16877|   												 SystemTypeName("int4"), -1));

Error: CPPCHECK_WARNING (CWE-768): [#def1485]
postgresql-18beta1/src/backend/parser/gram.y:16881: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#16879|   			| a_expr SIMILAR a_expr ESCAPE a_expr
#16880|   				{
#16881|-> 					$$ = list_make3($1, $3, $5);
#16882|   				}
#16883|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1486]
postgresql-18beta1/src/backend/parser/gram.y:16881: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-4].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(yyvsp[0].node)}' depends on order of evaluation of side effects
#16879|   			| a_expr SIMILAR a_expr ESCAPE a_expr
#16880|   				{
#16881|-> 					$$ = list_make3($1, $3, $5);
#16882|   				}
#16883|   		;

Error: CPPCHECK_WARNING (CWE-768): [#def1487]
postgresql-18beta1/src/backend/parser/gram.y:17062: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].node)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
#17060|   json_behavior_clause_opt:
#17061|   			json_behavior ON EMPTY_P
#17062|-> 				{ $$ = list_make2($1, NULL); }
#17063|   			| json_behavior ON ERROR_P
#17064|   				{ $$ = list_make2(NULL, $1); }

Error: CPPCHECK_WARNING (CWE-768): [#def1488]
postgresql-18beta1/src/backend/parser/gram.y:17064: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#17062|   				{ $$ = list_make2($1, NULL); }
#17063|   			| json_behavior ON ERROR_P
#17064|-> 				{ $$ = list_make2(NULL, $1); }
#17065|   			| json_behavior ON EMPTY_P json_behavior ON ERROR_P
#17066|   				{ $$ = list_make2($1, $4); }

Error: CPPCHECK_WARNING (CWE-768): [#def1489]
postgresql-18beta1/src/backend/parser/gram.y:17066: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-5].node)},(union ListCell){.ptr_value=(yyvsp[-2].node)}' depends on order of evaluation of side effects
#17064|   				{ $$ = list_make2(NULL, $1); }
#17065|   			| json_behavior ON EMPTY_P json_behavior ON ERROR_P
#17066|-> 				{ $$ = list_make2($1, $4); }
#17067|   			| /* EMPTY */
#17068|   				{ $$ = list_make2(NULL, NULL); }

Error: CPPCHECK_WARNING (CWE-768): [#def1490]
postgresql-18beta1/src/backend/parser/gram.y:17068: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(NULL)},(union ListCell){.ptr_value=(NULL)}' depends on order of evaluation of side effects
#17066|   				{ $$ = list_make2($1, $4); }
#17067|   			| /* EMPTY */
#17068|-> 				{ $$ = list_make2(NULL, NULL); }
#17069|   		;
#17070|   

Error: CPPCHECK_WARNING (CWE-457): [#def1491]
postgresql-18beta1/src/backend/parser/gram.y:17104: error[legacyUninitvar]: Uninitialized variable: encoding
#17102|   								 parser_errposition(@4)));
#17103|   
#17104|-> 					$$ = (Node *) makeJsonFormat(JS_FORMAT_JSON, encoding, @1);
#17105|   				}
#17106|   			| FORMAT_LA JSON

Error: CPPCHECK_WARNING (CWE-768): [#def1492]
postgresql-18beta1/src/backend/parser/gram.y:17454: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeIntConst(0x7FFF,-1))}),((union ListCell){.ptr_value=(makeIntConst(yyvsp[-2].ival,yylsp[-2]))})' depends on order of evaluation of side effects
#17452|   					TypeName   *t = $1;
#17453|   
#17454|-> 					t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
#17455|   											makeIntConst($3, @3));
#17456|   					$$ = makeStringConstCast($5, @5, t);

Error: CPPCHECK_WARNING (CWE-457): [#def1493]
postgresql-18beta1/src/backend/parser/gram.y:17548: error[legacyUninitvar]: Uninitialized variable: n
#17546|   						n->rolename = pstrdup($1);
#17547|   					}
#17548|-> 					$$ = n;
#17549|   				}
#17550|   			| CURRENT_ROLE

Error: CPPCHECK_WARNING (CWE-768): [#def1494]
postgresql-18beta1/src/backend/parser/gram.y:19077: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(list_concat(directargs,orderedargs))}),(union ListCell){.ptr_value=(ndirectargs)}' depends on order of evaluation of side effects
#19075|   	ndirectargs = makeInteger(list_length(directargs));
#19076|   
#19077|-> 	return list_make2(list_concat(directargs, orderedargs),
#19078|   					  ndirectargs);
#19079|   }

Error: CPPCHECK_WARNING (CWE-768): [#def1495]
postgresql-18beta1/src/backend/parser/gram.y:19188: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString("pg_catalog"))},(union ListCell){.ptr_value=(makeString(name))}' depends on order of evaluation of side effects
#19186|   SystemFuncName(char *name)
#19187|   {
#19188|-> 	return list_make2(makeString("pg_catalog"), makeString(name));
#19189|   }
#19190|   

Error: CPPCHECK_WARNING (CWE-768): [#def1496]
postgresql-18beta1/src/backend/parser/gram.y:19200: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString("pg_catalog"))},(union ListCell){.ptr_value=(makeString(name))}' depends on order of evaluation of side effects
#19198|   SystemTypeName(char *name)
#19199|   {
#19200|-> 	return makeTypeNameFromNameList(list_make2(makeString("pg_catalog"),
#19201|   											   makeString(name)));
#19202|   }

Error: CPPCHECK_WARNING (CWE-768): [#def1497]
postgresql-18beta1/src/backend/parser/gram.y:19269: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lexpr)},(union ListCell){.ptr_value=(rexpr)}' depends on order of evaluation of side effects
#19267|   		}
#19268|   	}
#19269|-> 	return (Node *) makeBoolExpr(AND_EXPR, list_make2(lexpr, rexpr), location);
#19270|   }
#19271|   

Error: CPPCHECK_WARNING (CWE-768): [#def1498]
postgresql-18beta1/src/backend/parser/gram.y:19286: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lexpr)},(union ListCell){.ptr_value=(rexpr)}' depends on order of evaluation of side effects
#19284|   		}
#19285|   	}
#19286|-> 	return (Node *) makeBoolExpr(OR_EXPR, list_make2(lexpr, rexpr), location);
#19287|   }
#19288|   

Error: CPPCHECK_WARNING (CWE-768): [#def1499]
postgresql-18beta1/src/backend/parser/parse_agg.c:2217: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(make_agg_arg(17,(unsigned int)0))}),((union ListCell){.ptr_value=(make_agg_arg(2281,(unsigned int)0))})' depends on order of evaluation of side effects
# 2215|   
# 2216|   	/* deserialfn always takes BYTEA, INTERNAL and returns INTERNAL */
# 2217|-> 	args = list_make2(make_agg_arg(BYTEAOID, InvalidOid),
# 2218|   					  make_agg_arg(INTERNALOID, InvalidOid));
# 2219|   

Error: CPPCHECK_WARNING (CWE-768): [#def1500]
postgresql-18beta1/src/backend/parser/parse_clause.c:1676: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(l_colvar)},(union ListCell){.ptr_value=(r_colvar)}' depends on order of evaluation of side effects
# 1674|   
# 1675|   	outcoltype = select_common_type(pstate,
# 1676|-> 									list_make2(l_colvar, r_colvar),
# 1677|   									"JOIN/USING",
# 1678|   									NULL);

Error: CPPCHECK_WARNING (CWE-768): [#def1501]
postgresql-18beta1/src/backend/parser/parse_clause.c:1680: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(l_colvar)},(union ListCell){.ptr_value=(r_colvar)}' depends on order of evaluation of side effects
# 1678|   									NULL);
# 1679|   	outcoltypmod = select_common_typmod(pstate,
# 1680|-> 										list_make2(l_colvar, r_colvar),
# 1681|   										outcoltype);
# 1682|   

Error: CPPCHECK_WARNING (CWE-768): [#def1502]
postgresql-18beta1/src/backend/parser/parse_clause.c:1748: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(l_node)},(union ListCell){.ptr_value=(r_node)}' depends on order of evaluation of side effects
# 1746|   				c->coalescetype = outcoltype;
# 1747|   				/* coalescecollid will get set below */
# 1748|-> 				c->args = list_make2(l_node, r_node);
# 1749|   				c->location = -1;
# 1750|   				res_node = (Node *) c;

Error: CPPCHECK_WARNING (CWE-768): [#def1503]
postgresql-18beta1/src/backend/parser/parse_collate.c:377: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(le)},(union ListCell){.ptr_value=(re)}' depends on order of evaluation of side effects
#  375|   
#  376|   					coll = select_common_collation(context->pstate,
#  377|-> 												   list_make2(le, re),
#  378|   												   true);
#  379|   					colls = lappend_oid(colls, coll);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1504]
postgresql-18beta1/src/backend/parser/parse_collate.c:972:58: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘h_cell’
postgresql-18beta1/src/backend/parser/parse_collate.c:955:1: enter_function: entry to ‘assign_hypothetical_collations’
postgresql-18beta1/src/backend/parser/parse_collate.c:958:30: call_function: inlined call to ‘list_head’ from ‘assign_hypothetical_collations’
postgresql-18beta1/src/backend/parser/parse_collate.c:959:40: branch_false: ...to here
postgresql-18beta1/src/backend/parser/parse_collate.c:959:30: call_function: inlined call to ‘list_head’ from ‘assign_hypothetical_collations’
postgresql-18beta1/src/backend/parser/parse_collate.c:964:34: call_function: inlined call to ‘list_length’ from ‘assign_hypothetical_collations’
postgresql-18beta1/src/backend/parser/parse_collate.c:970:16: branch_true: following ‘true’ branch (when ‘extra_args > 0’)...
postgresql-18beta1/src/backend/parser/parse_collate.c:972:58: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_collate.c:972:58: danger: dereference of NULL ‘h_cell’
#  970|   	while (extra_args-- > 0)
#  971|   	{
#  972|-> 		(void) assign_collations_walker((Node *) lfirst(h_cell), loccontext);
#  973|   		h_cell = lnext(aggref->aggdirectargs, h_cell);
#  974|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def1505]
postgresql-18beta1/src/backend/parser/parse_cte.c:271: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_clause->cycle_mark_value)},(union ListCell){.ptr_value=(cycle_clause->cycle_mark_default)}' depends on order of evaluation of side effects
#  269|   		cycle_clause->cycle_mark_type =
#  270|   			select_common_type(pstate,
#  271|-> 							   list_make2(cycle_clause->cycle_mark_value,
#  272|   										  cycle_clause->cycle_mark_default),
#  273|   							   "CYCLE", NULL);

Error: CPPCHECK_WARNING (CWE-768): [#def1506]
postgresql-18beta1/src/backend/parser/parse_cte.c:287: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_clause->cycle_mark_value)},(union ListCell){.ptr_value=(cycle_clause->cycle_mark_default)}' depends on order of evaluation of side effects
#  285|   		cycle_clause->cycle_mark_typmod =
#  286|   			select_common_typmod(pstate,
#  287|-> 								 list_make2(cycle_clause->cycle_mark_value,
#  288|   											cycle_clause->cycle_mark_default),
#  289|   								 cycle_clause->cycle_mark_type);

Error: CPPCHECK_WARNING (CWE-768): [#def1507]
postgresql-18beta1/src/backend/parser/parse_cte.c:293: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_clause->cycle_mark_value)},(union ListCell){.ptr_value=(cycle_clause->cycle_mark_default)}' depends on order of evaluation of side effects
#  291|   		cycle_clause->cycle_mark_collation =
#  292|   			select_common_collation(pstate,
#  293|-> 									list_make2(cycle_clause->cycle_mark_value,
#  294|   											   cycle_clause->cycle_mark_default),
#  295|   									true);

Error: CPPCHECK_WARNING (CWE-768): [#def1508]
postgresql-18beta1/src/backend/parser/parse_expr.c:1274: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(result)},(union ListCell){.ptr_value=(cmp)}' depends on order of evaluation of side effects
# 1272|   		else
# 1273|   			result = (Node *) makeBoolExpr(useOr ? OR_EXPR : AND_EXPR,
# 1274|-> 										   list_make2(result, cmp),
# 1275|   										   a->location);
# 1276|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def1509]
postgresql-18beta1/src/backend/parser/parse_expr.c:1313: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">=",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<=",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1311|   	{
# 1312|   		case AEXPR_BETWEEN:
# 1313|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1314|   											   aexpr, bexpr,
# 1315|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def1510]
postgresql-18beta1/src/backend/parser/parse_expr.c:1322: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1320|   			break;
# 1321|   		case AEXPR_NOT_BETWEEN:
# 1322|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1323|   											   aexpr, bexpr,
# 1324|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def1511]
postgresql-18beta1/src/backend/parser/parse_expr.c:1331: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">=",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<=",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1329|   			break;
# 1330|   		case AEXPR_BETWEEN_SYM:
# 1331|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1332|   											   aexpr, bexpr,
# 1333|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def1512]
postgresql-18beta1/src/backend/parser/parse_expr.c:1338: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">=",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(cexpr))copyObjectImpl(cexpr),a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<=",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(bexpr))copyObjectImpl(bexpr),a->location))})' depends on order of evaluation of side effects
# 1336|   											   a->location));
# 1337|   			sub1 = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1338|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1339|   											   copyObject(aexpr), copyObject(cexpr),
# 1340|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def1513]
postgresql-18beta1/src/backend/parser/parse_expr.c:1345: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sub1)},(union ListCell){.ptr_value=(sub2)}' depends on order of evaluation of side effects
# 1343|   											   a->location));
# 1344|   			sub2 = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1345|-> 			args = list_make2(sub1, sub2);
# 1346|   			result = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1347|   			break;

Error: CPPCHECK_WARNING (CWE-768): [#def1514]
postgresql-18beta1/src/backend/parser/parse_expr.c:1349: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<",aexpr,bexpr,a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">",(__typeof__(aexpr))copyObjectImpl(aexpr),cexpr,a->location))})' depends on order of evaluation of side effects
# 1347|   			break;
# 1348|   		case AEXPR_NOT_BETWEEN_SYM:
# 1349|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1350|   											   aexpr, bexpr,
# 1351|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def1515]
postgresql-18beta1/src/backend/parser/parse_expr.c:1356: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,"<",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(cexpr))copyObjectImpl(cexpr),a->location))}),((union ListCell){.ptr_value=(makeSimpleA_Expr(AEXPR_OP,">",(__typeof__(aexpr))copyObjectImpl(aexpr),(__typeof__(bexpr))copyObjectImpl(bexpr),a->location))})' depends on order of evaluation of side effects
# 1354|   											   a->location));
# 1355|   			sub1 = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1356|-> 			args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1357|   											   copyObject(aexpr), copyObject(cexpr),
# 1358|   											   a->location),

Error: CPPCHECK_WARNING (CWE-768): [#def1516]
postgresql-18beta1/src/backend/parser/parse_expr.c:1363: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sub1)},(union ListCell){.ptr_value=(sub2)}' depends on order of evaluation of side effects
# 1361|   											   a->location));
# 1362|   			sub2 = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1363|-> 			args = list_make2(sub1, sub2);
# 1364|   			result = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1365|   			break;

Error: CPPCHECK_WARNING (CWE-768): [#def1517]
postgresql-18beta1/src/backend/parser/parse_expr.c:3053: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(result)},(union ListCell){.ptr_value=(cmp)}' depends on order of evaluation of side effects
# 3051|   		else
# 3052|   			result = (Node *) makeBoolExpr(OR_EXPR,
# 3053|-> 										   list_make2(result, cmp),
# 3054|   										   location);
# 3055|   	}

Error: CPPCHECK_WARNING (CWE-768): [#def1518]
postgresql-18beta1/src/backend/parser/parse_expr.c:3278: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(expr)},(union ListCell){.ptr_value=(encoding)}' depends on order of evaluation of side effects
# 3276|   	Const	   *encoding = getJsonEncodingConst(format);
# 3277|   	FuncExpr   *fexpr = makeFuncExpr(F_CONVERT_FROM, TEXTOID,
# 3278|-> 									 list_make2(expr, encoding),
# 3279|   									 InvalidOid, InvalidOid,
# 3280|   									 COERCE_EXPLICIT_CALL);

Error: CPPCHECK_WARNING (CWE-768): [#def1519]
postgresql-18beta1/src/backend/parser/parse_expr.c:3623: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(texpr)},(union ListCell){.ptr_value=(enc)}' depends on order of evaluation of side effects
# 3621|   		Const	   *enc = getJsonEncodingConst(returning->format);
# 3622|   		FuncExpr   *fexpr = makeFuncExpr(F_CONVERT_TO, BYTEAOID,
# 3623|-> 										 list_make2(texpr, enc),
# 3624|   										 InvalidOid, InvalidOid,
# 3625|   										 COERCE_EXPLICIT_CALL);

Error: CPPCHECK_WARNING (CWE-768): [#def1520]
postgresql-18beta1/src/backend/parser/parse_expr.c:3785: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(pstrdup("q")))},(union ListCell){.ptr_value=(makeString(pstrdup("a")))}' depends on order of evaluation of side effects
# 3783|   	free_parsestate(qpstate);
# 3784|   
# 3785|-> 	colref->fields = list_make2(makeString(pstrdup("q")),
# 3786|   								makeString(pstrdup("a")));
# 3787|   	colref->location = ctor->location;

Error: CPPCHECK_WARNING (CWE-768): [#def1521]
postgresql-18beta1/src/backend/parser/parse_expr.c:3930: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(key)},(union ListCell){.ptr_value=(val)}' depends on order of evaluation of side effects
# 3928|   								 JS_FORMAT_DEFAULT,
# 3929|   								 InvalidOid, false);
# 3930|-> 	args = list_make2(key, val);
# 3931|   
# 3932|   	returning = transformJsonConstructorOutput(pstate, agg->constructor->output,

Error: CPPCHECK_WARNING (CWE-768): [#def1522]
postgresql-18beta1/src/backend/parser/parse_func.c:1780: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((aarg)->ptr_value)},(union ListCell){.ptr_value=((harg)->ptr_value)}' depends on order of evaluation of side effects
# 1778|   		 */
# 1779|   		commontype = select_common_type(pstate,
# 1780|-> 										list_make2(lfirst(aarg), lfirst(harg)),
# 1781|   										"WITHIN GROUP",
# 1782|   										NULL);

Error: CPPCHECK_WARNING (CWE-768): [#def1523]
postgresql-18beta1/src/backend/parser/parse_func.c:1784: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=((aarg)->ptr_value)},(union ListCell){.ptr_value=((harg)->ptr_value)}' depends on order of evaluation of side effects
# 1782|   										NULL);
# 1783|   		commontypmod = select_common_typmod(pstate,
# 1784|-> 											list_make2(lfirst(aarg), lfirst(harg)),
# 1785|   											commontype);
# 1786|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1524]
postgresql-18beta1/src/backend/parser/parse_func.c:2014:70: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lc’
postgresql-18beta1/src/backend/parser/parse_func.c:2008:21: branch_true: following ‘true’ branch (when ‘i < nargs’)...
postgresql-18beta1/src/backend/parser/parse_func.c:2010:20: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_func.c:2010:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
postgresql-18beta1/src/backend/parser/parse_func.c:2012:20: branch_false: ...to here
postgresql-18beta1/src/backend/parser/parse_func.c:2012:20: branch_true: following ‘true’ branch (when ‘i >= numposargs’)...
postgresql-18beta1/src/backend/parser/parse_func.c:2014:70: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_func.c:2008:21: branch_true: following ‘true’ branch (when ‘i < nargs’)...
postgresql-18beta1/src/backend/parser/parse_func.c:2010:20: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_func.c:2012:20: branch_true: following ‘true’ branch (when ‘i >= numposargs’)...
postgresql-18beta1/src/backend/parser/parse_func.c:2014:70: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_func.c:2014:70: danger: dereference of NULL ‘lc’
# 2012|   		if (i >= numposargs)
# 2013|   		{
# 2014|-> 			appendStringInfo(&argbuf, "%s => ", (char *) lfirst(lc));
# 2015|   			lc = lnext(argnames, lc);
# 2016|   		}

Error: CPPCHECK_WARNING (CWE-457): [#def1525]
postgresql-18beta1/src/backend/parser/parse_func.c:2271: warning[uninitvar]: Uninitialized variable: argoids
# 2269|   	 */
# 2270|   	oid = LookupFuncNameInternal(func->args_unspecified ? objtype : OBJECT_ROUTINE,
# 2271|-> 								 func->objname, nargs, argoids,
# 2272|   								 false, missing_ok,
# 2273|   								 &lookupError);

Error: CPPCHECK_WARNING (CWE-768): [#def1526]
postgresql-18beta1/src/backend/parser/parse_oper.c:720: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltree)},(union ListCell){.ptr_value=(rtree)}' depends on order of evaluation of side effects
#  718|   	{
#  719|   		/* otherwise, binary operator */
#  720|-> 		args = list_make2(ltree, rtree);
#  721|   		actual_arg_types[0] = ltypeId;
#  722|   		actual_arg_types[1] = rtypeId;

Error: CPPCHECK_WARNING (CWE-768): [#def1527]
postgresql-18beta1/src/backend/parser/parse_oper.c:821: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(ltree)},(union ListCell){.ptr_value=(rtree)}' depends on order of evaluation of side effects
#  819|   				 parser_errposition(pstate, location)));
#  820|   
#  821|-> 	args = list_make2(ltree, rtree);
#  822|   	actual_arg_types[0] = ltypeId;
#  823|   	actual_arg_types[1] = rtypeId;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1528]
postgresql-18beta1/src/backend/parser/parse_relation.c:3065:77: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘aliasp_item’
postgresql-18beta1/src/backend/parser/parse_relation.c:2751:1: enter_function: entry to ‘expandRTE’
postgresql-18beta1/src/backend/parser/parse_relation.c:2758:12: branch_true: following ‘true’ branch (when ‘colnames’ is non-NULL)...
postgresql-18beta1/src/backend/parser/parse_relation.c:2759:17: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_relation.c:2760:12: branch_false: following ‘false’ branch (when ‘colvars’ is NULL)...
postgresql-18beta1/src/backend/parser/parse_relation.c:2763:17: branch_false: ...to here
postgresql-18beta1/src/backend/parser/parse_relation.c:3044:59: call_function: inlined call to ‘list_head’ from ‘expandRTE’
postgresql-18beta1/src/backend/parser/parse_relation.c:3050:33: branch_false: ...to here
postgresql-18beta1/src/backend/parser/parse_relation.c:3050:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/parser/parse_relation.c:3060:44: branch_true: following ‘true’ branch (when ‘colnames’ is non-NULL)...
postgresql-18beta1/src/backend/parser/parse_relation.c:3063:52: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_relation.c:3063:52: branch_true: following ‘true’ branch (when ‘coltype != 0’)...
postgresql-18beta1/src/backend/parser/parse_relation.c:3065:77: branch_true: ...to here
postgresql-18beta1/src/backend/parser/parse_relation.c:3065:77: danger: dereference of NULL ‘aliasp_item’
# 3063|   						if (OidIsValid(coltype))
# 3064|   						{
# 3065|-> 							char	   *label = strVal(lfirst(aliasp_item));
# 3066|   
# 3067|   							*colnames = lappend(*colnames,

Error: CPPCHECK_WARNING (CWE-768): [#def1529]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:567: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(snamespace))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))}' depends on order of evaluation of side effects
#  565|   	altseqstmt = makeNode(AlterSeqStmt);
#  566|   	altseqstmt->sequence = makeRangeVar(snamespace, sname, -1);
#  567|-> 	attnamelist = list_make3(makeString(snamespace),
#  568|   							 makeString(cxt->relation->relname),
#  569|   							 makeString(column->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def1530]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:567: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(snamespace))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))},(union ListCell){.ptr_value=(makeString(column->colname))}' depends on order of evaluation of side effects
#  565|   	altseqstmt = makeNode(AlterSeqStmt);
#  566|   	altseqstmt->sequence = makeRangeVar(snamespace, sname, -1);
#  567|-> 	attnamelist = list_make3(makeString(snamespace),
#  568|   							 makeString(cxt->relation->relname),
#  569|   							 makeString(column->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def1531]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:1262: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(cxt->relation->schemaname))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))}' depends on order of evaluation of side effects
# 1260|   
# 1261|   			stmt->objtype = OBJECT_COLUMN;
# 1262|-> 			stmt->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
# 1263|   											   makeString(cxt->relation->relname),
# 1264|   											   makeString(def->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def1532]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:1262: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(cxt->relation->schemaname))},(union ListCell){.ptr_value=(makeString(cxt->relation->relname))},(union ListCell){.ptr_value=(makeString(def->colname))}' depends on order of evaluation of side effects
# 1260|   
# 1261|   			stmt->objtype = OBJECT_COLUMN;
# 1262|-> 			stmt->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
# 1263|   											   makeString(cxt->relation->relname),
# 1264|   											   makeString(def->colname));

Error: CPPCHECK_WARNING (CWE-768): [#def1533]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:1496: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(heapRel->schemaname))},(union ListCell){.ptr_value=(makeString(heapRel->relname))}' depends on order of evaluation of side effects
# 1494|   
# 1495|   				stmt->objtype = OBJECT_TABCONSTRAINT;
# 1496|-> 				stmt->object = (Node *) list_make3(makeString(heapRel->schemaname),
# 1497|   												   makeString(heapRel->relname),
# 1498|   												   makeString(n->conname));

Error: CPPCHECK_WARNING (CWE-768): [#def1534]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:1496: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(heapRel->schemaname))},(union ListCell){.ptr_value=(makeString(heapRel->relname))},(union ListCell){.ptr_value=(makeString(n->conname))}' depends on order of evaluation of side effects
# 1494|   
# 1495|   				stmt->objtype = OBJECT_TABCONSTRAINT;
# 1496|-> 				stmt->object = (Node *) list_make3(makeString(heapRel->schemaname),
# 1497|   												   makeString(heapRel->relname),
# 1498|   												   makeString(n->conname));

Error: CPPCHECK_WARNING (CWE-768): [#def1535]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:1819: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(nspname))},(union ListCell){.ptr_value=(makeString(oprname))}' depends on order of evaluation of side effects
# 1817|   					/* For simplicity we always schema-qualify the op name */
# 1818|   					nspname = get_namespace_name(operform->oprnamespace);
# 1819|-> 					namelist = list_make2(makeString(nspname),
# 1820|   										  makeString(oprname));
# 1821|   					index->excludeOpNames = lappend(index->excludeOpNames,

Error: CPPCHECK_WARNING (CWE-768): [#def1536]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:2173: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(nsp_name))},(union ListCell){.ptr_value=(makeString(coll_name))}' depends on order of evaluation of side effects
# 2171|   	nsp_name = get_namespace_name(coll_rec->collnamespace);
# 2172|   	coll_name = pstrdup(NameStr(coll_rec->collname));
# 2173|-> 	result = list_make2(makeString(nsp_name), makeString(coll_name));
# 2174|   
# 2175|   	ReleaseSysCache(ht_coll);

Error: CPPCHECK_WARNING (CWE-768): [#def1537]
postgresql-18beta1/src/backend/parser/parse_utilcmd.c:2203: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(nsp_name))},(union ListCell){.ptr_value=(makeString(opc_name))}' depends on order of evaluation of side effects
# 2201|   		char	   *opc_name = pstrdup(NameStr(opc_rec->opcname));
# 2202|   
# 2203|-> 		result = list_make2(makeString(nsp_name), makeString(opc_name));
# 2204|   	}
# 2205|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1538]
postgresql-18beta1/src/backend/parser/scan.c:10850:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/src/backend/parser/scan.c:9298:1: enter_function: entry to ‘core_yylex’
postgresql-18beta1/src/backend/parser/scan.c:10400:17: call_function: calling ‘yy_get_next_buffer’ from ‘core_yylex’
#10848|   
#10849|   	yy_flush_buffer( b , yyscanner);
#10850|-> 
#10851|   	b->yy_input_file = file;
#10852|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1539]
postgresql-18beta1/src/backend/partitioning/partbounds.c:4039:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partexprs_item’
postgresql-18beta1/src/backend/partitioning/partbounds.c:3983:1: enter_function: entry to ‘get_qual_for_hash’
postgresql-18beta1/src/backend/partitioning/partbounds.c:4020:26: call_function: inlined call to ‘list_head’ from ‘get_qual_for_hash’
postgresql-18beta1/src/backend/partitioning/partbounds.c:4023:9: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partbounds.c:4023:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/partitioning/partbounds.c:4028:21: branch_true: ...to here
postgresql-18beta1/src/backend/partitioning/partbounds.c:4028:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/partitioning/partbounds.c:4039:43: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partbounds.c:4039:43: danger: dereference of NULL ‘partexprs_item’
# 4037|   		else
# 4038|   		{
# 4039|-> 			keyCol = (Node *) copyObject(lfirst(partexprs_item));
# 4040|   			partexprs_item = lnext(key->partexprs, partexprs_item);
# 4041|   		}

Error: CPPCHECK_WARNING (CWE-768): [#def1540]
postgresql-18beta1/src/backend/partitioning/partprune.c:1880: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(new_booltest)},(union ListCell){.ptr_value=(nulltest)}' depends on order of evaluation of side effects
# 1878|   			nulltest->location = -1;
# 1879|   
# 1880|-> 			new_clauses = list_make2(new_booltest, nulltest);
# 1881|   			or_clause = list_make1(makeBoolExpr(OR_EXPR, new_clauses, -1));
# 1882|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1541]
postgresql-18beta1/src/backend/partitioning/partprune.c:2545:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘start’
postgresql-18beta1/src/backend/partitioning/partprune.c:2525:1: enter_function: entry to ‘get_steps_using_prefix_recurse’
postgresql-18beta1/src/backend/partitioning/partprune.c:2549:12: branch_true: following ‘true’ branch (when ‘cur_keyno < final_keyno’)...
postgresql-18beta1/src/backend/partitioning/partprune.c:2559:17: call_function: inlined call to ‘for_each_cell_setup’ from ‘get_steps_using_prefix_recurse’
postgresql-18beta1/src/backend/partitioning/partprune.c:2563:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/partitioning/partprune.c:2559:17: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:2575:17: call_function: inlined call to ‘for_each_cell_setup’ from ‘get_steps_using_prefix_recurse’
postgresql-18beta1/src/backend/partitioning/partprune.c:2575:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/partitioning/partprune.c:2575:17: branch_true: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:2582:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/partitioning/partprune.c:2585:47: branch_true: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:2599:37: call_function: calling ‘get_steps_using_prefix_recurse’ from ‘get_steps_using_prefix_recurse’
# 2543|   
# 2544|   	Assert(start != NULL);
# 2545|-> 	cur_keyno = ((PartClauseInfo *) lfirst(start))->keyno;
# 2546|   	final_keyno = ((PartClauseInfo *) llast(prefix))->keyno;
# 2547|   

Error: CPPCHECK_WARNING (CWE-457): [#def1542]
postgresql-18beta1/src/backend/partitioning/partprune.c:2725: warning[uninitvar]: Uninitialized variable: isnull
# 2723|   
# 2724|   		rowHash = compute_partition_hash_value(partnatts, partsupfunc, partcollation,
# 2725|-> 											   values, isnull);
# 2726|   
# 2727|   		greatest_modulus = boundinfo->nindexes;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1543]
postgresql-18beta1/src/backend/partitioning/partprune.c:3516:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lc2’
postgresql-18beta1/src/backend/partitioning/partprune.c:3444:1: enter_function: entry to ‘perform_pruning_base_step’
postgresql-18beta1/src/backend/partitioning/partprune.c:3461:15: call_function: inlined call to ‘list_head’ from ‘perform_pruning_base_step’
postgresql-18beta1/src/backend/partitioning/partprune.c:3462:15: call_function: inlined call to ‘list_head’ from ‘perform_pruning_base_step’
postgresql-18beta1/src/backend/partitioning/partprune.c:3468:9: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:3468:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/partitioning/partprune.c:3475:42: branch_true: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:3475:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/partitioning/partprune.c:3482:20: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:3482:20: branch_false: following ‘false’ branch (when ‘keyno <= nvalues’)...
postgresql-18beta1/src/backend/partitioning/partprune.c:3485:20: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:3485:20: branch_true: following ‘true’ branch (when ‘lc1’ is non-NULL)...
postgresql-18beta1/src/backend/partitioning/partprune.c:3492:25: branch_true: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:3503:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/partitioning/partprune.c:3516:25: branch_false: ...to here
postgresql-18beta1/src/backend/partitioning/partprune.c:3516:25: danger: dereference of NULL ‘lc2’
# 3514|   
# 3515|   			/* Set up the stepcmpfuncs entry, unless we already did */
# 3516|-> 			cmpfn = lfirst_oid(lc2);
# 3517|   			Assert(OidIsValid(cmpfn));
# 3518|   			if (cmpfn != context->stepcmpfuncs[stateidx].fn_oid)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1544]
postgresql-18beta1/src/backend/partitioning/partprune.c:3560:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘values[0]’
# 3558|   
# 3559|   		case PARTITION_STRATEGY_LIST:
# 3560|-> 			return get_matching_list_bounds(context,
# 3561|   											opstep->opstrategy,
# 3562|   											values[0], nvalues,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1545]
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("postmaster.opts", "w")’
postgresql-18beta1/src/backend/postmaster/postmaster.c:4081:19: acquire_resource: opened here
postgresql-18beta1/src/backend/postmaster/postmaster.c:4081:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: danger: ‘fopen("postmaster.opts", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 4087|   	}
# 4088|   
# 4089|-> 	fprintf(fp, "%s", fullprogname);
# 4090|   	for (i = 1; i < argc; i++)
# 4091|   		fprintf(fp, " \"%s\"", argv[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1546]
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("postmaster.opts", "w")’
postgresql-18beta1/src/backend/postmaster/postmaster.c:4081:19: acquire_memory: allocated here
postgresql-18beta1/src/backend/postmaster/postmaster.c:4081:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/backend/postmaster/postmaster.c:4089:9: danger: ‘fopen("postmaster.opts", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 4087|   	}
# 4088|   
# 4089|-> 	fprintf(fp, "%s", fullprogname);
# 4090|   	for (i = 1; i < argc; i++)
# 4091|   		fprintf(fp, " \"%s\"", argv[i]);

Error: GCC_ANALYZER_WARNING: [#def1547]
postgresql-18beta1/src/backend/postmaster/syslogger.c:238:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
postgresql-18beta1/src/backend/postmaster/syslogger.c:219:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:221:46: branch_true: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:234:17: release_resource: closed here
postgresql-18beta1/src/backend/postmaster/syslogger.c:236:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:238:32: branch_true: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:238:32: danger: ‘1’ could be invalid
#  236|   		if (fd != -1)
#  237|   		{
#  238|-> 			(void) dup2(fd, STDOUT_FILENO);
#  239|   			(void) dup2(fd, STDERR_FILENO);
#  240|   			close(fd);

Error: GCC_ANALYZER_WARNING: [#def1548]
postgresql-18beta1/src/backend/postmaster/syslogger.c:239:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
postgresql-18beta1/src/backend/postmaster/syslogger.c:219:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:221:46: branch_true: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:235:17: release_resource: closed here
postgresql-18beta1/src/backend/postmaster/syslogger.c:236:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:238:32: branch_true: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:239:32: danger: ‘2’ could be invalid
#  237|   		{
#  238|   			(void) dup2(fd, STDOUT_FILENO);
#  239|-> 			(void) dup2(fd, STDERR_FILENO);
#  240|   			close(fd);
#  241|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1549]
postgresql-18beta1/src/backend/postmaster/syslogger.c:736:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(syslogPipe[1], 1)’
postgresql-18beta1/src/backend/postmaster/syslogger.c:593:1: enter_function: entry to ‘SysLogger_Start’
postgresql-18beta1/src/backend/postmaster/syslogger.c:663:20: call_function: calling ‘logfile_getname’ from ‘SysLogger_Start’
postgresql-18beta1/src/backend/postmaster/syslogger.c:663:20: return_function: returning to ‘SysLogger_Start’ from ‘logfile_getname’
postgresql-18beta1/src/backend/postmaster/syslogger.c:708:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:718:13: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:718:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:729:17: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:736:21: acquire_resource: opened here
postgresql-18beta1/src/backend/postmaster/syslogger.c:736:20: danger: ‘dup2(syslogPipe[1], 1)’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  734|   #ifndef WIN32
#  735|   		fflush(stdout);
#  736|-> 		if (dup2(syslogPipe[1], STDOUT_FILENO) < 0)
#  737|   			ereport(FATAL,
#  738|   					(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1550]
postgresql-18beta1/src/backend/postmaster/syslogger.c:741:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(syslogPipe[1], 2)’
postgresql-18beta1/src/backend/postmaster/syslogger.c:593:1: enter_function: entry to ‘SysLogger_Start’
postgresql-18beta1/src/backend/postmaster/syslogger.c:663:20: call_function: calling ‘logfile_getname’ from ‘SysLogger_Start’
postgresql-18beta1/src/backend/postmaster/syslogger.c:663:20: return_function: returning to ‘SysLogger_Start’ from ‘logfile_getname’
postgresql-18beta1/src/backend/postmaster/syslogger.c:708:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:718:13: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:718:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:729:17: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:736:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:740:17: branch_false: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:741:21: acquire_resource: opened here
postgresql-18beta1/src/backend/postmaster/syslogger.c:741:20: danger: ‘dup2(syslogPipe[1], 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  739|   					 errmsg("could not redirect stdout: %m")));
#  740|   		fflush(stderr);
#  741|-> 		if (dup2(syslogPipe[1], STDERR_FILENO) < 0)
#  742|   			ereport(FATAL,
#  743|   					(errcode_for_file_access(),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1551]
postgresql-18beta1/src/backend/postmaster/syslogger.c:1517:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("current_logfiles.tmp", "w")’
postgresql-18beta1/src/backend/postmaster/syslogger.c:1496:14: acquire_resource: opened here
postgresql-18beta1/src/backend/postmaster/syslogger.c:1499:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:1501:17: branch_true: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:1517:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:1519:21: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/backend/postmaster/syslogger.c:1517:13: danger: ‘fopen("current_logfiles.tmp", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1515|   	}
# 1516|   
# 1517|-> 	if (last_sys_file_name && (Log_destination & LOG_DESTINATION_STDERR))
# 1518|   	{
# 1519|   		if (fprintf(fh, "stderr %s\n", last_sys_file_name) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1552]
postgresql-18beta1/src/backend/postmaster/syslogger.c:1517:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("current_logfiles.tmp", "w")’
postgresql-18beta1/src/backend/postmaster/syslogger.c:1496:14: acquire_memory: allocated here
postgresql-18beta1/src/backend/postmaster/syslogger.c:1499:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:1501:17: branch_true: ...to here
postgresql-18beta1/src/backend/postmaster/syslogger.c:1517:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/postmaster/syslogger.c:1519:21: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/backend/postmaster/syslogger.c:1517:13: danger: ‘fopen("current_logfiles.tmp", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1515|   	}
# 1516|   
# 1517|-> 	if (last_sys_file_name && (Log_destination & LOG_DESTINATION_STDERR))
# 1518|   	{
# 1519|   		if (fprintf(fh, "stderr %s\n", last_sys_file_name) < 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1553]
postgresql-18beta1/src/backend/regex/regc_cvec.c:83:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:616:30: call_function: calling ‘getcvec’ from ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:616:30: return_function: returning to ‘cclasscvec’ from ‘getcvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:617:25: call_function: inlined call to ‘addchr’ from ‘cclasscvec’
#   81|   {
#   82|   	assert(cv->nchrs < cv->chrspace);
#   83|-> 	cv->chrs[cv->nchrs++] = c;
#   84|   }
#   85|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1554]
postgresql-18beta1/src/backend/regex/regc_cvec.c:95:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cv’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:622:30: call_function: calling ‘getcvec’ from ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:622:30: return_function: returning to ‘cclasscvec’ from ‘getcvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:623:25: call_function: calling ‘addrange’ from ‘cclasscvec’
#   93|   {
#   94|   	assert(cv->nranges < cv->rangespace);
#   95|-> 	cv->ranges[cv->nranges * 2] = from;
#   96|   	cv->ranges[cv->nranges * 2 + 1] = to;
#   97|   	cv->nranges++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1555]
postgresql-18beta1/src/backend/regex/regc_nfa.c:336:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/regex/regc_nfa.c:1167:1: enter_function: entry to ‘copyouts’
postgresql-18beta1/src/backend/regex/regc_nfa.c:1179:42: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)...
postgresql-18beta1/src/backend/regex/regc_nfa.c:1180:25: branch_true: ...to here
postgresql-18beta1/src/backend/regex/regc_nfa.c:1180:25: call_function: calling ‘createarc’ from ‘copyouts’
#  334|   	assert(a != NULL);
#  335|   
#  336|-> 	a->type = t;
#  337|   	a->co = co;
#  338|   	a->to = to;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1556]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:307:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:627:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  305|   					(pg_char_properties[c] & PG_ISDIGIT));
#  306|   		case PG_REGEX_STRATEGY_BUILTIN:
#  307|-> 			return pg_u_isdigit(c, !pg_regex_locale->info.builtin.casemap_full);
#  308|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  309|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1557]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:307:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:627:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  305|   					(pg_char_properties[c] & PG_ISDIGIT));
#  306|   		case PG_REGEX_STRATEGY_BUILTIN:
#  307|-> 			return pg_u_isdigit(c, !pg_regex_locale->info.builtin.casemap_full);
#  308|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  309|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1558]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:334:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:603:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  332|   					(pg_char_properties[c] & PG_ISALPHA));
#  333|   		case PG_REGEX_STRATEGY_BUILTIN:
#  334|-> 			return pg_u_isalpha(c);
#  335|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  336|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1559]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:334:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:603:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  332|   					(pg_char_properties[c] & PG_ISALPHA));
#  333|   		case PG_REGEX_STRATEGY_BUILTIN:
#  334|-> 			return pg_u_isalpha(c);
#  335|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  336|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1560]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:361:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:600:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  359|   					(pg_char_properties[c] & PG_ISALNUM));
#  360|   		case PG_REGEX_STRATEGY_BUILTIN:
#  361|-> 			return pg_u_isalnum(c, !pg_regex_locale->info.builtin.casemap_full);
#  362|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  363|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1561]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:361:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:600:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  359|   					(pg_char_properties[c] & PG_ISALNUM));
#  360|   		case PG_REGEX_STRATEGY_BUILTIN:
#  361|-> 			return pg_u_isalnum(c, !pg_regex_locale->info.builtin.casemap_full);
#  362|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  363|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1562]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:397:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:654:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  395|   					(pg_char_properties[c] & PG_ISUPPER));
#  396|   		case PG_REGEX_STRATEGY_BUILTIN:
#  397|-> 			return pg_u_isupper(c);
#  398|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  399|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1563]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:397:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:654:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  395|   					(pg_char_properties[c] & PG_ISUPPER));
#  396|   		case PG_REGEX_STRATEGY_BUILTIN:
#  397|-> 			return pg_u_isupper(c);
#  398|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  399|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1564]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:424:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:651:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  422|   					(pg_char_properties[c] & PG_ISLOWER));
#  423|   		case PG_REGEX_STRATEGY_BUILTIN:
#  424|-> 			return pg_u_islower(c);
#  425|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  426|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1565]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:424:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:651:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  422|   					(pg_char_properties[c] & PG_ISLOWER));
#  423|   		case PG_REGEX_STRATEGY_BUILTIN:
#  424|-> 			return pg_u_islower(c);
#  425|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  426|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1566]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:451:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:657:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  449|   					(pg_char_properties[c] & PG_ISGRAPH));
#  450|   		case PG_REGEX_STRATEGY_BUILTIN:
#  451|-> 			return pg_u_isgraph(c);
#  452|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  453|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1567]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:451:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:657:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  449|   					(pg_char_properties[c] & PG_ISGRAPH));
#  450|   		case PG_REGEX_STRATEGY_BUILTIN:
#  451|-> 			return pg_u_isgraph(c);
#  452|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  453|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1568]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:478:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:597:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  476|   					(pg_char_properties[c] & PG_ISPRINT));
#  477|   		case PG_REGEX_STRATEGY_BUILTIN:
#  478|-> 			return pg_u_isprint(c);
#  479|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  480|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1569]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:478:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:597:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  476|   					(pg_char_properties[c] & PG_ISPRINT));
#  477|   		case PG_REGEX_STRATEGY_BUILTIN:
#  478|-> 			return pg_u_isprint(c);
#  479|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  480|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1570]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:505:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:630:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  503|   					(pg_char_properties[c] & PG_ISPUNCT));
#  504|   		case PG_REGEX_STRATEGY_BUILTIN:
#  505|-> 			return pg_u_ispunct(c, !pg_regex_locale->info.builtin.casemap_full);
#  506|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  507|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1571]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:505:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:630:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  503|   					(pg_char_properties[c] & PG_ISPUNCT));
#  504|   		case PG_REGEX_STRATEGY_BUILTIN:
#  505|-> 			return pg_u_ispunct(c, !pg_regex_locale->info.builtin.casemap_full);
#  506|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  507|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1572]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:532:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:648:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  530|   					(pg_char_properties[c] & PG_ISSPACE));
#  531|   		case PG_REGEX_STRATEGY_BUILTIN:
#  532|-> 			return pg_u_isspace(c);
#  533|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  534|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1573]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:532:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:648:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
#  530|   					(pg_char_properties[c] & PG_ISSPACE));
#  531|   		case PG_REGEX_STRATEGY_BUILTIN:
#  532|-> 			return pg_u_isspace(c);
#  533|   		case PG_REGEX_STRATEGY_LIBC_WIDE:
#  534|   			if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1574]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:714:12: branch_false: following ‘false’ branch (when ‘pcc’ is non-NULL)...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:716:9: branch_false: ...to here
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:720:32: acquire_memory: allocated here
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:724:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:779:27: branch_true: following ‘true’ branch (when ‘max_chr >= cur_chr’)...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: branch_true: ...to here
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: throw: if the called function throws an exception...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  779|   	for (cur_chr = 0; cur_chr <= max_chr; cur_chr++)
#  780|   	{
#  781|-> 		if ((*probefunc) (cur_chr))
#  782|   			nmatches++;
#  783|   		else if (nmatches > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1575]
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:713:34: acquire_memory: allocated here
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:714:12: branch_false: following ‘false’ branch (when ‘pcc’ is non-NULL)...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:716:9: branch_false: ...to here
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:724:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:779:27: branch_true: following ‘true’ branch (when ‘max_chr >= cur_chr’)...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: branch_true: ...to here
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: throw: if the called function throws an exception...
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:781:21: danger: ‘pcc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/0)
#  779|   	for (cur_chr = 0; cur_chr <= max_chr; cur_chr++)
#  780|   	{
#  781|-> 		if ((*probefunc) (cur_chr))
#  782|   			nmatches++;
#  783|   		else if (nmatches > 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1576]
postgresql-18beta1/src/backend/regex/rege_dfa.c:1021:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘<unknown>’
postgresql-18beta1/src/backend/regex/rege_dfa.c:985:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/regex/rege_dfa.c:990:9: branch_false: ...to here
postgresql-18beta1/src/backend/regex/rege_dfa.c:1002:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/regex/rege_dfa.c:1004:21: branch_true: ...to here
postgresql-18beta1/src/backend/regex/rege_dfa.c:1006:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/src/backend/regex/rege_dfa.c:1009:21: branch_false: ...to here
postgresql-18beta1/src/backend/regex/rege_dfa.c:1021:25: danger: dereference of NULL ‘lastap.ss’
# 1019|   				lastap = ap;
# 1020|   			assert(ap.ss != NULL);
# 1021|-> 			lastap.ss->inchain[lastap.co] = ss->inchain[i];
# 1022|   		}
# 1023|   		ss->outs[i] = NULL;

Error: CPPCHECK_WARNING (CWE-457): [#def1577]
postgresql-18beta1/src/backend/regex/regexec.c:235: warning[uninitvar]: Uninitialized variable: v->pmatch
#  233|   		else
#  234|   			v->pmatch = (regmatch_t *) MALLOC(v->nmatch * sizeof(regmatch_t));
#  235|-> 		if (v->pmatch == NULL)
#  236|   			return REG_ESPACE;
#  237|   		zapallsubs(v->pmatch, v->nmatch);

Error: CPPCHECK_WARNING (CWE-457): [#def1578]
postgresql-18beta1/src/backend/replication/logical/logical.c:2158: warning[uninitvar]: Uninitialized variable: retlsn
# 2156|   	PG_END_TRY();
# 2157|   
# 2158|-> 	return retlsn;
# 2159|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1579]
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3615:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘txn’
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3599:1: enter_function: entry to ‘ReorderBufferXidHasBaseSnapshot’
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3603:15: call_function: calling ‘ReorderBufferTXNByXid’ from ‘ReorderBufferXidHasBaseSnapshot’
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3603:15: return_function: returning to ‘ReorderBufferXidHasBaseSnapshot’ from ‘ReorderBufferTXNByXid’
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3607:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3611:13: branch_false: ...to here
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3611:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3612:23: branch_true: ...to here
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3612:23: call_function: calling ‘ReorderBufferTXNByXid’ from ‘ReorderBufferXidHasBaseSnapshot’
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3612:23: return_function: returning to ‘ReorderBufferXidHasBaseSnapshot’ from ‘ReorderBufferTXNByXid’
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:3615:16: danger: dereference of NULL ‘txn’
# 3613|   									NULL, InvalidXLogRecPtr, false);
# 3614|   
# 3615|-> 	return txn->base_snapshot != NULL;
# 3616|   }
# 3617|   

Error: CPPCHECK_WARNING (CWE-457): [#def1580]
postgresql-18beta1/src/backend/replication/logical/reorderbuffer.c:4887: error[legacyUninitvar]: Uninitialized variable: chunksize
# 4885|   		elog(ERROR, "unexpected type of toast chunk");
# 4886|   
# 4887|-> 	ent->size += chunksize;
# 4888|   	ent->last_chunk_seq = chunk_seq;
# 4889|   	ent->num_chunks++;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1581]
postgresql-18beta1/src/backend/replication/repl_gram.c:1113:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/backend/replication/repl_gram.c:1071:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/replication/repl_gram.c:1077:28: branch_true: ...to here
postgresql-18beta1/src/backend/replication/repl_gram.c:1100:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/backend/replication/repl_gram.c:1102:7: branch_false: ...to here
postgresql-18beta1/src/backend/replication/repl_gram.c:1111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/replication/repl_gram.c:1113:9: branch_false: ...to here
postgresql-18beta1/src/backend/replication/repl_gram.c:1113:9: danger: use of uninitialized value ‘yyss’ here
# 1111|           if (! yyptr)
# 1112|             YYNOMEM;
# 1113|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1114|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1115|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1582]
postgresql-18beta1/src/backend/replication/syncrep_gram.c:988:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/backend/replication/syncrep_gram.c:946:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/replication/syncrep_gram.c:952:28: branch_true: ...to here
postgresql-18beta1/src/backend/replication/syncrep_gram.c:975:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/backend/replication/syncrep_gram.c:977:7: branch_false: ...to here
postgresql-18beta1/src/backend/replication/syncrep_gram.c:986:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/replication/syncrep_gram.c:988:9: branch_false: ...to here
postgresql-18beta1/src/backend/replication/syncrep_gram.c:988:9: danger: use of uninitialized value ‘yyss’ here
#  986|           if (! yyptr)
#  987|             YYNOMEM;
#  988|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
#  989|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  990|   #  undef YYSTACK_RELOCATE

Error: CPPCHECK_WARNING (CWE-768): [#def1583]
postgresql-18beta1/src/backend/rewrite/rewriteSearchCycle.c:192: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=(makeVar(1,path_varattno,2287,-1,0,0))}),(union ListCell){.ptr_value=(arr)}' depends on order of evaluation of side effects
#  190|   
#  191|   	fexpr = makeFuncExpr(F_ARRAY_CAT, RECORDARRAYOID,
#  192|-> 						 list_make2(makeVar(1, path_varattno, RECORDARRAYOID, -1, 0, 0),
#  193|   									arr),
#  194|   						 InvalidOid, InvalidOid, COERCE_EXPLICIT_CALL);

Error: CPPCHECK_WARNING (CWE-768): [#def1584]
postgresql-18beta1/src/backend/rewrite/rewriteSearchCycle.c:558: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(cycle_col_rowexpr)},((union ListCell){.ptr_value=(makeVar(1,cpa_attno,2287,-1,0,0))})' depends on order of evaluation of side effects
#  556|   		saoe->opno = RECORD_EQ_OP;
#  557|   		saoe->useOr = true;
#  558|-> 		saoe->args = list_make2(cycle_col_rowexpr,
#  559|   								makeVar(1, cpa_attno, RECORDARRAYOID, -1, 0, 0));
#  560|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1585]
postgresql-18beta1/src/backend/statistics/dependencies.c:795:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18beta1/src/backend/statistics/dependencies.c:741:1: enter_function: entry to ‘dependency_is_compatible_clause’
postgresql-18beta1/src/backend/statistics/dependencies.c:746:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/statistics/dependencies.c:751:21: branch_true: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:751:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/statistics/dependencies.c:755:36: branch_false: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:755:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/statistics/dependencies.c:758:17: branch_false: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:761:13: call_function: inlined call to ‘is_opclause’ from ‘dependency_is_compatible_clause’
postgresql-18beta1/src/backend/statistics/dependencies.c:795:18: branch_false: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:795:18: danger: dereference of NULL ‘clause’
#  793|   		/* OK to proceed with checking "var" */
#  794|   	}
#  795|-> 	else if (IsA(clause, ScalarArrayOpExpr))
#  796|   	{
#  797|   		/* If it's a scalar array operator, check for Var IN Const. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1586]
postgresql-18beta1/src/backend/statistics/dependencies.c:1223:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18beta1/src/backend/statistics/dependencies.c:1168:1: enter_function: entry to ‘dependency_is_compatible_expression’
postgresql-18beta1/src/backend/statistics/dependencies.c:1174:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/statistics/dependencies.c:1179:21: branch_true: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:1179:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/statistics/dependencies.c:1183:36: branch_false: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:1183:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/statistics/dependencies.c:1186:17: branch_false: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:1189:13: call_function: inlined call to ‘is_opclause’ from ‘dependency_is_compatible_expression’
postgresql-18beta1/src/backend/statistics/dependencies.c:1223:18: branch_false: ...to here
postgresql-18beta1/src/backend/statistics/dependencies.c:1223:18: danger: dereference of NULL ‘clause’
# 1221|   		/* OK to proceed with checking "var" */
# 1222|   	}
# 1223|-> 	else if (IsA(clause, ScalarArrayOpExpr))
# 1224|   	{
# 1225|   		/* If it's a scalar array operator, check for Var IN Const. */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1587]
postgresql-18beta1/src/backend/statistics/mcv.c:1710:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18beta1/src/backend/statistics/mcv.c:2126:1: enter_function: entry to ‘mcv_clause_selectivity_or’
postgresql-18beta1/src/backend/statistics/mcv.c:2140:23: call_function: calling ‘mcv_get_match_bitmap’ from ‘mcv_clause_selectivity_or’
# 1708|   			}
# 1709|   		}
# 1710|-> 		else if (IsA(clause, ScalarArrayOpExpr))
# 1711|   		{
# 1712|   			ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) clause;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1588]
postgresql-18beta1/src/backend/storage/file/fd.c:2771:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(command,  mode)’
postgresql-18beta1/src/backend/storage/file/fd.c:2756:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/storage/file/fd.c:2763:9: branch_true: ...to here
postgresql-18beta1/src/backend/storage/file/fd.c:2769:16: acquire_memory: allocated here
postgresql-18beta1/src/backend/storage/file/fd.c:2771:9: throw: if ‘pqsignal_be’ throws an exception...
postgresql-18beta1/src/backend/storage/file/fd.c:2771:9: danger: ‘popen(command,  mode)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 2769|   	file = popen(command, mode);
# 2770|   	save_errno = errno;
# 2771|-> 	pqsignal(SIGPIPE, SIG_IGN);
# 2772|   	errno = save_errno;
# 2773|   	if (file != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1589]
postgresql-18beta1/src/backend/storage/file/fd.c:2779:38: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/storage/file/fd.c:2756:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/storage/file/fd.c:2763:9: branch_true: ...to here
postgresql-18beta1/src/backend/storage/file/fd.c:2769:16: acquire_memory: allocated here
postgresql-18beta1/src/backend/storage/file/fd.c:2779:38: throw: if ‘GetCurrentSubTransactionId’ throws an exception...
postgresql-18beta1/src/backend/storage/file/fd.c:2779:38: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 2777|   		desc->kind = AllocateDescPipe;
# 2778|   		desc->desc.file = file;
# 2779|-> 		desc->create_subid = GetCurrentSubTransactionId();
# 2780|   		numAllocatedDescs++;
# 2781|   		return desc->desc.file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1590]
postgresql-18beta1/src/backend/storage/file/fd.c:2931:38: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/storage/file/fd.c:2915:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/storage/file/fd.c:2922:9: branch_true: ...to here
postgresql-18beta1/src/backend/storage/file/fd.c:2925:20: acquire_memory: allocated here
postgresql-18beta1/src/backend/storage/file/fd.c:2931:38: throw: if ‘GetCurrentSubTransactionId’ throws an exception...
postgresql-18beta1/src/backend/storage/file/fd.c:2931:38: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 2929|   		desc->kind = AllocateDescDir;
# 2930|   		desc->desc.dir = dir;
# 2931|-> 		desc->create_subid = GetCurrentSubTransactionId();
# 2932|   		numAllocatedDescs++;
# 2933|   		return desc->desc.dir;

Error: CPPCHECK_WARNING (CWE-457): [#def1591]
postgresql-18beta1/src/backend/storage/ipc/dsm_registry.c:199: error[legacyUninitvar]: Uninitialized variable: ret
#  197|   	MemoryContextSwitchTo(oldcontext);
#  198|   
#  199|-> 	return ret;
#  200|   }

Error: CPPCHECK_WARNING (CWE-909): [#def1592]
postgresql-18beta1/src/backend/storage/lmgr/lmgr.c:726: error[uninitStructMember]: Uninitialized struct member: callback.previous
#  724|   
#  725|   	if (oper != XLTW_None)
#  726|-> 		error_context_stack = callback.previous;
#  727|   }
#  728|   

Error: CPPCHECK_WARNING (CWE-457): [#def1593]
postgresql-18beta1/src/backend/storage/lmgr/lock.c:2000: warning[uninitvar]: Uninitialized variable: result
# 1998|   									locallock->tag.mode);
# 1999|   
# 2000|-> 	return result;
# 2001|   }
# 2002|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1594]
postgresql-18beta1/src/backend/storage/page/bufpage.c:523:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*itemidptr.itemoff’
postgresql-18beta1/src/backend/storage/page/bufpage.c:698:1: enter_function: entry to ‘PageRepairFragmentation’
postgresql-18beta1/src/backend/storage/page/bufpage.c:722:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/storage/page/bufpage.c:724:17: branch_false: ...to here
postgresql-18beta1/src/backend/storage/page/bufpage.c:722:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/storage/page/bufpage.c:726:17: branch_false: ...to here
postgresql-18beta1/src/backend/storage/page/bufpage.c:722:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/storage/page/bufpage.c:735:17: call_function: inlined call to ‘PageGetMaxOffsetNumber’ from ‘PageRepairFragmentation’
postgresql-18beta1/src/backend/storage/page/bufpage.c:735:9: branch_true: ...to here
postgresql-18beta1/src/backend/storage/page/bufpage.c:739:37: branch_false: following ‘false’ branch (when ‘i > nline’)...
postgresql-18beta1/src/backend/storage/page/bufpage.c:776:30: branch_false: ...to here
postgresql-18beta1/src/backend/storage/page/bufpage.c:777:12: branch_false: following ‘false’ branch (when ‘nstorage != 0’)...
postgresql-18beta1/src/backend/storage/page/bufpage.c:785:39: branch_false: ...to here
postgresql-18beta1/src/backend/storage/page/bufpage.c:785:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/storage/page/bufpage.c:791:17: branch_false: ...to here
postgresql-18beta1/src/backend/storage/page/bufpage.c:791:17: call_function: calling ‘compactify_tuples’ from ‘PageRepairFragmentation’
#  521|   		{
#  522|   			itemidptr = &itemidbase[i];
#  523|-> 			if (upper != itemidptr->itemoff + itemidptr->alignedlen)
#  524|   				break;
#  525|   			upper -= itemidptr->alignedlen;

Error: CPPCHECK_WARNING (CWE-457): [#def1595]
postgresql-18beta1/src/backend/tcop/pquery.c:636: warning[uninitvar]: Uninitialized variables: oldContext.type, oldContext.isReset, oldContext.allowInCritSection, oldContext.mem_allocated, oldContext.methods, oldContext.parent, oldContext.firstchild, oldContext.prevchild, oldContext.nextchild, oldContext.name, oldContext.ident, oldContext.reset_cbs
#  634|   	PG_END_TRY();
#  635|   
#  636|-> 	MemoryContextSwitchTo(oldContext);
#  637|   
#  638|   	ActivePortal = saveActivePortal;

Error: CPPCHECK_WARNING (CWE-457): [#def1596]
postgresql-18beta1/src/backend/tcop/pquery.c:1503: warning[uninitvar]: Uninitialized variables: oldContext.type, oldContext.isReset, oldContext.allowInCritSection, oldContext.mem_allocated, oldContext.methods, oldContext.parent, oldContext.firstchild, oldContext.prevchild, oldContext.nextchild, oldContext.name, oldContext.ident, oldContext.reset_cbs
# 1501|   	PG_END_TRY();
# 1502|   
# 1503|-> 	MemoryContextSwitchTo(oldContext);
# 1504|   
# 1505|   	/* Mark portal not active */

Error: CPPCHECK_WARNING (CWE-457): [#def1597]
postgresql-18beta1/src/backend/tcop/pquery.c:1512: warning[uninitvar]: Uninitialized variable: result
# 1510|   	PortalContext = savePortalContext;
# 1511|   
# 1512|-> 	return result;
# 1513|   }
# 1514|   

Error: CPPCHECK_WARNING (CWE-457): [#def1598]
postgresql-18beta1/src/backend/tsearch/dict_synonym.c:232: error[uninitvar]: Uninitialized variables: &key.outlen, &key.flags
#  230|   	key.out = NULL;
#  231|   
#  232|-> 	found = (Syn *) bsearch(&key, d->syn, d->len, sizeof(Syn), compareSyn);
#  233|   	pfree(key.in);
#  234|   

Error: COMPILER_WARNING (CWE-704): [#def1599]
postgresql-18beta1/src/backend/tsearch/spell.c: scope_hint: In function ‘CheckCompoundAffixes’
postgresql-18beta1/src/backend/tsearch/spell.c:2327:60: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2327 |                         if (len > (*ptr)->len && (affbegin = strstr(word, (*ptr)->affix)) != NULL)
#      |                                                            ^
# 2325|   		while ((*ptr)->affix)
# 2326|   		{
# 2327|-> 			if (len > (*ptr)->len && (affbegin = strstr(word, (*ptr)->affix)) != NULL)
# 2328|   			{
# 2329|   				len = (*ptr)->len + (affbegin - word);

Error: COMPILER_WARNING (CWE-704): [#def1600]
postgresql-18beta1/src/backend/tsearch/spell.c:2327:60: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2325|   		while ((*ptr)->affix)
# 2326|   		{
# 2327|-> 			if (len > (*ptr)->len && (affbegin = strstr(word, (*ptr)->affix)) != NULL)
# 2328|   			{
# 2329|   				len = (*ptr)->len + (affbegin - word);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1601]
postgresql-18beta1/src/backend/tsearch/ts_parse.c:82:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘res’
postgresql-18beta1/src/backend/tsearch/ts_parse.c:540:1: enter_function: entry to ‘hlparsetext’
postgresql-18beta1/src/backend/tsearch/ts_parse.c:590:38: call_function: calling ‘LexizeExec’ from ‘hlparsetext’
#   80|   	else
#   81|   		list->head = list->tail = newpl;
#   82|-> 	newpl->next = NULL;
#   83|   }
#   84|   

Error: CPPCHECK_WARNING (CWE-476): [#def1602]
postgresql-18beta1/src/backend/tsearch/wparser.c:196: error[nullPointer]: Null pointer dereference
#  194|   		}
#  195|   		st->list[st->cur].lexeme = palloc(llen + 1);
#  196|-> 		memcpy(st->list[st->cur].lexeme, lex, llen);
#  197|   		st->list[st->cur].lexeme[llen] = '\0';
#  198|   		st->list[st->cur].type = type;

Error: CPPCHECK_WARNING (CWE-476): [#def1603]
postgresql-18beta1/src/backend/tsearch/wparser.c:196: error[nullPointer]: Null pointer dereference: lex
#  194|   		}
#  195|   		st->list[st->cur].lexeme = palloc(llen + 1);
#  196|-> 		memcpy(st->list[st->cur].lexeme, lex, llen);
#  197|   		st->list[st->cur].lexeme[llen] = '\0';
#  198|   		st->list[st->cur].type = type;

Error: CPPCHECK_WARNING (CWE-476): [#def1604]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:454: error[ctunullpointer]: Null pointer dereference: prs
#  452|    * an alpha character, but not a member of other char classes.
#  453|    */
#  454|-> p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1605]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:454: warning[nullPointer]: Possible null pointer dereference: prs
#  452|    * an alpha character, but not a member of other char classes.
#  453|    */
#  454|-> p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1606]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:455: error[ctunullpointer]: Null pointer dereference: prs
#  453|    */
#  454|   p_iswhat(alnum, 1)
#  455|-> p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1607]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:455: warning[nullPointer]: Possible null pointer dereference: prs
#  453|    */
#  454|   p_iswhat(alnum, 1)
#  455|-> p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1608]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:456: error[ctunullpointer]: Null pointer dereference: prs
#  454|   p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|-> p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1609]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:456: warning[nullPointer]: Possible null pointer dereference: prs
#  454|   p_iswhat(alnum, 1)
#  455|   p_iswhat(alpha, 1)
#  456|-> p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1610]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:457: error[ctunullpointer]: Null pointer dereference: prs
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|-> p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1611]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:457: warning[nullPointer]: Possible null pointer dereference: prs
#  455|   p_iswhat(alpha, 1)
#  456|   p_iswhat(digit, 0)
#  457|-> p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1612]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:458: error[ctunullpointer]: Null pointer dereference: prs
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|-> p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1613]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:458: warning[nullPointer]: Possible null pointer dereference: prs
#  456|   p_iswhat(digit, 0)
#  457|   p_iswhat(lower, 0)
#  458|-> p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1614]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:459: error[ctunullpointer]: Null pointer dereference: prs
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|-> p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1615]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:459: warning[nullPointer]: Possible null pointer dereference: prs
#  457|   p_iswhat(lower, 0)
#  458|   p_iswhat(print, 0)
#  459|-> p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1616]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:460: error[ctunullpointer]: Null pointer dereference: prs
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|-> p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1617]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:460: warning[nullPointer]: Possible null pointer dereference: prs
#  458|   p_iswhat(print, 0)
#  459|   p_iswhat(punct, 0)
#  460|-> p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)

Error: CPPCHECK_WARNING (CWE-476): [#def1618]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:461: error[ctunullpointer]: Null pointer dereference: prs
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|-> p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)
#  463|   

Error: CPPCHECK_WARNING (CWE-476): [#def1619]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:461: warning[nullPointer]: Possible null pointer dereference: prs
#  459|   p_iswhat(punct, 0)
#  460|   p_iswhat(space, 0)
#  461|-> p_iswhat(upper, 0)
#  462|   p_iswhat(xdigit, 0)
#  463|   

Error: CPPCHECK_WARNING (CWE-476): [#def1620]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:462: error[ctunullpointer]: Null pointer dereference: prs
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|-> p_iswhat(xdigit, 0)
#  463|   
#  464|   /* p_iseq should be used only for ascii symbols */

Error: CPPCHECK_WARNING (CWE-476): [#def1621]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:462: warning[nullPointer]: Possible null pointer dereference: prs
#  460|   p_iswhat(space, 0)
#  461|   p_iswhat(upper, 0)
#  462|-> p_iswhat(xdigit, 0)
#  463|   
#  464|   /* p_iseq should be used only for ascii symbols */

Error: CPPCHECK_WARNING (CWE-476): [#def1622]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:470: error[ctunullpointer]: Null pointer dereference: prs
#  468|   {
#  469|   	Assert(prs->state);
#  470|-> 	return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
#  471|   }
#  472|   

Error: CPPCHECK_WARNING (CWE-476): [#def1623]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:470: warning[nullPointer]: Possible null pointer dereference: prs
#  468|   {
#  469|   	Assert(prs->state);
#  470|-> 	return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
#  471|   }
#  472|   

Error: CPPCHECK_WARNING (CWE-476): [#def1624]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:477: error[ctunullpointer]: Null pointer dereference: prs
#  475|   {
#  476|   	Assert(prs->state);
#  477|-> 	return (prs->state->posbyte == prs->lenstr || prs->state->charlen == 0) ? 1 : 0;
#  478|   }
#  479|   

Error: CPPCHECK_WARNING (CWE-476): [#def1625]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:477: warning[nullPointer]: Possible null pointer dereference: prs
#  475|   {
#  476|   	Assert(prs->state);
#  477|-> 	return (prs->state->posbyte == prs->lenstr || prs->state->charlen == 0) ? 1 : 0;
#  478|   }
#  479|   

Error: CPPCHECK_WARNING (CWE-476): [#def1626]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:483: warning[nullPointer]: Possible null pointer dereference: prs
#  481|   p_iseqC(TParser *prs)
#  482|   {
#  483|-> 	return p_iseq(prs, prs->c);
#  484|   }
#  485|   

Error: CPPCHECK_WARNING (CWE-476): [#def1627]
postgresql-18beta1/src/backend/tsearch/wparser_def.c:489: warning[nullPointer]: Possible null pointer dereference: prs
#  487|   p_isneC(TParser *prs)
#  488|   {
#  489|-> 	return !p_iseq(prs, prs->c);
#  490|   }
#  491|   

Error: CPPCHECK_WARNING (CWE-457): [#def1628]
postgresql-18beta1/src/backend/utils/activity/backend_status.c:1259: error[uninitvar]: Uninitialized variables: &key.backendStatus, &key.backend_xid, &key.backend_xmin, &key.backend_subxact_count, &key.backend_subxact_overflowed
# 1257|   	 */
# 1258|   	key.proc_number = procNumber;
# 1259|-> 	return bsearch(&key, localBackendStatusTable, localNumBackends,
# 1260|   				   sizeof(LocalPgBackendStatus), cmp_lbestatus);
# 1261|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1629]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:878:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:867:1: enter_function: entry to ‘pgstat_reset’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:869:44: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_reset’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:878:14: danger: dereference of NULL ‘<unknown>’
#  876|   	pgstat_reset_entry(kind, dboid, objid, ts);
#  877|   
#  878|-> 	if (!kind_info->accessed_across_databases)
#  879|   		pgstat_reset_database_timestamp(dboid, ts);
#  880|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1630]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:895:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:889:1: enter_function: entry to ‘pgstat_reset_of_kind’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:891:44: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_reset_of_kind’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:894:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:895:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:895:17: danger: dereference of NULL ‘<unknown>’
#  893|   
#  894|   	if (kind_info->fixed_amount)
#  895|-> 		kind_info->reset_all_cb(ts);
#  896|   	else
#  897|   		pgstat_reset_entries_of_kind(kind, ts);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1631]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1261:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1226:1: enter_function: entry to ‘pgstat_build_snapshot_fixed’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1228:44: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_build_snapshot_fixed’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1261:9: danger: dereference of NULL ‘<unknown>’
# 1259|   	Assert(!valid[idx]);
# 1260|   
# 1261|-> 	kind_info->snapshot_cb();
# 1262|   
# 1263|   	Assert(!valid[idx]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1632]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1301:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1281:1: enter_function: entry to ‘pgstat_prep_pending_entry’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1299:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1301:45: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_prep_pending_entry’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1301:45: danger: dereference of NULL ‘<unknown>’
# 1299|   	if (entry_ref->pending == NULL)
# 1300|   	{
# 1301|-> 		size_t		entrysize = pgstat_get_kind_info(kind)->pending_size;
# 1302|   
# 1303|   		Assert(entrysize != (size_t) -1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1633]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1342:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1332:1: enter_function: entry to ‘pgstat_delete_pending_entry’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1335:44: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_delete_pending_entry’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1342:13: danger: dereference of NULL ‘<unknown>’
# 1340|   	Assert(!pgstat_get_kind_info(kind)->fixed_amount);
# 1341|   
# 1342|-> 	if (kind_info->delete_pending_cb)
# 1343|   		kind_info->delete_pending_cb(entry_ref);
# 1344|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1634]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1386:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1355:1: enter_function: entry to ‘pgstat_flush_pending_entries’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1372:16: branch_true: following ‘true’ branch (when ‘cur’ is non-NULL)...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1374:34: branch_true: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1386:29: danger: dereference of NULL ‘<unknown>’
# 1384|   
# 1385|   		/* flush the stats, if possible */
# 1386|-> 		did_flush = kind_info->flush_pending_cb(entry_ref, nowait);
# 1387|   
# 1388|   		Assert(did_flush || nowait);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1635]
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1693:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1584:1: enter_function: entry to ‘pgstat_write_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1607:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1619:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1623:50: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1626:47: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_write_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1628:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1628:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1653:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1658:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1677:22: call_function: inlined call to ‘pgstat_is_kind_valid’ from ‘pgstat_write_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1685:51: branch_true: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1687:29: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_write_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1687:29: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_write_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1693:22: danger: dereference of NULL ‘<unknown>’
# 1691|   
# 1692|   		/* skip if no need to write to file */
# 1693|-> 		if (!kind_info->write_to_file)
# 1694|   			continue;
# 1695|   

Error: CPPCHECK_WARNING (CWE-457): [#def1636]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:1351: warning[uninitvar]: Uninitialized variable: dim
# 1349|   
# 1350|   	/* This checks for overflow of array dimensions */
# 1351|-> 	nitems = ArrayGetNItems(ndim, dim);
# 1352|   	ArrayCheckBounds(ndim, dim, lBound);
# 1353|   

Error: CPPCHECK_WARNING (CWE-457): [#def1637]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:1352: warning[uninitvar]: Uninitialized variable: lBound
# 1350|   	/* This checks for overflow of array dimensions */
# 1351|   	nitems = ArrayGetNItems(ndim, dim);
# 1352|-> 	ArrayCheckBounds(ndim, dim, lBound);
# 1353|   
# 1354|   	/*

Error: CPPCHECK_WARNING (CWE-457): [#def1638]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:1697: warning[uninitvar]: Uninitialized variable: buf
# 1695|   	}
# 1696|   
# 1697|-> 	PG_RETURN_TEXT_P(cstring_to_text(buf));
# 1698|   }
# 1699|   

Error: CPPCHECK_WARNING (CWE-457): [#def1639]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:2902: warning[uninitvar]: Uninitialized variable: dim
# 2900|   
# 2901|   		/* complain if too few source items; we ignore extras, however */
# 2902|-> 		if (nelems < ArrayGetNItems(nSubscripts, dim))
# 2903|   			ereport(ERROR,
# 2904|   					(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1640]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3784:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bitmap’
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3782:16: branch_true: following ‘true’ branch (when ‘nelems > 7’)...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3784:21: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3784:21: danger: dereference of NULL ‘bitmap’
# 3782|   	while (nelems >= 8)
# 3783|   	{
# 3784|-> 		if (*bitmap != 0xFF)
# 3785|   			return true;
# 3786|   		bitmap++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1641]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3794:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bitmap’
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3782:16: branch_false: following ‘false’ branch (when ‘nelems <= 7’)...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3782:16: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3792:16: branch_true: following ‘true’ branch (when ‘nelems > 0’)...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3794:22: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:3794:22: danger: dereference of NULL ‘bitmap’
# 3792|   	while (nelems > 0)
# 3793|   	{
# 3794|-> 		if ((*bitmap & bitmask) == 0)
# 3795|   			return true;
# 3796|   		bitmask <<= 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1642]
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:4980:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘destbitmap’
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5703:1: enter_function: entry to ‘makeArrayResultArr’
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5713:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5724:54: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5750:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5751:25: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5751:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5751:25: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/arrayfuncs.c:5751:25: call_function: calling ‘array_bitmap_copy’ from ‘makeArrayResultArr’
# 4978|   	destbitmap += destoffset / 8;
# 4979|   	destbitmask = 1 << (destoffset % 8);
# 4980|-> 	destbitval = *destbitmap;
# 4981|   	if (srcbitmap)
# 4982|   	{

Error: CPPCHECK_WARNING (CWE-457): [#def1643]
postgresql-18beta1/src/backend/utils/adt/dbsize.c:625: warning[uninitvar]: Uninitialized variable: buf
#  623|   	}
#  624|   
#  625|-> 	PG_RETURN_TEXT_P(cstring_to_text(buf));
#  626|   }
#  627|   

Error: CPPCHECK_WARNING (CWE-457): [#def1644]
postgresql-18beta1/src/backend/utils/adt/inet_cidr_ntop.c:285: warning[uninitvar]: Uninitialized variable: outbuf
#  283|   	/* Format CIDR /width. */
#  284|   	(void) SPRINTF((cp, "/%u", bits));
#  285|-> 	if (strlen(outbuf) + 1 > size)
#  286|   		goto emsgsize;
#  287|   	strcpy(dst, outbuf);

Error: CPPCHECK_WARNING (CWE-457): [#def1645]
postgresql-18beta1/src/backend/utils/adt/jsonb.c:101: error[legacyUninitvar]: Uninitialized variable: nbytes
#   99|   		elog(ERROR, "unsupported jsonb version number %d", version);
#  100|   
#  101|-> 	return jsonb_from_cstring(str, nbytes, false, NULL);
#  102|   }
#  103|   

Error: CPPCHECK_WARNING (CWE-457): [#def1646]
postgresql-18beta1/src/backend/utils/adt/jsonb.c:101: error[legacyUninitvar]: Uninitialized variable: str
#   99|   		elog(ERROR, "unsupported jsonb version number %d", version);
#  100|   
#  101|-> 	return jsonb_from_cstring(str, nbytes, false, NULL);
#  102|   }
#  103|   

Error: COMPILER_WARNING (CWE-457): [#def1647]
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c: scope_hint: In function ‘compareJsonbContainers’
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:301:34: warning[-Wmaybe-uninitialized]: ‘va.type’ may be used uninitialized
#  301 |                         res = (va.type > vb.type) ? 1 : -1;
#      |                                ~~^~~~~
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:202:33: note: ‘va’ declared here
#  202 |                 JsonbValue      va,
#      |                                 ^~
#  299|   			Assert(vb.type != jbvBinary);
#  300|   			/* Type-defined order */
#  301|-> 			res = (va.type > vb.type) ? 1 : -1;
#  302|   		}
#  303|   	}

Error: COMPILER_WARNING (CWE-457): [#def1648]
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:301:44: warning[-Wmaybe-uninitialized]: ‘vb.type’ may be used uninitialized
#  301 |                         res = (va.type > vb.type) ? 1 : -1;
#      |                                          ~~^~~~~
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:203:41: note: ‘vb’ declared here
#  203 |                                         vb;
#      |                                         ^~
#  299|   			Assert(vb.type != jbvBinary);
#  300|   			/* Type-defined order */
#  301|-> 			res = (va.type > vb.type) ? 1 : -1;
#  302|   		}
#  303|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def1649]
postgresql-18beta1/src/backend/utils/adt/jsonbsubs.c:152: error[legacyUninitvar]: Uninitialized variable: subExpr
#  150|   		}
#  151|   
#  152|-> 		upperIndexpr = lappend(upperIndexpr, subExpr);
#  153|   	}
#  154|   

Error: CPPCHECK_WARNING (CWE-476): [#def1650]
postgresql-18beta1/src/backend/utils/adt/jsonfuncs.c:5839: warning[nullPointer]: Possible null pointer dereference: res
# 5837|   	}
# 5838|   
# 5839|-> 	if (res->type == jbvArray)
# 5840|   		res->val.array.rawScalar = is_scalar;
# 5841|   

Error: CPPCHECK_WARNING (CWE-457): [#def1651]
postgresql-18beta1/src/backend/utils/adt/jsonpath.c:127: error[legacyUninitvar]: Uninitialized variable: nbytes
#  125|   		elog(ERROR, "unsupported jsonpath version number: %d", version);
#  126|   
#  127|-> 	return jsonPathFromCstring(str, nbytes, NULL);
#  128|   }
#  129|   

Error: CPPCHECK_WARNING (CWE-457): [#def1652]
postgresql-18beta1/src/backend/utils/adt/jsonpath.c:127: error[legacyUninitvar]: Uninitialized variable: str
#  125|   		elog(ERROR, "unsupported jsonpath version number: %d", version);
#  126|   
#  127|-> 	return jsonPathFromCstring(str, nbytes, NULL);
#  128|   }
#  129|   

Error: CPPCHECK_WARNING (CWE-457): [#def1653]
postgresql-18beta1/src/backend/utils/adt/jsonpath_exec.c:1317: error[legacyUninitvar]: Uninitialized variable: datum
# 1315|   				jb = &jbv;
# 1316|   				jb->type = jbvNumeric;
# 1317|-> 				jb->val.numeric = DatumGetNumeric(DirectFunctionCall1(int8_numeric,
# 1318|   																	  datum));
# 1319|   

Error: CPPCHECK_WARNING (CWE-457): [#def1654]
postgresql-18beta1/src/backend/utils/adt/jsonpath_exec.c:1390: error[legacyUninitvar]: Uninitialized variable: bval
# 1388|   				jb = &jbv;
# 1389|   				jb->type = jbvBool;
# 1390|-> 				jb->val.boolean = bval;
# 1391|   
# 1392|   				res = executeNextItem(cxt, jsp, NULL, jb, found, true);

Error: CPPCHECK_WARNING (CWE-457): [#def1655]
postgresql-18beta1/src/backend/utils/adt/jsonpath_exec.c:1597: error[legacyUninitvar]: Uninitialized variable: datum
# 1595|   				jb = &jbv;
# 1596|   				jb->type = jbvNumeric;
# 1597|-> 				jb->val.numeric = DatumGetNumeric(DirectFunctionCall1(int4_numeric,
# 1598|   																	  datum));
# 1599|   

Error: CPPCHECK_WARNING (CWE-768): [#def1656]
postgresql-18beta1/src/backend/utils/adt/jsonpath_exec.c:3516: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(jvl->singleton)},(union ListCell){.ptr_value=(jbv)}' depends on order of evaluation of side effects
# 3514|   	if (jvl->singleton)
# 3515|   	{
# 3516|-> 		jvl->list = list_make2(jvl->singleton, jbv);
# 3517|   		jvl->singleton = NULL;
# 3518|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1657]
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1236:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1194:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1200:28: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1223:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1225:7: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1234:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1236:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.c:1236:9: danger: use of uninitialized value ‘yyss’ here
# 1234|           if (! yyptr)
# 1235|             YYNOMEM;
# 1236|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1237|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1238|   #  undef YYSTACK_RELOCATE

Error: CPPCHECK_WARNING (CWE-768): [#def1658]
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.y:206: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].value)},(union ListCell){.ptr_value=(yyvsp[0].value)}' depends on order of evaluation of side effects
#  204|   accessor_expr:
#  205|   	path_primary					{ $$ = list_make1($1); }
#  206|-> 	| '(' expr ')' accessor_op		{ $$ = list_make2($2, $4); }
#  207|   	| '(' predicate ')' accessor_op	{ $$ = list_make2($2, $4); }
#  208|   	| accessor_expr accessor_op		{ $$ = lappend($1, $2); }

Error: CPPCHECK_WARNING (CWE-768): [#def1659]
postgresql-18beta1/src/backend/utils/adt/jsonpath_gram.y:207: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(yyvsp[-2].value)},(union ListCell){.ptr_value=(yyvsp[0].value)}' depends on order of evaluation of side effects
#  205|   	path_primary					{ $$ = list_make1($1); }
#  206|   	| '(' expr ')' accessor_op		{ $$ = list_make2($2, $4); }
#  207|-> 	| '(' predicate ')' accessor_op	{ $$ = list_make2($2, $4); }
#  208|   	| accessor_expr accessor_op		{ $$ = lappend($1, $2); }
#  209|   	;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1660]
postgresql-18beta1/src/backend/utils/adt/jsonpath_scan.c:5348:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/src/backend/utils/adt/jsonpath_scan.c:4342:1: enter_function: entry to ‘jsonpath_yylex’
postgresql-18beta1/src/backend/utils/adt/jsonpath_scan.c:4839:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/adt/jsonpath_scan.c:4850:43: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/jsonpath_scan.c:4898:17: call_function: calling ‘yy_get_next_buffer’ from ‘jsonpath_yylex’
# 5346|   
# 5347|   	yy_flush_buffer( b , yyscanner);
# 5348|-> 
# 5349|   	b->yy_input_file = file;
# 5350|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1661]
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:510: warning[nullPointer]: Possible null pointer dereference: blocked_instance
#  508|   
#  509|   		lockMethodTable = GetLockTagsMethodTable(&(blocked_instance->locktag));
#  510|-> 		conflictMask = lockMethodTable->conflictTab[blocked_instance->waitLockMode];
#  511|   
#  512|   		/* Now scan the PROCLOCK data for conflicting procs */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1662]
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:510:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘blocked_instance’
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:483:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:485:43: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:497:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:509:58: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/lockfuncs.c:510:61: danger: dereference of NULL ‘blocked_instance’
#  508|   
#  509|   		lockMethodTable = GetLockTagsMethodTable(&(blocked_instance->locktag));
#  510|-> 		conflictMask = lockMethodTable->conflictTab[blocked_instance->waitLockMode];
#  511|   
#  512|   		/* Now scan the PROCLOCK data for conflicting procs */

Error: CPPCHECK_WARNING (CWE-457): [#def1663]
postgresql-18beta1/src/backend/utils/adt/misc.c:760: warning[uninitvar]: Uninitialized variable: values
#  758|   	}
#  759|   
#  760|-> 	return HeapTupleGetDatum(heap_form_tuple(tupdesc, values, isnull));
#  761|   }
#  762|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def1664]
postgresql-18beta1/src/backend/utils/adt/numeric.c:9547:31: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/backend/utils/adt/numeric.c:11450:1: enter_function: entry to ‘power_var_int’
postgresql-18beta1/src/backend/utils/adt/numeric.c:11494:12: branch_false: following ‘false’ branch (when ‘f <= 1.31072e+5’)...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11498:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11498:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11510:43: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11545:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11570:22: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11588:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11589:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11593:16: branch_false: following ‘false’ branch (when ‘mask == 0’)...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11639:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11639:9: call_function: calling ‘free_var’ from ‘power_var_int’
postgresql-18beta1/src/backend/utils/adt/numeric.c:11639:9: return_function: returning to ‘power_var_int’ from ‘free_var’
postgresql-18beta1/src/backend/utils/adt/numeric.c:11642:12: branch_true: following ‘true’ branch (when ‘neg != 0’)...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11643:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11643:17: call_function: calling ‘div_var’ from ‘power_var_int’
# 9545|   	/* load var1 into dividend[0 .. var1ndigitpairs-1], zeroing the rest */
# 9546|   	for (i = 0; i < var1ndigitpairs - 1; i++)
# 9547|-> 		dividend[i] = var1->digits[2 * i] * NBASE + var1->digits[2 * i + 1];
# 9548|   
# 9549|   	if (2 * i + 1 < var1ndigits)

Error: GCC_ANALYZER_WARNING (CWE-126): [#def1665]
postgresql-18beta1/src/backend/utils/adt/numeric.c:9547:61: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/backend/utils/adt/numeric.c:11450:1: enter_function: entry to ‘power_var_int’
postgresql-18beta1/src/backend/utils/adt/numeric.c:11494:12: branch_false: following ‘false’ branch (when ‘f <= 1.31072e+5’)...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11498:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11498:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/numeric.c:11510:43: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:11535:25: call_function: calling ‘div_var’ from ‘power_var_int’
# 9545|   	/* load var1 into dividend[0 .. var1ndigitpairs-1], zeroing the rest */
# 9546|   	for (i = 0; i < var1ndigitpairs - 1; i++)
# 9547|-> 		dividend[i] = var1->digits[2 * i] * NBASE + var1->digits[2 * i + 1];
# 9548|   
# 9549|   	if (2 * i + 1 < var1ndigits)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1666]
postgresql-18beta1/src/backend/utils/adt/numeric.c:12475:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*val.weight’
postgresql-18beta1/src/backend/utils/adt/numeric.c:4975:1: enter_function: entry to ‘do_numeric_accum’
postgresql-18beta1/src/backend/utils/adt/numeric.c:4994:9: call_function: calling ‘init_var_from_num’ from ‘do_numeric_accum’
postgresql-18beta1/src/backend/utils/adt/numeric.c:4994:9: return_function: returning to ‘do_numeric_accum’ from ‘init_var_from_num’
postgresql-18beta1/src/backend/utils/adt/numeric.c:5009:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/numeric.c:5016:23: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:5021:9: call_function: calling ‘accum_sum_add’ from ‘do_numeric_accum’
postgresql-18beta1/src/backend/utils/adt/numeric.c:5021:9: return_function: returning to ‘do_numeric_accum’ from ‘accum_sum_add’
postgresql-18beta1/src/backend/utils/adt/numeric.c:5023:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/adt/numeric.c:5024:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/adt/numeric.c:5024:17: call_function: calling ‘accum_sum_add’ from ‘do_numeric_accum’
#12473|   	 * final carry-propagation phase, if necessary.
#12474|   	 */
#12475|-> 	if (val->weight >= accum_weight)
#12476|   	{
#12477|   		accum_weight = val->weight + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1667]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:560:37: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1668]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1669]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:558:30: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.grouping’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1670]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:559:37: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1671]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:561:39: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1672]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:563:34: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1673]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:562:39: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1674]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:565:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1675]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:564:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1676]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:557:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: throw: if ‘pg_localeconv_free’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:577:9: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  575|   
#  576|   	/* Free the contents of the object populated by pg_localeconv_r(). */
#  577|-> 	pg_localeconv_free(&tmp);
#  578|   
#  579|   	/* If any of the preceding strdup calls failed, complain now. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1677]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:560:37: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(8)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1678]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(8)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1679]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:558:30: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.grouping’ leaks here; was allocated at [(8)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1680]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:559:37: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(8)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1681]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:561:39: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(8)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1682]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:563:34: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(8)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1683]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:562:39: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(8)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1684]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:565:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(8)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1685]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:564:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(8)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1686]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:524:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:533:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:537:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:547:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:556:42: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:557:35: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:580:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:581:17: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(8)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/7)
#  579|   	/* If any of the preceding strdup calls failed, complain now. */
#  580|   	if (!struct_lconv_is_valid(&worklconv))
#  581|-> 		ereport(ERROR,
#  582|   				(errcode(ERRCODE_OUT_OF_MEMORY),
#  583|   				 errmsg("out of memory")));

Error: CPPCHECK_WARNING (CWE-457): [#def1687]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:1090: error[legacyUninitvar]: Uninitialized variable: result
# 1088|   		PGLOCALE_SUPPORT_ERROR(collform->collprovider);
# 1089|   
# 1090|-> 	result->is_default = false;
# 1091|   
# 1092|   	Assert((result->collate_is_c && result->collate == NULL) ||

Error: CPPCHECK_WARNING (CWE-457): [#def1688]
postgresql-18beta1/src/backend/utils/adt/pg_locale.c:1173: error[legacyUninitvar]: Uninitialized variable: result
# 1171|   		PGLOCALE_SUPPORT_ERROR(dbform->datlocprovider);
# 1172|   
# 1173|-> 	result->is_default = true;
# 1174|   	ReleaseSysCache(tup);
# 1175|   

Error: CPPCHECK_WARNING (CWE-768): [#def1689]
postgresql-18beta1/src/backend/utils/adt/rangetypes.c:2947: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lowerExpr)},(union ListCell){.ptr_value=(upperExpr)}' depends on order of evaluation of side effects
# 2945|   
# 2946|   		if (lowerExpr != NULL && upperExpr != NULL)
# 2947|-> 			return (Node *) make_andclause(list_make2(lowerExpr, upperExpr));
# 2948|   		else if (lowerExpr != NULL)
# 2949|   			return (Node *) lowerExpr;

Error: CPPCHECK_WARNING (CWE-768): [#def1690]
postgresql-18beta1/src/backend/utils/adt/regproc.c:418: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(get_namespace_name_or_temp(procform->pronamespace))},(union ListCell){.ptr_value=(pstrdup((procform->proname).data))}' depends on order of evaluation of side effects
#  416|   	nargs = procform->pronargs;
#  417|   
#  418|-> 	*objnames = list_make2(get_namespace_name_or_temp(procform->pronamespace),
#  419|   						   pstrdup(NameStr(procform->proname)));
#  420|   	*objargs = NIL;

Error: CPPCHECK_WARNING (CWE-768): [#def1691]
postgresql-18beta1/src/backend/utils/adt/regproc.c:822: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(get_namespace_name_or_temp(oprForm->oprnamespace))},(union ListCell){.ptr_value=(pstrdup((oprForm->oprname).data))}' depends on order of evaluation of side effects
#  820|   
#  821|   	oprForm = (Form_pg_operator) GETSTRUCT(opertup);
#  822|-> 	*objnames = list_make2(get_namespace_name_or_temp(oprForm->oprnamespace),
#  823|   						   pstrdup(NameStr(oprForm->oprname)));
#  824|   	*objargs = NIL;

Error: CPPCHECK_WARNING (CWE-768): [#def1692]
postgresql-18beta1/src/backend/utils/adt/ruleutils.c:1100: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(oldrte)},(union ListCell){.ptr_value=(newrte)}' depends on order of evaluation of side effects
# 1098|   		/* Build two-element rtable */
# 1099|   		memset(&dpns, 0, sizeof(dpns));
# 1100|-> 		dpns.rtable = list_make2(oldrte, newrte);
# 1101|   		dpns.subplans = NIL;
# 1102|   		dpns.ctes = NIL;

Error: CPPCHECK_WARNING (CWE-768): [#def1693]
postgresql-18beta1/src/backend/utils/adt/selfuncs.c:1970: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},((union ListCell){.ptr_value=(makeConst(nominal_element_type,-1,nominal_element_collation,elmlen,elem_values[i],elem_nulls[i],elmbyval))})' depends on order of evaluation of side effects
# 1968|   			Selectivity s2;
# 1969|   
# 1970|-> 			args = list_make2(leftop,
# 1971|   							  makeConst(nominal_element_type,
# 1972|   										-1,

Error: CPPCHECK_WARNING (CWE-768): [#def1694]
postgresql-18beta1/src/backend/utils/adt/selfuncs.c:2044: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},(union ListCell){.ptr_value=(elem)}' depends on order of evaluation of side effects
# 2042|   			 * estimation function would really care ...
# 2043|   			 */
# 2044|-> 			args = list_make2(leftop, elem);
# 2045|   			if (is_join_clause)
# 2046|   				s2 = DatumGetFloat8(FunctionCall5Coll(&oprselproc,

Error: CPPCHECK_WARNING (CWE-768): [#def1695]
postgresql-18beta1/src/backend/utils/adt/selfuncs.c:2096: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(leftop)},(union ListCell){.ptr_value=(dummyexpr)}' depends on order of evaluation of side effects
# 2094|   		dummyexpr->typeMod = -1;
# 2095|   		dummyexpr->collation = clause->inputcollid;
# 2096|-> 		args = list_make2(leftop, dummyexpr);
# 2097|   		if (is_join_clause)
# 2098|   			s2 = DatumGetFloat8(FunctionCall5Coll(&oprselproc,

Error: CPPCHECK_WARNING (CWE-768): [#def1696]
postgresql-18beta1/src/backend/utils/adt/selfuncs.c:2221: error[unknownEvaluationOrder]: Expression 'T_List,((union ListCell){.ptr_value=((list_nth_cell(clause->largs,0)->ptr_value))}),((union ListCell){.ptr_value=((list_nth_cell(clause->rargs,0)->ptr_value))})' depends on order of evaluation of side effects
# 2219|   
# 2220|   	/* Build equivalent arg list for single operator */
# 2221|-> 	opargs = list_make2(linitial(clause->largs), linitial(clause->rargs));
# 2222|   
# 2223|   	/*

Error: CPPCHECK_WARNING (CWE-457): [#def1697]
postgresql-18beta1/src/backend/utils/adt/timestamp.c:3221: error[legacyUninitvar]: Uninitialized variable: result
# 3219|   	}
# 3220|   
# 3221|-> 	PG_RETURN_TIMESTAMP(result);
# 3222|   }
# 3223|   

Error: CPPCHECK_WARNING (CWE-457): [#def1698]
postgresql-18beta1/src/backend/utils/adt/timestamp.c:3376: error[legacyUninitvar]: Uninitialized variable: result
# 3374|   	}
# 3375|   
# 3376|-> 	return result;
# 3377|   }
# 3378|   

Error: CPPCHECK_WARNING (CWE-190): [#def1699]
postgresql-18beta1/src/backend/utils/adt/tsgistidx.c:188: error[integerOverflow]: Signed integer underflow for expression '*(int32*)&c'.
#  186|   			FIN_LEGACY_CRC32(c);
#  187|   
#  188|-> 			*arr = *(int32 *) &c;
#  189|   			arr++;
#  190|   			ptr++;

Error: CPPCHECK_WARNING (CWE-476): [#def1700]
postgresql-18beta1/src/backend/utils/adt/varlena.c:471: warning[nullPointer]: Possible null pointer dereference: rp
#  469|   		rp = result = NULL;		/* keep compiler quiet */
#  470|   	}
#  471|-> 	*rp = '\0';
#  472|   	PG_RETURN_CSTRING(result);
#  473|   }

Error: COMPILER_WARNING (CWE-704): [#def1701]
postgresql-18beta1/src/backend/utils/adt/xid8funcs.c: scope_hint: In function ‘is_visible_fxid’
postgresql-18beta1/src/backend/utils/adt/xid8funcs.c:198:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  198 |                 res = bsearch(&value, snap->xip, snap->nxip, sizeof(FullTransactionId),
#      |                     ^
#  196|   		void	   *res;
#  197|   
#  198|-> 		res = bsearch(&value, snap->xip, snap->nxip, sizeof(FullTransactionId),
#  199|   					  cmp_fxid);
#  200|   		/* if found, transaction is still in progress */

Error: COMPILER_WARNING (CWE-704): [#def1702]
postgresql-18beta1/src/backend/utils/adt/xid8funcs.c:198:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  196|   		void	   *res;
#  197|   
#  198|-> 		res = bsearch(&value, snap->xip, snap->nxip, sizeof(FullTransactionId),
#  199|   					  cmp_fxid);
#  200|   		/* if found, transaction is still in progress */

Error: CPPCHECK_WARNING (CWE-768): [#def1703]
postgresql-18beta1/src/backend/utils/adt/xml.c:631: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(DatumGetXmlP(fcinfo->args[0].value))},(union ListCell){.ptr_value=(DatumGetXmlP(fcinfo->args[1].value))}' depends on order of evaluation of side effects
#  629|   		PG_RETURN_XML_P(PG_GETARG_XML_P(0));
#  630|   	else
#  631|-> 		PG_RETURN_XML_P(xmlconcat(list_make2(PG_GETARG_XML_P(0),
#  632|   											 PG_GETARG_XML_P(1))));
#  633|   }

Error: CPPCHECK_WARNING (CWE-457): [#def1704]
postgresql-18beta1/src/backend/utils/adt/xml.c:848: warning[uninitvar]: Uninitialized variable: result
#  846|   	pg_xml_done(xmlerrcxt, false);
#  847|   
#  848|-> 	return result;
#  849|   #else
#  850|   	NO_XML_SUPPORT();

Error: CPPCHECK_WARNING (CWE-457): [#def1705]
postgresql-18beta1/src/backend/utils/adt/xml.c:972: warning[uninitvar]: Uninitialized variable: result
#  970|   	pg_xml_done(xmlerrcxt, false);
#  971|   
#  972|-> 	return result;
#  973|   #else
#  974|   	NO_XML_SUPPORT();

Error: CPPCHECK_WARNING (CWE-457): [#def1706]
postgresql-18beta1/src/backend/utils/adt/xml.c:2665: warning[uninitvar]: Uninitialized variable: result
# 2663|   					pg_xml_done(xmlerrcxt, false);
# 2664|   
# 2665|-> 					return result;
# 2666|   				}
# 2667|   #endif							/* USE_LIBXML */

Error: CPPCHECK_WARNING (CWE-457): [#def1707]
postgresql-18beta1/src/backend/utils/cache/catcache.c:2046: warning[uninitvar]: Uninitialized variable: cl
# 2044|   	catcache_in_progress_stack = save_in_progress;
# 2045|   
# 2046|-> 	cl->cl_magic = CL_MAGIC;
# 2047|   	cl->my_cache = cache;
# 2048|   	cl->refcount = 0;			/* for the moment */

Error: CPPCHECK_WARNING (CWE-457): [#def1708]
postgresql-18beta1/src/backend/utils/cache/catcache.c:2050: warning[uninitvar]: Uninitialized variable: ordered
# 2048|   	cl->refcount = 0;			/* for the moment */
# 2049|   	cl->dead = false;
# 2050|-> 	cl->ordered = ordered;
# 2051|   	cl->nkeys = nkeys;
# 2052|   	cl->hash_value = lHashValue;

Error: CPPCHECK_WARNING (CWE-457): [#def1709]
postgresql-18beta1/src/backend/utils/cache/catcache.c:2053: warning[uninitvar]: Uninitialized variable: nmembers
# 2051|   	cl->nkeys = nkeys;
# 2052|   	cl->hash_value = lHashValue;
# 2053|-> 	cl->n_members = nmembers;
# 2054|   
# 2055|   	i = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def1710]
postgresql-18beta1/src/backend/utils/cache/catcache.c:2320: warning[nullPointer]: Possible null pointer dereference: srckeys
# 2318|   		int			attnum = attnos[i];
# 2319|   		Form_pg_attribute att = TupleDescAttr(tupdesc, attnum - 1);
# 2320|-> 		Datum		src = srckeys[i];
# 2321|   		NameData	srcname;
# 2322|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1711]
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:503:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mapdicts’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:385:1: enter_function: entry to ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:424:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:427:43: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:432:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:435:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:487:80: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:497:36: branch_false: following ‘false’ branch (when ‘ndicts <= 0’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:507:47: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:487:80: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:503:41: danger: use of uninitialized value ‘&mapdicts’ here
#  501|   						MemoryContextAlloc(CacheMemoryContext,
#  502|   										   sizeof(Oid) * ndicts);
#  503|-> 					memcpy(maplists[maxtokentype].dictIds, mapdicts,
#  504|   						   sizeof(Oid) * ndicts);
#  505|   				}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1712]
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:530:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mapdicts’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:385:1: enter_function: entry to ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:424:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:427:43: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:432:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:435:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:487:80: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:497:36: branch_false: following ‘false’ branch (when ‘ndicts <= 0’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:507:47: branch_false: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:523:20: branch_true: following ‘true’ branch (when ‘ndicts > 0’)...
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:526:25: branch_true: ...to here
postgresql-18beta1/src/backend/utils/cache/ts_cache.c:530:25: danger: use of uninitialized value ‘&mapdicts’ here
#  528|   				MemoryContextAlloc(CacheMemoryContext,
#  529|   								   sizeof(Oid) * ndicts);
#  530|-> 			memcpy(maplists[maxtokentype].dictIds, mapdicts,
#  531|   				   sizeof(Oid) * ndicts);
#  532|   			/* and save the overall map */

Error: CPPCHECK_WARNING (CWE-457): [#def1713]
postgresql-18beta1/src/backend/utils/cache/typcache.c:2901: warning[uninitvar]: Uninitialized variable: &srch.sort_order
# 2899|   
# 2900|   	srch.enum_oid = arg;
# 2901|-> 	return bsearch(&srch, enumdata->enum_values, enumdata->num_values,
# 2902|   				   sizeof(EnumItem), enum_oid_cmp);
# 2903|   }

Error: CPPCHECK_WARNING (CWE-457): [#def1714]
postgresql-18beta1/src/backend/utils/cache/typcache.c:3001: warning[uninitvar]: Uninitialized variable: typmod_table_entry
# 2999|   	}
# 3000|   	PG_END_TRY();
# 3001|-> 	typmod_table_entry->typmod = typmod;
# 3002|   	typmod_table_entry->shared_tupdesc = shared_dp;
# 3003|   	dshash_release_lock(CurrentSession->shared_typmod_table,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1715]
postgresql-18beta1/src/backend/utils/error/elog.c:1168:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/utils/error/elog.c:752:1: enter_function: entry to ‘get_error_stack_entry’
postgresql-18beta1/src/backend/utils/error/elog.c:762:17: call_function: inlined call to ‘errstart_cold’ from ‘get_error_stack_entry’
# 1166|   
# 1167|   	edata->message_id = fmt;
# 1168|-> 	EVALUATE_MESSAGE(edata->domain, message, false, false);
# 1169|   
# 1170|   	MemoryContextSwitchTo(oldcontext);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1716]
postgresql-18beta1/src/backend/utils/error/elog.c:1681:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/utils/error/elog.c:2242:1: enter_function: entry to ‘check_log_destination’
postgresql-18beta1/src/backend/utils/error/elog.c:2254:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/error/elog.c:2257:17: branch_false: ...to here
postgresql-18beta1/src/backend/utils/error/elog.c:2257:17: call_function: calling ‘format_elog_string’ from ‘check_log_destination’
# 1679|   
# 1680|   	return edata->message;
# 1681|-> }
# 1682|   
# 1683|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1717]
postgresql-18beta1/src/backend/utils/error/elog.c:3795:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/utils/error/elog.c:3792:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/utils/error/elog.c:3795:9: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/src/backend/utils/error/elog.c:3795:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 3793|   #ifndef WIN32
# 3794|   	/* On Unix, we just fprintf to stderr */
# 3795|-> 	vfprintf(stderr, fmt, ap);
# 3796|   	fflush(stderr);
# 3797|   #else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1718]
postgresql-18beta1/src/backend/utils/error/jsonlog.c:88:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/utils/error/jsonlog.c:87:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/utils/error/jsonlog.c:88:26: throw: if ‘pvsnprintf’ throws an exception...
postgresql-18beta1/src/backend/utils/error/jsonlog.c:88:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   86|   		errno = save_errno;
#   87|   		va_start(args, fmt);
#   88|-> 		newlen = pvsnprintf(value, len, fmt, args);
#   89|   		va_end(args);
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1719]
postgresql-18beta1/src/backend/utils/init/postinit.c:1302:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/init/postinit.c:1251:1: enter_function: entry to ‘process_startup_options’
postgresql-18beta1/src/backend/utils/init/postinit.c:1293:19: call_function: inlined call to ‘list_head’ from ‘process_startup_options’
postgresql-18beta1/src/backend/utils/init/postinit.c:1294:16: branch_true: following ‘true’ branch (when ‘gucopts’ is non-NULL)...
postgresql-18beta1/src/backend/utils/init/postinit.c:1299:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/init/postinit.c:1302:17: danger: dereference of NULL ‘<unknown>’
# 1300|   		gucopts = lnext(port->guc_options, gucopts);
# 1301|   
# 1302|-> 		value = lfirst(gucopts);
# 1303|   		gucopts = lnext(port->guc_options, gucopts);
# 1304|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1720]
postgresql-18beta1/src/backend/utils/misc/guc-file.c:1608:54: warning[-Wanalyzer-malloc-leak]: leak of ‘GUC_yy_create_buffer(fp, 16384,  yyg)’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 1606|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1607|   	 * we need to put in 2 end-of-buffer characters.
# 1608|-> 	 */
# 1609|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1610|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1721]
postgresql-18beta1/src/backend/utils/misc/guc-file.c:1608:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 1606|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1607|   	 * we need to put in 2 end-of-buffer characters.
# 1608|-> 	 */
# 1609|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1610|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1722]
postgresql-18beta1/src/backend/utils/misc/guc-file.c:1692:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘yyscanner’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 1690|   	b->yy_at_bol = 1;
# 1691|   	b->yy_buffer_status = YY_BUFFER_NEW;
# 1692|-> 
# 1693|   	if ( b == YY_CURRENT_BUFFER )
# 1694|   		yy_load_buffer_state( yyscanner );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1723]
postgresql-18beta1/src/backend/utils/misc/guc-file.c:1784:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 1782|   		yy_size_t grow_size = 8 /* arbitrary grow size */;
# 1783|   
# 1784|-> 		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
# 1785|   		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
# 1786|   								(yyg->yy_buffer_stack,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1724]
postgresql-18beta1/src/backend/utils/misc/guc-file.l:286:16: warning[-Wanalyzer-malloc-leak]: leak of ‘scanner’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
#  284|   	ConfigVariable *item;
#  285|   
#  286|-> 	item = palloc(sizeof *item);
#  287|   	item->name = NULL;
#  288|   	item->value = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1725]
postgresql-18beta1/src/backend/utils/misc/guc-file.l:372:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scanner’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
#  370|   		 * that the state remains sane enough for yy_delete_buffer().
#  371|   		 */
#  372|-> 		elog(elevel, "%s at file \"%s\" line %u",
#  373|   			 GUC_flex_fatal_errmsg, config_file, ConfigFileLineno);
#  374|   		record_config_file_error(GUC_flex_fatal_errmsg,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1726]
postgresql-18beta1/src/backend/utils/misc/guc-file.l:391:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:581:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:594:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:601:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:47: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc-file.l:603:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
#  389|   	yyg = (struct yyguts_t *) scanner;
#  390|   
#  391|-> 	lex_buffer = yy_create_buffer(fp, YY_BUF_SIZE, scanner);
#  392|   	yy_switch_to_buffer(lex_buffer, scanner);
#  393|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1727]
postgresql-18beta1/src/backend/utils/misc/guc.c:5989:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/backend/utils/misc/guc.c:5985:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc.c:5988:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc.c:5988:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/backend/utils/misc/guc.c:5989:13: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/backend/utils/misc/guc.c:5989:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 5987|   
# 5988|   	va_start(vargs, fmt);
# 5989|-> 	n = vsnprintf(*destptr, *maxbytes, fmt, vargs);
# 5990|   	va_end(vargs);
# 5991|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1728]
postgresql-18beta1/src/backend/utils/misc/guc.c:6672:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘eqsgn’
postgresql-18beta1/src/backend/utils/misc/guc.c:6644:12: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/guc.c:6648:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc.c:6648:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/guc.c:6652:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/guc.c:6654:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/guc.c:6661:21: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/guc.c:6672:17: danger: dereference of NULL ‘eqsgn’
# 6670|   
# 6671|   		eqsgn = strchr(val, '=');
# 6672|-> 		*eqsgn = '\0';
# 6673|   
# 6674|   		/* skip if we have permission to delete it */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1729]
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/utils/misc/ps_status.c:138:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:140:28: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:140:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:141:51: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:144:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:144:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:193:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:193:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:198:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:200:36: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:200:42: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:201:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:198:49: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:198:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:200:36: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:201:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  201|   			if (!new_environ[i])
#  202|   			{
#  203|-> 				write_stderr("out of memory\n");
#  204|   				exit(1);
#  205|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1730]
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_environ’
postgresql-18beta1/src/backend/utils/misc/ps_status.c:138:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:140:28: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:140:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:141:51: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:144:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:144:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:192:41: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:193:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:193:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:198:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:200:36: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:201:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:203:33: danger: ‘new_environ’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  201|   			if (!new_environ[i])
#  202|   			{
#  203|-> 				write_stderr("out of memory\n");
#  204|   				exit(1);
#  205|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1731]
postgresql-18beta1/src/backend/utils/misc/ps_status.c:238:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_argv’
postgresql-18beta1/src/backend/utils/misc/ps_status.c:138:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:140:28: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:140:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:141:51: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:144:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:144:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:193:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:193:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:198:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:207:28: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:227:38: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:228:20: branch_false: following ‘false’ branch (when ‘new_argv’ is non-NULL)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:228:20: branch_false: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:233:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:235:50: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:236:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:238:33: branch_true: ...to here
postgresql-18beta1/src/backend/utils/misc/ps_status.c:238:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18beta1/src/backend/utils/misc/ps_status.c:238:33: danger: ‘new_argv’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  236|   			if (!new_argv[i])
#  237|   			{
#  238|-> 				write_stderr("out of memory\n");
#  239|   				exit(1);
#  240|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1732]
postgresql-18beta1/src/backend/utils/mmgr/aset.c:513:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18beta1/src/backend/utils/mmgr/aset.c:444:26: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:445:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:462:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:513:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:513:9: danger: ‘set’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  511|   
#  512|   	/* Finally, do the type-independent part of context creation */
#  513|-> 	MemoryContextCreate((MemoryContext) set,
#  514|   						T_AllocSetContext,
#  515|   						MCTX_ASET_ID,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1733]
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
postgresql-18beta1/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: danger: ‘block’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  917|   		if (blksize < required_size)
#  918|   			break;
#  919|-> 		block = (AllocBlock) malloc(blksize);
#  920|   	}
#  921|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1734]
postgresql-18beta1/src/backend/utils/mmgr/aset.c:923:24: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
postgresql-18beta1/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:919:38: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:922:12: branch_true: following ‘true’ branch (when ‘block’ is NULL)...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:923:24: branch_true: ...to here
postgresql-18beta1/src/backend/utils/mmgr/aset.c:923:24: throw: if ‘MemoryContextAllocationFailure’ throws an exception...
postgresql-18beta1/src/backend/utils/mmgr/aset.c:923:24: danger: ‘block’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  921|   
#  922|   	if (block == NULL)
#  923|-> 		return MemoryContextAllocationFailure(context, size, flags);
#  924|   
#  925|   	context->mem_allocated += blksize;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1735]
postgresql-18beta1/src/backend/utils/mmgr/bump.c:227:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18beta1/src/backend/utils/mmgr/bump.c:131:1: enter_function: entry to ‘BumpContextCreate’
postgresql-18beta1/src/backend/utils/mmgr/bump.c:177:31: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/mmgr/bump.c:178:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18beta1/src/backend/utils/mmgr/bump.c:192:9: call_function: inlined call to ‘dlist_init’ from ‘BumpContextCreate’
postgresql-18beta1/src/backend/utils/mmgr/bump.c:222:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/mmgr/bump.c:227:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/bump.c:227:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/src/backend/utils/mmgr/bump.c:227:9: danger: ‘set’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  225|   
#  226|   	/* Finally, do the type-independent part of context creation */
#  227|-> 	MemoryContextCreate((MemoryContext) set, T_BumpContext, MCTX_BUMP_ID,
#  228|   						parent, name);
#  229|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1736]
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1441:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘result.index’
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1476:1: enter_function: entry to ‘FreePageManagerPutInternal’
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1489:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1491:21: branch_true: ...to here
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1491:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1499:26: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1499:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1509:26: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1509:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1525:30: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1527:33: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1527:33: branch_false: following ‘false’ branch (when ‘soft == 0’)...
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1529:34: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1529:34: call_function: calling ‘FreePageManagerGetInternal’ from ‘FreePageManagerPutInternal’
# 1439|   		Assert(result.found);
# 1440|   		if (victim->npages == npages)
# 1441|-> 			FreePageBtreeRemove(fpm, result.page, result.index);
# 1442|   		else
# 1443|   		{

Error: CPPCHECK_WARNING (CWE-457): [#def1737]
postgresql-18beta1/src/backend/utils/mmgr/freepage.c:1538: error[legacyUninitvar]: Uninitialized variable: root
# 1536|   
# 1537|   			/* Create the btree and move the preexisting range into it. */
# 1538|-> 			root->hdr.magic = FREE_PAGE_LEAF_MAGIC;
# 1539|   			root->hdr.nused = 1;
# 1540|   			relptr_store(base, root->hdr.parent, (FreePageBtree *) NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1738]
postgresql-18beta1/src/backend/utils/mmgr/generation.c:262:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18beta1/src/backend/utils/mmgr/generation.c:160:1: enter_function: entry to ‘GenerationContextCreate’
postgresql-18beta1/src/backend/utils/mmgr/generation.c:209:37: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/mmgr/generation.c:210:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18beta1/src/backend/utils/mmgr/generation.c:224:9: call_function: inlined call to ‘dlist_init’ from ‘GenerationContextCreate’
postgresql-18beta1/src/backend/utils/mmgr/generation.c:257:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/mmgr/generation.c:262:9: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/generation.c:262:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/src/backend/utils/mmgr/generation.c:262:9: danger: ‘set’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  260|   
#  261|   	/* Finally, do the type-independent part of context creation */
#  262|-> 	MemoryContextCreate((MemoryContext) set,
#  263|   						T_GenerationContext,
#  264|   						MCTX_GENERATION_ID,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1739]
postgresql-18beta1/src/backend/utils/mmgr/mcxt.c:959:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*num_contexts’
postgresql-18beta1/src/backend/utils/mmgr/mcxt.c:860:1: enter_function: entry to ‘MemoryContextStatsDetail’
postgresql-18beta1/src/backend/utils/mmgr/mcxt.c:876:9: call_function: calling ‘MemoryContextStatsInternal’ from ‘MemoryContextStatsDetail’
#  957|   
#  958|   	/* Increment the context count for each of the recursive call */
#  959|-> 	*num_contexts = *num_contexts + 1;
#  960|   
#  961|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1740]
postgresql-18beta1/src/backend/utils/mmgr/slab.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘slab’
postgresql-18beta1/src/backend/utils/mmgr/slab.c:322:1: enter_function: entry to ‘SlabContextCreate’
postgresql-18beta1/src/backend/utils/mmgr/slab.c:358:12: branch_false: following ‘false’ branch (when ‘chunksPerBlock != 0’)...
postgresql-18beta1/src/backend/utils/mmgr/slab.c:364:32: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/slab.c:364:32: acquire_memory: allocated here
postgresql-18beta1/src/backend/utils/mmgr/slab.c:365:12: branch_false: following ‘false’ branch (when ‘slab’ is non-NULL)...
postgresql-18beta1/src/backend/utils/mmgr/slab.c:381:27: branch_false: ...to here
postgresql-18beta1/src/backend/utils/mmgr/slab.c:405:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
postgresql-18beta1/src/backend/utils/mmgr/slab.c:406:17: call_function: inlined call to ‘dlist_init’ from ‘SlabContextCreate’
postgresql-18beta1/src/backend/utils/mmgr/slab.c:414:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18beta1/src/backend/utils/mmgr/slab.c:414:9: danger: ‘slab’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  412|   
#  413|   	/* Finally, do the type-independent part of context creation */
#  414|-> 	MemoryContextCreate((MemoryContext) slab,
#  415|   						T_SlabContext,
#  416|   						MCTX_SLAB_ID,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1741]
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:684:23: acquire_resource: opened here
postgresql-18beta1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: danger: ‘fopen(path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  685|   		pg_fatal("could not open file \"%s\" for reading: %m", path);
#  686|   
#  687|-> 	initStringInfo(&line);
#  688|   
#  689|   	maxlines = 1024;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1742]
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:684:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  685|   		pg_fatal("could not open file \"%s\" for reading: %m", path);
#  686|   
#  687|-> 	initStringInfo(&line);
#  688|   
#  689|   	maxlines = 1024;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1743]
postgresql-18beta1/src/bin/initdb/initdb.c:690:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:684:23: acquire_resource: opened here
postgresql-18beta1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:690:28: throw: if ‘pg_malloc’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:690:28: danger: ‘fopen(path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  688|   
#  689|   	maxlines = 1024;
#  690|-> 	result = (char **) pg_malloc(maxlines * sizeof(char *));
#  691|   
#  692|   	n = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1744]
postgresql-18beta1/src/bin/initdb/initdb.c:690:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:684:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:690:28: throw: if ‘pg_malloc’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:690:28: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  688|   
#  689|   	maxlines = 1024;
#  690|-> 	result = (char **) pg_malloc(maxlines * sizeof(char *));
#  691|   
#  692|   	n = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1745]
postgresql-18beta1/src/bin/initdb/initdb.c:693:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:684:23: acquire_resource: opened here
postgresql-18beta1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:693:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:693:16: danger: ‘fopen(path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  691|   
#  692|   	n = 0;
#  693|-> 	while (pg_get_line_buf(infile, &line))
#  694|   	{
#  695|   		/* make sure there will be room for a trailing NULL pointer */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1746]
postgresql-18beta1/src/bin/initdb/initdb.c:693:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:684:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:693:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:693:16: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  691|   
#  692|   	n = 0;
#  693|-> 	while (pg_get_line_buf(infile, &line))
#  694|   	{
#  695|   		/* make sure there will be room for a trailing NULL pointer */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1747]
postgresql-18beta1/src/bin/initdb/initdb.c:730:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
postgresql-18beta1/src/bin/initdb/initdb.c:728:25: acquire_resource: opened here
postgresql-18beta1/src/bin/initdb/initdb.c:728:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:728:12: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:730:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:732:21: branch_true: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:730:28: danger: ‘fopen(path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  728|   	if ((out_file = fopen(path, "w")) == NULL)
#  729|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
#  730|-> 	for (line = lines; *line != NULL; line++)
#  731|   	{
#  732|   		if (fputs(*line, out_file) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1748]
postgresql-18beta1/src/bin/initdb/initdb.c:730:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
postgresql-18beta1/src/bin/initdb/initdb.c:728:25: acquire_memory: allocated here
postgresql-18beta1/src/bin/initdb/initdb.c:728:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:728:12: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:730:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:732:21: branch_true: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:730:28: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  728|   	if ((out_file = fopen(path, "w")) == NULL)
#  729|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
#  730|-> 	for (line = lines; *line != NULL; line++)
#  731|   	{
#  732|   		if (fputs(*line, out_file) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1749]
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
postgresql-18beta1/src/bin/initdb/initdb.c:1034:29: acquire_resource: opened here
postgresql-18beta1/src/bin/initdb/initdb.c:1034:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: danger: ‘fopen(path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1034|   	if ((version_file = fopen(path, PG_BINARY_W)) == NULL)
# 1035|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
# 1036|-> 	if (fprintf(version_file, "%s\n", PG_MAJORVERSION) < 0 ||
# 1037|   		fclose(version_file))
# 1038|   		pg_fatal("could not write file \"%s\": %m", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1750]
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
postgresql-18beta1/src/bin/initdb/initdb.c:1034:29: acquire_memory: allocated here
postgresql-18beta1/src/bin/initdb/initdb.c:1034:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:1036:13: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1034|   	if ((version_file = fopen(path, PG_BINARY_W)) == NULL)
# 1035|   		pg_fatal("could not open file \"%s\" for writing: %m", path);
# 1036|-> 	if (fprintf(version_file, "%s\n", PG_MAJORVERSION) < 0 ||
# 1037|   		fclose(version_file))
# 1038|   		pg_fatal("could not write file \"%s\": %m", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1751]
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(pwfilename, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:1661:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:1689:35: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:1689:35: acquire_resource: opened here
postgresql-18beta1/src/bin/initdb/initdb.c:1691:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: danger: ‘fopen(pwfilename, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1692|   			pg_fatal("could not open file \"%s\" for reading: %m",
# 1693|   					 pwfilename);
# 1694|-> 		pwd1 = pg_get_line(pwf, NULL);
# 1695|   		if (!pwd1)
# 1696|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1752]
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(pwfilename, "r")’
postgresql-18beta1/src/bin/initdb/initdb.c:1661:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:1689:35: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:1689:35: acquire_memory: allocated here
postgresql-18beta1/src/bin/initdb/initdb.c:1691:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: branch_false: ...to here
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/bin/initdb/initdb.c:1694:24: danger: ‘fopen(pwfilename, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 1692|   			pg_fatal("could not open file \"%s\" for reading: %m",
# 1693|   					 pwfilename);
# 1694|-> 		pwd1 = pg_get_line(pwf, NULL);
# 1695|   		if (!pwd1)
# 1696|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1753]
postgresql-18beta1/src/bin/initdb/localtime.c:233:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/src/bin/initdb/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/src/bin/initdb/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  231|   		++name;
#  232|   
#  233|-> 	fid = pg_open_tzfile(name, canonname);
#  234|   	if (fid < 0)
#  235|   		return ENOENT;			/* pg_open_tzfile may not set errno */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1754]
postgresql-18beta1/src/bin/initdb/localtime.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/src/bin/initdb/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/src/bin/initdb/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  240|   		int			err = nread < 0 ? errno : EINVAL;
#  241|   
#  242|-> 		close(fid);
#  243|   		return err;
#  244|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1755]
postgresql-18beta1/src/bin/initdb/localtime.c:245:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/src/bin/initdb/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/src/bin/initdb/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  243|   		return err;
#  244|   	}
#  245|-> 	if (close(fid) < 0)
#  246|   		return errno;
#  247|   	for (stored = 4; stored <= 8; stored *= 2)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1756]
postgresql-18beta1/src/bin/pg_archivecleanup/pg_archivecleanup.c:104:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(archiveLocation)’
postgresql-18beta1/src/bin/pg_archivecleanup/pg_archivecleanup.c:99:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_archivecleanup/pg_archivecleanup.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_archivecleanup/pg_archivecleanup.c:100:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_archivecleanup/pg_archivecleanup.c:104:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_archivecleanup/pg_archivecleanup.c:104:35: danger: ‘opendir(archiveLocation)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  102|   				 archiveLocation);
#  103|   
#  104|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  105|   	{
#  106|   		char		WALFilePath[MAXPGPATH * 2]; /* the file path including

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1757]
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1021:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘state.file’
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1699:1: enter_function: entry to ‘ReceiveBackupManifest’
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1705:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1706:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1709:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1709:9: call_function: calling ‘ReceiveCopyData’ from ‘ReceiveBackupManifest’
# 1019|   
# 1020|   	/* Get the COPY data stream. */
# 1021|-> 	res = PQgetResult(conn);
# 1022|   	if (PQresultStatus(res) != PGRES_COPY_OUT)
# 1023|   		pg_fatal("could not get COPY data stream: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1758]
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1021:15: warning[-Wanalyzer-malloc-leak]: leak of ‘state.file’
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1699:1: enter_function: entry to ‘ReceiveBackupManifest’
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1705:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1706:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1709:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_basebackup/pg_basebackup.c:1709:9: call_function: calling ‘ReceiveCopyData’ from ‘ReceiveBackupManifest’
# 1019|   
# 1020|   	/* Get the COPY data stream. */
# 1021|-> 	res = PQgetResult(conn);
# 1022|   	if (PQresultStatus(res) != PGRES_COPY_OUT)
# 1023|   		pg_fatal("could not get COPY data stream: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1759]
postgresql-18beta1/src/bin/pg_basebackup/pg_receivewal.c:278:37: warning[-Wanalyzer-malloc-leak]: leak of ‘get_destination_dir(basedir)’
postgresql-18beta1/src/bin/pg_basebackup/pg_receivewal.c:268:1: enter_function: entry to ‘FindStreamingStart’
postgresql-18beta1/src/bin/pg_basebackup/pg_receivewal.c:276:15: call_function: calling ‘get_destination_dir’ from ‘FindStreamingStart’
postgresql-18beta1/src/bin/pg_basebackup/pg_receivewal.c:276:15: return_function: returning to ‘FindStreamingStart’ from ‘get_destination_dir’
postgresql-18beta1/src/bin/pg_basebackup/pg_receivewal.c:278:37: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_basebackup/pg_receivewal.c:278:37: danger: ‘get_destination_dir(basedir)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  276|   	dir = get_destination_dir(basedir);
#  277|   
#  278|-> 	while (errno = 0, (dirent = readdir(dir)) != NULL)
#  279|   	{
#  280|   		uint32		tli;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1760]
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:133:17: warning[-Wanalyzer-jump-through-null]: jump through null pointer
 branch_false: following ‘false’ branch (when ‘copy_method > 3’)...
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:112:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:112:12: branch_false: following ‘false’ branch (when ‘dry_run == 0’)...
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:123:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:123:20: branch_false: following ‘false’ branch (when ‘strategy_name’ is NULL)...
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:126:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_combinebackup/copy_file.c:133:17: danger: jump through null pointer here
#  131|   						 src, dst, pg_checksum_type_name(checksum_ctx->type));
#  132|   
#  133|-> 		strategy_implementation(src, dst, checksum_ctx);
#  134|   	}
#  135|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1761]
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:944:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&ifulldir)’
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:942:20: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:942:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:942:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:944:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:944:33: danger: ‘opendir(&ifulldir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  942|   	if ((dir = opendir(ifulldir)) == NULL)
#  943|   		pg_fatal("could not open directory \"%s\": %m", ifulldir);
#  944|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
#  945|   	{
#  946|   		PGFileType	type;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1762]
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:1268:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pg_tblspc)’
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:1265:20: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:1265:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:1265:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:1268:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_combinebackup/pg_combinebackup.c:1268:33: danger: ‘opendir(&pg_tblspc)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1266|   		pg_fatal("could not open directory \"%s\": %m", pg_tblspc);
# 1267|   
# 1268|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
# 1269|   	{
# 1270|   		Oid			oid;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1763]
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:209:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:1965:1: enter_function: entry to ‘do_advice’
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:1967:9: call_function: calling ‘write_stderr’ from ‘do_advice’
#  207|   #ifndef WIN32
#  208|   	/* On Unix, we just fprintf to stderr */
#  209|-> 	vfprintf(stderr, fmt, ap);
#  210|   #else
#  211|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1764]
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2133:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2137:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2138:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2140:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2144:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2153:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2165:14: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:27: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:13: danger: ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 2164|   
# 2165|   	fd = popen(cmd, "r");
# 2166|-> 	if (fd == NULL || fgets(filename, sizeof(filename), fd) == NULL || pclose(fd) != 0)
# 2167|   	{
# 2168|   		write_stderr(_("%s: could not determine the data directory using command \"%s\"\n"), progname, cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1765]
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:76: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2133:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2137:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2138:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2140:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2144:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2153:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2165:14: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_ctl/pg_ctl.c:2166:76: danger: ‘popen(psprintf("\"%s\" -C data_directory %s%s", my_exec_path,  <unknown>,  <unknown>), "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 2164|   
# 2165|   	fd = popen(cmd, "r");
# 2166|-> 	if (fd == NULL || fgets(filename, sizeof(filename), fd) == NULL || pclose(fd) != 0)
# 2167|   	{
# 2168|   		write_stderr(_("%s: could not determine the data directory using command \"%s\"\n"), progname, cmd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1766]
postgresql-18beta1/src/bin/pg_dump/compress_gzip.c:361:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(fd)’
postgresql-18beta1/src/bin/pg_dump/compress_gzip.c:360:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_gzip.c:361:24: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_gzip.c:361:24: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_gzip.c:361:24: danger: ‘dup(fd)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  359|   
#  360|   	if (fd >= 0)
#  361|-> 		gzfp = gzdopen(dup(fd), mode_compression);
#  362|   	else
#  363|   		gzfp = gzopen(path, mode_compression);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1767]
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:730:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:717:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:718:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:718:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:721:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:727:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:730:1: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  728|   
#  729|   	return true;
#  730|-> }
#  731|   
#  732|   static bool

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1768]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  481|   		return false;
#  482|   
#  483|-> 	zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
#  484|   	CFH->private_data = zstdcs;
#  485|   	zstdcs->fp = fp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1769]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:476:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  481|   		return false;
#  482|   
#  483|-> 	zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
#  484|   	CFH->private_data = zstdcs;
#  485|   	zstdcs->fp = fp;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1770]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  487|   	if (mode[0] == 'r')
#  488|   	{
#  489|-> 		zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
#  490|   		zstdcs->dstream = ZSTD_createDStream();
#  491|   		if (zstdcs->dstream == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1771]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  487|   	if (mode[0] == 'r')
#  488|   	{
#  489|-> 		zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
#  490|   		zstdcs->dstream = ZSTD_createDStream();
#  491|   		if (zstdcs->dstream == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1772]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  494|   	else if (mode[0] == 'w' || mode[0] == 'a')
#  495|   	{
#  496|-> 		zstdcs->output.size = ZSTD_CStreamOutSize();
#  497|   		zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
#  498|   		zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1773]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  494|   	else if (mode[0] == 'w' || mode[0] == 'a')
#  495|   	{
#  496|-> 		zstdcs->output.size = ZSTD_CStreamOutSize();
#  497|   		zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
#  498|   		zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1774]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  501|   	}
#  502|   	else
#  503|-> 		pg_fatal("unhandled mode \"%s\"", mode);
#  504|   
#  505|   	return true;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1775]
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  501|   	}
#  502|   	else
#  503|-> 		pg_fatal("unhandled mode \"%s\"", mode);
#  504|   
#  505|   	return true;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1776]
postgresql-18beta1/src/bin/pg_dump/filter.c:160:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_dump/filter.c:159:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_dump/filter.c:160:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/filter.c:160:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  158|   
#  159|   	va_start(argp, fmt);
#  160|-> 	vsnprintf(buf, sizeof(buf), fmt, argp);
#  161|   	va_end(argp);
#  162|   

Error: CPPCHECK_WARNING (CWE-476): [#def1777]
postgresql-18beta1/src/bin/pg_dump/parallel.c:516: warning[nullPointer]: Possible null pointer dereference: slot
#  514|   		/* On all platforms, update workerStatus and te[] as well */
#  515|   		Assert(j < pstate->numWorkers);
#  516|-> 		slot->workerStatus = WRKR_TERMINATED;
#  517|   		pstate->te[j] = NULL;
#  518|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1778]
postgresql-18beta1/src/bin/pg_dump/parallel.c:516:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘slot’
postgresql-18beta1/src/bin/pg_dump/parallel.c:1071:1: enter_function: entry to ‘ParallelBackupEnd’
postgresql-18beta1/src/bin/pg_dump/parallel.c:1076:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:1076:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:1083:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:1085:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:1083:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:1090:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:1090:9: call_function: calling ‘WaitForTerminatingWorkers’ from ‘ParallelBackupEnd’
#  514|   		/* On all platforms, update workerStatus and te[] as well */
#  515|   		Assert(j < pstate->numWorkers);
#  516|-> 		slot->workerStatus = WRKR_TERMINATED;
#  517|   		pstate->te[j] = NULL;
#  518|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1779]
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipeMW[0]’
postgresql-18beta1/src/bin/pg_dump/parallel.c:909:1: enter_function: entry to ‘ParallelBackupStart’
postgresql-18beta1/src/bin/pg_dump/parallel.c:922:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:927:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:951:9: call_function: calling ‘set_archive_cancel_info’ from ‘ParallelBackupStart’
postgresql-18beta1/src/bin/pg_dump/parallel.c:951:9: return_function: returning to ‘ParallelBackupStart’ from ‘set_archive_cancel_info’
postgresql-18beta1/src/bin/pg_dump/parallel.c:957:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:965:40: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:970:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:970:43: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:970:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: danger: ‘pipeMW[0]’ leaks here
#  969|   		/* Create communication pipes for this worker */
#  970|   		if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0)
#  971|-> 			pg_fatal("could not create communication channels: %m");
#  972|   
#  973|   		/* leader's ends of the pipes */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1780]
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipeMW[1]’
postgresql-18beta1/src/bin/pg_dump/parallel.c:909:1: enter_function: entry to ‘ParallelBackupStart’
postgresql-18beta1/src/bin/pg_dump/parallel.c:922:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:927:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:951:9: call_function: calling ‘set_archive_cancel_info’ from ‘ParallelBackupStart’
postgresql-18beta1/src/bin/pg_dump/parallel.c:951:9: return_function: returning to ‘ParallelBackupStart’ from ‘set_archive_cancel_info’
postgresql-18beta1/src/bin/pg_dump/parallel.c:957:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:965:40: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:970:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:970:43: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:970:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/parallel.c:971:25: danger: ‘pipeMW[1]’ leaks here
#  969|   		/* Create communication pipes for this worker */
#  970|   		if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0)
#  971|-> 			pg_fatal("could not create communication channels: %m");
#  972|   
#  973|   		/* leader's ends of the pipes */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1781]
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:1760:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:4269:1: enter_function: entry to ‘dumpTimestamp’
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:4273:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:4274:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:4274:17: call_function: calling ‘ahprintf’ from ‘dumpTimestamp’
# 1758|   		errno = save_errno;
# 1759|   		va_start(args, fmt);
# 1760|-> 		cnt = pvsnprintf(p, len, fmt, args);
# 1761|   		va_end(args);
# 1762|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1782]
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:1921:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:3520:1: enter_function: entry to ‘_selectOutputSchema’
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:3551:25: call_function: calling ‘warn_or_exit_horribly’ from ‘_selectOutputSchema’
# 1919|   
# 1920|   	va_start(ap, fmt);
# 1921|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, fmt, ap);
# 1922|   	va_end(ap);
# 1923|   

Error: CPPCHECK_WARNING (CWE-476): [#def1783]
postgresql-18beta1/src/bin/pg_dump/pg_backup_archiver.c:2290: warning[nullPointer]: Possible null pointer dereference: fh
# 2288|   	}
# 2289|   
# 2290|-> 	if ((cnt = fread(sig, 1, 5, fh)) != 5)
# 2291|   	{
# 2292|   		if (ferror(fh))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1784]
postgresql-18beta1/src/bin/pg_dump/pg_backup_tar.c:971:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_dump/pg_backup_tar.c:970:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_dump/pg_backup_tar.c:971:23: throw: if ‘pvsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_backup_tar.c:971:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  969|   		errno = save_errno;
#  970|   		va_start(args, fmt);
#  971|-> 		cnt = pvsnprintf(p, len, fmt, args);
#  972|   		va_end(args);
#  973|   

Error: CPPCHECK_WARNING (CWE-457): [#def1785]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:1574: error[legacyUninitvar]: Uninitialized variable: archiveFormat
# 1572|   	else
# 1573|   		pg_fatal("invalid output format \"%s\" specified", format);
# 1574|-> 	return archiveFormat;
# 1575|   }
# 1576|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1786]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:5688:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18133:1: enter_function: entry to ‘dumpConstraint’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18143:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18146:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18162:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18166:21: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18166:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18167:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18167:25: call_function: calling ‘binary_upgrade_set_pg_class_oids’ from ‘dumpConstraint’
# 5686|   						 "\n-- For binary upgrade, must preserve pg_class oids and relfilenodes\n");
# 5687|   
# 5688|-> 	if (entry->relkind != RELKIND_INDEX &&
# 5689|   		entry->relkind != RELKIND_PARTITIONED_INDEX)
# 5690|   	{

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1787]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13255:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘probin’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13136:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13139:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13144:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13214:43: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13219:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13229:30: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13251:12: branch_false: following ‘false’ branch (when ‘prosqlbody’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13255:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:13255:18: danger: dereference of NULL ‘probin’
#13253|   		appendPQExpBufferStr(asPart, prosqlbody);
#13254|   	}
#13255|-> 	else if (probin[0] != '\0')
#13256|   	{
#13257|   		appendPQExpBufferStr(asPart, "AS ");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1788]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14732:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘collcollate’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14653:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14656:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14716:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14721:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14721:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14730:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14730:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14732:21: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14732:21: danger: dereference of NULL ‘collcollate’
#14730|   	if (fout->remoteVersion < 150000)
#14731|   	{
#14732|-> 		if (collcollate[0] == '\0')
#14733|   			collcollate = NULL;
#14734|   		if (collctype[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1789]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14734:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘collctype’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14653:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14656:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14716:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14717:31: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14721:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14730:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14730:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14732:21: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14732:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14732:20: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:14734:21: danger: dereference of NULL ‘collctype’
#14732|   		if (collcollate[0] == '\0')
#14733|   			collcollate = NULL;
#14734|-> 		if (collctype[0] == '\0')
#14735|   			collctype = NULL;
#14736|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1790]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18610:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘seq’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18563:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18569:27: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18610:25: danger: dereference of NULL ‘seq’
#18608|   
#18609|   	/* Calculate default limits for a sequence of this type */
#18610|-> 	is_ascending = (seq->incby >= 0);
#18611|   	if (seq->seqtype == SEQTYPE_SMALLINT)
#18612|   	{

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1791]
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18846:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18813:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18842:27: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dump.c:18846:17: danger: dereference of NULL ‘<unknown>’
#18844|   						sizeof(SequenceItem), SequenceItemCmp);
#18845|   
#18846|-> 		last = entry->last_value;
#18847|   		called = entry->is_called;
#18848|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1792]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 1665|   	}
# 1666|   
# 1667|-> 	for (i = 0; i < PQntuples(res); i++)
# 1668|   	{
# 1669|   		char	   *dbname = PQgetvalue(res, i, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1793]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 1665|   	}
# 1666|   
# 1667|-> 	for (i = 0; i < PQntuples(res); i++)
# 1668|   	{
# 1669|   		char	   *dbname = PQgetvalue(res, i, 0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1794]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 1667|   	for (i = 0; i < PQntuples(res); i++)
# 1668|   	{
# 1669|-> 		char	   *dbname = PQgetvalue(res, i, 0);
# 1670|   		char	   *oid = PQgetvalue(res, i, 1);
# 1671|   		const char *create_opts = "";

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1795]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 1667|   	for (i = 0; i < PQntuples(res); i++)
# 1668|   	{
# 1669|-> 		char	   *dbname = PQgetvalue(res, i, 0);
# 1670|   		char	   *oid = PQgetvalue(res, i, 1);
# 1671|   		const char *create_opts = "";

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1796]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 1668|   	{
# 1669|   		char	   *dbname = PQgetvalue(res, i, 0);
# 1670|-> 		char	   *oid = PQgetvalue(res, i, 1);
# 1671|   		const char *create_opts = "";
# 1672|   		int			ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1797]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 1668|   	{
# 1669|   		char	   *dbname = PQgetvalue(res, i, 0);
# 1670|-> 		char	   *oid = PQgetvalue(res, i, 1);
# 1671|   		const char *create_opts = "";
# 1672|   		int			ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1798]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: throw: if ‘simple_string_list_member’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 1677|   
# 1678|   		/* Skip any explicitly excluded database */
# 1679|-> 		if (simple_string_list_member(&database_exclude_names, dbname))
# 1680|   		{
# 1681|   			pg_log_info("excluding database \"%s\"", dbname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1799]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: throw: if ‘simple_string_list_member’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 1677|   
# 1678|   		/* Skip any explicitly excluded database */
# 1679|-> 		if (simple_string_list_member(&database_exclude_names, dbname))
# 1680|   		{
# 1681|   			pg_log_info("excluding database \"%s\"", dbname);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1800]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 1679|   		if (simple_string_list_member(&database_exclude_names, dbname))
# 1680|   		{
# 1681|-> 			pg_log_info("excluding database \"%s\"", dbname);
# 1682|   			continue;
# 1683|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1801]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 1679|   		if (simple_string_list_member(&database_exclude_names, dbname))
# 1680|   		{
# 1681|-> 			pg_log_info("excluding database \"%s\"", dbname);
# 1682|   			continue;
# 1683|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1802]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: following ‘true’ branch (when ‘archDumpFormat == 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 1690|   		{
# 1691|   			if (archDumpFormat == archCustom)
# 1692|-> 				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693|   			else if (archDumpFormat == archTar)
# 1694|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1803]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: following ‘true’ branch (when ‘archDumpFormat == 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1690|   		{
# 1691|   			if (archDumpFormat == archCustom)
# 1692|-> 				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693|   			else if (archDumpFormat == archTar)
# 1694|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1804]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_true: following ‘true’ branch (when ‘archDumpFormat == 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 1692|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693|   			else if (archDumpFormat == archTar)
# 1694|-> 				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695|   			else
# 1696|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1805]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_true: following ‘true’ branch (when ‘archDumpFormat == 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 1692|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693|   			else if (archDumpFormat == archTar)
# 1694|-> 				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695|   			else
# 1696|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1806]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: following ‘false’ branch (when ‘archDumpFormat != 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 1694|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695|   			else
# 1696|-> 				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);
# 1697|   
# 1698|   			/* Put one line entry for dboid and dbname in map file. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1807]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: following ‘false’ branch (when ‘archDumpFormat != 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 1694|   				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695|   			else
# 1696|-> 				snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);
# 1697|   
# 1698|   			/* Put one line entry for dboid and dbname in map file. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1808]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 1697|   
# 1698|   			/* Put one line entry for dboid and dbname in map file. */
# 1699|-> 			fprintf(map_file, "%s %s\n", oid, dbname);
# 1700|   		}
# 1701|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1809]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 1697|   
# 1698|   			/* Put one line entry for dboid and dbname in map file. */
# 1699|-> 			fprintf(map_file, "%s %s\n", oid, dbname);
# 1700|   		}
# 1701|   

Error: CPPCHECK_WARNING (CWE-457): [#def1810]
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1977: error[legacyUninitvar]: Uninitialized variable: archDumpFormat
# 1975|   				 format);
# 1976|   
# 1977|-> 	return archDumpFormat;
# 1978|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1811]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:869:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  867|   	StringInfoData q;
#  868|   
#  869|-> 	initStringInfo(&q);
#  870|   
#  871|   	resetStringInfo(inBuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1812]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:869:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  867|   	StringInfoData q;
#  868|   
#  869|-> 	initStringInfo(&q);
#  870|   
#  871|   	resetStringInfo(inBuf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1813]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:871:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  869|   	initStringInfo(&q);
#  870|   
#  871|-> 	resetStringInfo(inBuf);
#  872|   
#  873|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1814]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:871:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  869|   	initStringInfo(&q);
#  870|   
#  871|-> 	resetStringInfo(inBuf);
#  872|   
#  873|   	/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1815]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:876:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  874|   	 * Read characters until EOF or the appropriate delimiter is seen.
#  875|   	 */
#  876|-> 	while ((c = fgetc(pfile)) != EOF)
#  877|   	{
#  878|   		if (c != '\'' && c != '"' && c != '\n' && c != ';')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1816]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:876:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  874|   	 * Read characters until EOF or the appropriate delimiter is seen.
#  875|   	 */
#  876|-> 	while ((c = fgetc(pfile)) != EOF)
#  877|   	{
#  878|   		if (c != '\'' && c != '"' && c != '\n' && c != ';')

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1817]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:878:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  876|   	while ((c = fgetc(pfile)) != EOF)
#  877|   	{
#  878|-> 		if (c != '\'' && c != '"' && c != '\n' && c != ';')
#  879|   		{
#  880|   			appendStringInfoChar(inBuf, (char) c);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1818]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:878:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
#  876|   	while ((c = fgetc(pfile)) != EOF)
#  877|   	{
#  878|-> 		if (c != '\'' && c != '"' && c != '\n' && c != ';')
#  879|   		{
#  880|   			appendStringInfoChar(inBuf, (char) c);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1819]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: danger: ‘fopen(&map_file_path, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
# 1061|   		pg_fatal("could not open \"%s\": %m", map_file_path);
# 1062|   
# 1063|-> 	initStringInfo(&linebuf);
# 1064|   
# 1065|   	/* Append all the dbname/db_oid combinations to the list. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1820]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: danger: ‘fopen(&map_file_path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
# 1061|   		pg_fatal("could not open \"%s\": %m", map_file_path);
# 1062|   
# 1063|-> 	initStringInfo(&linebuf);
# 1064|   
# 1065|   	/* Append all the dbname/db_oid combinations to the list. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1821]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: danger: ‘fopen(&map_file_path, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
# 1064|   
# 1065|   	/* Append all the dbname/db_oid combinations to the list. */
# 1066|-> 	while (pg_get_line_buf(pfile, &linebuf))
# 1067|   	{
# 1068|   		Oid			db_oid = InvalidOid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1822]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: danger: ‘fopen(&map_file_path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/8)
# 1064|   
# 1065|   	/* Append all the dbname/db_oid combinations to the list. */
# 1066|-> 	while (pg_get_line_buf(pfile, &linebuf))
# 1067|   	{
# 1068|   		Oid			db_oid = InvalidOid;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1823]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
# 1328|   
# 1329|   	/* Init sqlstatement to append commands. */
# 1330|-> 	initStringInfo(&sqlstatement);
# 1331|   
# 1332|   	/* creation statement for our current role */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1824]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
# 1328|   
# 1329|   	/* Init sqlstatement to append commands. */
# 1330|-> 	initStringInfo(&sqlstatement);
# 1331|   
# 1332|   	/* creation statement for our current role */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1825]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
# 1331|   
# 1332|   	/* creation statement for our current role */
# 1333|-> 	initStringInfo(&user_create);
# 1334|   	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1826]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/0)
# 1331|   
# 1332|   	/* creation statement for our current role */
# 1333|-> 	initStringInfo(&user_create);
# 1334|   	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1827]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
# 1332|   	/* creation statement for our current role */
# 1333|   	initStringInfo(&user_create);
# 1334|-> 	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|   	appendStringInfoString(&user_create, PQuser(conn));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1828]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/0)
# 1332|   	/* creation statement for our current role */
# 1333|   	initStringInfo(&user_create);
# 1334|-> 	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|   	appendStringInfoString(&user_create, PQuser(conn));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1829]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
# 1334|   	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|-> 	appendStringInfoString(&user_create, PQuser(conn));
# 1337|   	appendStringInfoChar(&user_create, ';');
# 1338|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1830]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/0)
# 1334|   	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|-> 	appendStringInfoString(&user_create, PQuser(conn));
# 1337|   	appendStringInfoChar(&user_create, ';');
# 1338|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1831]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: throw: if ‘PQuser’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
# 1334|   	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|-> 	appendStringInfoString(&user_create, PQuser(conn));
# 1337|   	appendStringInfoChar(&user_create, ';');
# 1338|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1832]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: throw: if ‘PQuser’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
# 1334|   	appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|-> 	appendStringInfoString(&user_create, PQuser(conn));
# 1337|   	appendStringInfoChar(&user_create, ';');
# 1338|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1833]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: throw: if ‘appendStringInfoChar’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|   	appendStringInfoString(&user_create, PQuser(conn));
# 1337|-> 	appendStringInfoChar(&user_create, ';');
# 1338|   
# 1339|   	/* Process file till EOF and execute sql statements. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1834]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: throw: if ‘appendStringInfoChar’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
# 1335|   	/* should use fmtId here, but we don't know the encoding */
# 1336|   	appendStringInfoString(&user_create, PQuser(conn));
# 1337|-> 	appendStringInfoChar(&user_create, ';');
# 1338|   
# 1339|   	/* Process file till EOF and execute sql statements. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1835]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1388|   	{
# 1389|   		snprintf(out_file_path, MAXPGPATH, "%s", outfile);
# 1390|-> 		OPF = fopen(out_file_path, PG_BINARY_W);
# 1391|   
# 1392|   		if (OPF == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1836]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1388|   	{
# 1389|   		snprintf(out_file_path, MAXPGPATH, "%s", outfile);
# 1390|-> 		OPF = fopen(out_file_path, PG_BINARY_W);
# 1391|   
# 1392|   		if (OPF == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1837]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1398|   
# 1399|   	/* Append global.dat into output file or print to stdout. */
# 1400|-> 	while ((c = fgetc(pfile)) != EOF)
# 1401|   		fputc(c, OPF);
# 1402|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1838]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1398|   
# 1399|   	/* Append global.dat into output file or print to stdout. */
# 1400|-> 	while ((c = fgetc(pfile)) != EOF)
# 1401|   		fputc(c, OPF);
# 1402|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1839]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: danger: ‘OPF’ leaks here; was opened at [(3)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/2)
# 1398|   
# 1399|   	/* Append global.dat into output file or print to stdout. */
# 1400|-> 	while ((c = fgetc(pfile)) != EOF)
# 1401|   		fputc(c, OPF);
# 1402|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1840]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: warning[-Wanalyzer-malloc-leak]: leak of ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: danger: ‘OPF’ leaks here; was allocated at [(3)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/2)
# 1398|   
# 1399|   	/* Append global.dat into output file or print to stdout. */
# 1400|-> 	while ((c = fgetc(pfile)) != EOF)
# 1401|   		fputc(c, OPF);
# 1402|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1841]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1406:12: branch_false: following ‘false’ branch (when the strings are equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: danger: ‘OPF’ leaks here; was opened at [(3)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/2)
# 1406|   	if (strcmp(outfile, "-") != 0)
# 1407|   		fclose(OPF);
# 1408|-> }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1842]
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: warning[-Wanalyzer-malloc-leak]: leak of ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1406:12: branch_false: following ‘false’ branch (when the strings are equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: danger: ‘OPF’ leaks here; was allocated at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
# 1406|   	if (strcmp(outfile, "-") != 0)
# 1407|   		fclose(OPF);
# 1408|-> }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1843]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:553:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:553:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:553:22: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  551|   	if (!fgets(rawline, sizeof(rawline), ver_fd))
#  552|   	{
#  553|-> 		if (!ferror(ver_fd))
#  554|   			pg_fatal("unexpected empty file \"%s\"", ver_file);
#  555|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1844]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:553:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:553:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:553:22: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  551|   	if (!fgets(rawline, sizeof(rawline), ver_fd))
#  552|   	{
#  553|-> 		if (!ferror(ver_fd))
#  554|   			pg_fatal("unexpected empty file \"%s\"", ver_file);
#  555|   		else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1845]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  558|   
#  559|   	/* strip trailing newline and carriage return */
#  560|-> 	(void) pg_strip_crlf(rawline);
#  561|   
#  562|   	if (strcmp(rawline, PG_MAJORVERSION) != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1846]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  558|   
#  559|   	/* strip trailing newline and carriage return */
#  560|-> 	(void) pg_strip_crlf(rawline);
#  561|   
#  562|   	if (strcmp(rawline, PG_MAJORVERSION) != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1847]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:562:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:562:12: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  560|   	(void) pg_strip_crlf(rawline);
#  561|   
#  562|-> 	if (strcmp(rawline, PG_MAJORVERSION) != 0)
#  563|   	{
#  564|   		pg_log_error("data directory is of wrong version");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1848]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:562:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("PG_VERSION", "r")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:560:16: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:562:12: danger: ‘fopen("PG_VERSION", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  560|   	(void) pg_strip_crlf(rawline);
#  561|   
#  562|-> 	if (strcmp(rawline, PG_MAJORVERSION) != 0)
#  563|   	{
#  564|   		pg_log_error("data directory is of wrong version");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1849]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:954:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:950:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:951:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:951:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:954:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:954:35: danger: ‘opendir("pg_wal")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  952|   		pg_fatal("could not open directory \"%s\": %m", XLOGDIR);
#  953|   
#  954|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  955|   	{
#  956|   		if (IsXLogFileName(xlde->d_name) ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1850]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1007:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1003:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1004:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1004:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1007:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1007:35: danger: ‘opendir("pg_wal")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1005|   		pg_fatal("could not open directory \"%s\": %m", XLOGDIR);
# 1006|   
# 1007|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
# 1008|   	{
# 1009|   		if (IsXLogFileName(xlde->d_name) ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1851]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1042:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal/archive_status")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1038:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1039:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1039:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1042:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1042:35: danger: ‘opendir("pg_wal/archive_status")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1040|   		pg_fatal("could not open directory \"%s\": %m", ARCHSTATDIR);
# 1041|   
# 1042|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
# 1043|   	{
# 1044|   		if (strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_FNAME_LEN &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1852]
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1080:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("pg_wal/summaries")’
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1076:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1077:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1077:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1080:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_resetwal/pg_resetwal.c:1080:35: danger: ‘opendir("pg_wal/summaries")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1078|   		pg_fatal("could not open directory \"%s\": %m", WALSUMMARYDIR);
# 1079|   
# 1080|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
# 1081|   	{
# 1082|   		if (strspn(xlde->d_name, "0123456789ABCDEF") == WALSUMMARY_NHEXCHARS &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1853]
postgresql-18beta1/src/bin/pg_rewind/file_ops.c:391:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&fullparentpath)’
postgresql-18beta1/src/bin/pg_rewind/file_ops.c:386:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_rewind/file_ops.c:387:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_rewind/file_ops.c:387:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_rewind/file_ops.c:391:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_rewind/file_ops.c:391:35: danger: ‘opendir(&fullparentpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  389|   				 fullparentpath);
#  390|   
#  391|-> 	while (errno = 0, (xlde = readdir(xldir)) != NULL)
#  392|   	{
#  393|   		struct stat fst;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1854]
postgresql-18beta1/src/bin/pg_rewind/xlogreader.c:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_rewind/xlogreader.c:78:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_rewind/xlogreader.c:79:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_rewind/xlogreader.c:79:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   77|   
#   78|   	va_start(args, fmt);
#   79|-> 	vsnprintf(state->errormsg_buf, MAX_ERRORMSG_LEN, fmt, args);
#   80|   	va_end(args);
#   81|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def1855]
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: danger: infinite loop here
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: branch_true: if it ever follows ‘true’ branch, it will always do so...
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: branch_true: ...to here
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:318:42: branch_false: when ‘writes >= writes_per_op’: always following ‘false’ branch...
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:316:57: branch_false: ...to here
#  314|   	{
#  315|   		START_TIMER;
#  316|-> 		for (ops = 0; alarm_triggered == false; ops++)
#  317|   		{
#  318|   			for (writes = 0; writes < writes_per_op; writes++)

Error: GCC_ANALYZER_WARNING (CWE-835): [#def1856]
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: danger: infinite loop here
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: branch_true: if it ever follows ‘true’ branch, it will always do so...
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: branch_true: ...to here
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:421:42: branch_false: when ‘writes >= writes_per_op’: always following ‘false’ branch...
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:419:57: branch_false: ...to here
#  417|   	{
#  418|   		START_TIMER;
#  419|-> 		for (ops = 0; alarm_triggered == false; ops++)
#  420|   		{
#  421|   			for (writes = 0; writes < writes_per_op; writes++)

Error: GCC_ANALYZER_WARNING (CWE-835): [#def1857]
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: danger: infinite loop here
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: branch_true: if it ever follows ‘true’ branch, it will always do so...
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: branch_true: ...to here
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:486:42: branch_false: if it ever follows ‘false’ branch, it will always do so...
postgresql-18beta1/src/bin/pg_test_fsync/pg_test_fsync.c:484:57: branch_false: ...to here
#  482|   	{
#  483|   		START_TIMER;
#  484|-> 		for (ops = 0; alarm_triggered == false; ops++)
#  485|   		{
#  486|   			for (writes = 0; writes < 16 / writes_size; writes++)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1858]
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&output_path, "a")’
postgresql-18beta1/src/bin/pg_upgrade/check.c:401:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:406:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:429:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:429:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: danger: ‘fopen(&output_path, "a")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  430|   		pg_fatal("could not open file \"%s\": %m", output_path);
#  431|   
#  432|-> 	fprintf(script, "In database: %s\n", dbinfo->db_name);
#  433|   
#  434|   	for (int rowno = 0; rowno < ntups; rowno++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1859]
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&output_path, "a")’
postgresql-18beta1/src/bin/pg_upgrade/check.c:401:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:406:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:429:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:429:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:432:9: danger: ‘fopen(&output_path, "a")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  430|   		pg_fatal("could not open file \"%s\": %m", output_path);
#  431|   
#  432|-> 	fprintf(script, "In database: %s\n", dbinfo->db_name);
#  433|   
#  434|   	for (int rowno = 0; rowno < ntups; rowno++)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1860]
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*deletion_script_file_name, "w")’
postgresql-18beta1/src/bin/pg_upgrade/check.c:989:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:989:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1028:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1028:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: danger: ‘fopen(*deletion_script_file_name, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1032|   #ifndef WIN32
# 1033|   	/* add shebang header */
# 1034|-> 	fprintf(script, "#!/bin/sh\n\n");
# 1035|   #endif
# 1036|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1861]
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*deletion_script_file_name, "w")’
postgresql-18beta1/src/bin/pg_upgrade/check.c:989:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:989:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1028:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1028:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1034:9: danger: ‘fopen(*deletion_script_file_name, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1032|   #ifndef WIN32
# 1033|   	/* add shebang header */
# 1034|-> 	fprintf(script, "#!/bin/sh\n\n");
# 1035|   #endif
# 1036|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1862]
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:1157:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1159:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 1180|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1181|   
# 1182|-> 				fprintf(script, "%s\n", datname);
# 1183|   			}
# 1184|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1863]
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:1157:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1159:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1179:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1182:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 1180|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 1181|   
# 1182|-> 				fprintf(script, "%s\n", datname);
# 1183|   			}
# 1184|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1864]
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:1657:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:20: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:20: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:49: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:49: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 1659|   		if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1660|   			pg_fatal("could not open file \"%s\": %m", output_path);
# 1661|-> 		fprintf(script, "%s (oid=%s)\n",
# 1662|   				PQgetvalue(res, rowno, i_rolname),
# 1663|   				PQgetvalue(res, rowno, i_roloid));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1865]
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:1657:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:20: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:20: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:49: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:49: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1659:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:1661:17: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 1659|   		if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1660|   			pg_fatal("could not open file \"%s\": %m", output_path);
# 1661|-> 		fprintf(script, "%s (oid=%s)\n",
# 1662|   				PQgetvalue(res, rowno, i_rolname),
# 1663|   				PQgetvalue(res, rowno, i_roloid));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1866]
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:2079:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2081:49: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2088:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2090:36: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2090:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2091:51: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2091:51: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2090:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: danger: ‘script’ leaks here; was opened at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 2092|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 2093|   
# 2094|-> 				fprintf(script, "The slot \"%s\" is invalid\n",
# 2095|   						slot->slotname);
# 2096|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1867]
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:2079:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2081:49: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2088:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2090:36: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2090:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2091:51: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2091:51: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2090:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2094:33: danger: ‘script’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
# 2092|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 2093|   
# 2094|-> 				fprintf(script, "The slot \"%s\" is invalid\n",
# 2095|   						slot->slotname);
# 2096|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1868]
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:2079:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2081:49: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2088:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2107:30: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2107:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2109:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2110:51: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2110:51: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2109:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
# 2111|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 2112|   
# 2113|-> 				fprintf(script,
# 2114|   						"The slot \"%s\" has not consumed the WAL yet\n",
# 2115|   						slot->slotname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1869]
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/check.c:2079:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2081:49: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2088:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2107:30: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2107:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2109:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2110:51: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2110:51: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2109:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2113:33: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
# 2111|   					pg_fatal("could not open file \"%s\": %m", output_path);
# 2112|   
# 2113|-> 				fprintf(script,
# 2114|   						"The slot \"%s\" has not consumed the WAL yet\n",
# 2115|   						slot->slotname);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1870]
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘report.file’
postgresql-18beta1/src/bin/pg_upgrade/check.c:2206:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2208:21: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2208:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2209:40: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2209:40: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2208:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: danger: ‘report.file’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 2209|   			(report.file = fopen_priv(report.path, "w")) == NULL)
# 2210|   			pg_fatal("could not open file \"%s\": %m", report.path);
# 2211|-> 		fprintf(report.file, "The replication origin is missing for database:\"%s\" subscription:\"%s\"\n",
# 2212|   				PQgetvalue(res, i, 0),
# 2213|   				PQgetvalue(res, i, 1));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1871]
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: warning[-Wanalyzer-malloc-leak]: leak of ‘report.file’
postgresql-18beta1/src/bin/pg_upgrade/check.c:2206:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2208:21: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2208:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2209:40: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2209:40: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2208:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/check.c:2211:17: danger: ‘report.file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 2209|   			(report.file = fopen_priv(report.path, "w")) == NULL)
# 2210|   			pg_fatal("could not open file \"%s\": %m", report.path);
# 2211|-> 		fprintf(report.file, "The replication origin is missing for database:\"%s\" subscription:\"%s\"\n",
# 2212|   				PQgetvalue(res, i, 0),
# 2213|   				PQgetvalue(res, i, 1));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1872]
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:36: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:107:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:31: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:136:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:34: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:140:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:36: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  140|   				p = strchr(p, ':');
#  141|   
#  142|-> 				if (p == NULL || strlen(p) <= 1)
#  143|   					pg_fatal("%d: database cluster state problem", __LINE__);
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1873]
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:37: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:107:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:31: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:136:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:34: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:140:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:36: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:50: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:37: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
#  140|   				p = strchr(p, ':');
#  141|   
#  142|-> 				if (p == NULL || strlen(p) <= 1)
#  143|   					pg_fatal("%d: database cluster state problem", __LINE__);
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1874]
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:156:40: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:107:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:31: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:136:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:34: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:140:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:156:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:156:40: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/18)
#  154|   				 */
#  155|   				/* Remove trailing newline and leading spaces */
#  156|-> 				(void) pg_strip_crlf(p);
#  157|   				while (*p == ' ')
#  158|   					p++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1875]
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:157:40: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:107:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:31: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:136:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:34: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:138:28: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:140:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:142:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:157:40: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:159:37: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:157:40: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/18)
#  155|   				/* Remove trailing newline and leading spaces */
#  156|   				(void) pg_strip_crlf(p);
#  157|-> 				while (*p == ' ')
#  158|   					p++;
#  159|   				if (strcmp(p, "shut down in recovery") == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1876]
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:177:22: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:107:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:31: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:132:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:136:24: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:177:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:177:22: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/18)
#  175|   		}
#  176|   
#  177|-> 		rc = pclose(output);
#  178|   		if (rc != 0)
#  179|   			pg_fatal("could not get control data using %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1877]
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:206:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:88:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:92:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:94:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:96:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:100:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:102:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:104:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:107:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:125:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:125:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:125:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:192:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:196:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:196:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:202:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:202:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:206:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:206:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:206:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:213:16: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:528:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/controldata.c:206:13: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(25)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/24)
#  204|   
#  205|   	/* Only in <= 9.2 */
#  206|-> 	if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
#  207|   	{
#  208|   		cluster->controldata.data_checksum_version = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1878]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:46:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:13: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   43|   	fflush(NULL);
#   44|   
#   45|-> 	if ((output = popen(cmd, "r")) == NULL ||
#   46|   		fgets(cmd_output, sizeof(cmd_output), output) == NULL)
#   47|   		pg_fatal("could not get pg_ctl version data using %s: %m", cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1879]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:49:14: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:46:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:45:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:49:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:49:14: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   47|   		pg_fatal("could not get pg_ctl version data using %s: %m", cmd);
#   48|   
#   49|-> 	rc = pclose(output);
#   50|   	if (rc != 0)
#   51|   		pg_fatal("could not get pg_ctl version data using %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1880]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:109:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:108:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:109:20: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:109:20: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  107|   	written = 0;
#  108|   	va_start(ap, fmt);
#  109|-> 	written += vsnprintf(cmd + written, MAXCMDLEN - written, fmt, ap);
#  110|   	va_end(ap);
#  111|   	if (written >= MAXCMDLEN)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1881]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&log_file, "a")’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:138:15: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: danger: ‘fopen(&log_file, "a")’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  165|   		fprintf(log, "\n\n");
#  166|   #endif
#  167|-> 	fprintf(log, "command: %s\n", cmd);
#  168|   #ifdef WIN32
#  169|   	/* Are we printing "command:" after its output? */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1882]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&log_file, "a")’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:138:15: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: danger: ‘fopen(&log_file, "a")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  165|   		fprintf(log, "\n\n");
#  166|   #endif
#  167|-> 	fprintf(log, "command: %s\n", cmd);
#  168|   #ifdef WIN32
#  169|   	/* Are we printing "command:" after its output? */

Error: CPPCHECK_WARNING (CWE-476): [#def1883]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:178: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: log
#  176|   	 * open while the command is running, or we get a share violation.
#  177|   	 */
#  178|-> 	fclose(log);
#  179|   
#  180|   #ifdef WIN32

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1884]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&log_file, "a")’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:189:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:217:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:217:20: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:217:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: danger: ‘fopen(&log_file, "a")’ leaks here; was opened at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  217|   	if ((log = fopen(log_file, "a")) == NULL)
#  218|   		pg_fatal("could not write to log file \"%s\": %m", log_file);
#  219|-> 	fprintf(log, "\n\n");
#  220|   	fclose(log);
#  221|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1885]
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&log_file, "a")’
postgresql-18beta1/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:189:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:217:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:217:20: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:217:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/exec.c:219:9: danger: ‘fopen(&log_file, "a")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  217|   	if ((log = fopen(log_file, "a")) == NULL)
#  218|   		pg_fatal("could not write to log file \"%s\": %m", log_file);
#  219|-> 	fprintf(log, "\n\n");
#  220|   	fclose(log);
#  221|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1886]
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/function.c:187:26: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/function.c:189:35: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:195:20: branch_true: following ‘true’ branch (when ‘libnum == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/function.c:197:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:203:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:36: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: throw: if ‘PQerrorMessage’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  207|   				if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
#  208|   					pg_fatal("could not open file \"%s\": %m", output_path);
#  209|-> 				fprintf(script, _("could not load library \"%s\": %s"),
#  210|   						lib,
#  211|   						PQerrorMessage(conn));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1887]
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/function.c:187:26: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/function.c:189:35: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:195:20: branch_true: following ‘true’ branch (when ‘libnum == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/function.c:197:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:203:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:36: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/function.c:207:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: throw: if ‘PQerrorMessage’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/function.c:209:33: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  207|   				if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
#  208|   					pg_fatal("could not open file \"%s\": %m", output_path);
#  209|-> 				fprintf(script, _("could not load library \"%s\": %s"),
#  210|   						lib,
#  211|   						PQerrorMessage(conn));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1888]
postgresql-18beta1/src/bin/pg_upgrade/info.c:216:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18beta1/src/bin/pg_upgrade/info.c:45:1: enter_function: entry to ‘gen_db_file_maps’
postgresql-18beta1/src/bin/pg_upgrade/info.c:65:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/info.c:68:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/info.c:68:39: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/info.c:70:53: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/info.c:74:20: branch_true: following ‘true’ branch (when ‘new_rel’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/info.c:80:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/info.c:80:25: call_function: calling ‘report_unmatched_relation’ from ‘gen_db_file_maps’
#  214|   report_unmatched_relation(const RelInfo *rel, const DbInfo *db, bool is_new_db)
#  215|   {
#  216|-> 	Oid			reloid = rel->reloid;	/* we might change rel below */
#  217|   	char		reldesc[1000];
#  218|   	int			i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1889]
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:13: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:444:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:446:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:450:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:458:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:473:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:13: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  470|   	fflush(NULL);
#  471|   
#  472|-> 	if ((output = popen(cmd, "r")) == NULL ||
#  473|   		fgets(cmd_output, sizeof(cmd_output), output) == NULL)
#  474|   		pg_fatal("could not get data directory using %s: %m", cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1890]
postgresql-18beta1/src/bin/pg_upgrade/option.c:476:14: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(&cmd, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:444:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:446:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:450:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:458:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:473:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:472:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:476:14: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:476:14: danger: ‘popen(&cmd, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  474|   		pg_fatal("could not get data directory using %s: %m", cmd);
#  475|   
#  476|-> 	rc = pclose(output);
#  477|   	if (rc != 0)
#  478|   		pg_fatal("could not get data directory using %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1891]
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:27: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: danger: ‘fopen(&filename, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  523|   			 lineno++)
#  524|   		{
#  525|-> 			if (fgets(line, sizeof(line), fp) == NULL)
#  526|   				pg_fatal("could not read line %d from file \"%s\": %m",
#  527|   						 lineno, filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1892]
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:27: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: danger: ‘fopen(&filename, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  523|   			 lineno++)
#  524|   		{
#  525|-> 			if (fgets(line, sizeof(line), fp) == NULL)
#  526|   				pg_fatal("could not read line %d from file \"%s\": %m",
#  527|   						 lineno, filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1893]
postgresql-18beta1/src/bin/pg_upgrade/option.c:535:52: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:27: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:523:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:535:52: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/option.c:535:52: danger: ‘fopen(&filename, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  533|   			{
#  534|   				/* strip trailing newline and carriage return */
#  535|-> 				cluster->sockdir = pg_strdup(line);
#  536|   				(void) pg_strip_crlf(cluster->sockdir);
#  537|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1894]
postgresql-18beta1/src/bin/pg_upgrade/option.c:535:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:27: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:523:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:535:52: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/option.c:535:52: danger: ‘fopen(&filename, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  533|   			{
#  534|   				/* strip trailing newline and carriage return */
#  535|-> 				cluster->sockdir = pg_strdup(line);
#  536|   				(void) pg_strip_crlf(cluster->sockdir);
#  537|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1895]
postgresql-18beta1/src/bin/pg_upgrade/option.c:536:40: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:27: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:523:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:536:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/option.c:536:40: danger: ‘fopen(&filename, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  534|   				/* strip trailing newline and carriage return */
#  535|   				cluster->sockdir = pg_strdup(line);
#  536|-> 				(void) pg_strip_crlf(cluster->sockdir);
#  537|   			}
#  538|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1896]
postgresql-18beta1/src/bin/pg_upgrade/option.c:536:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "r")’
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:27: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:532:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:523:26: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/option.c:536:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/option.c:536:40: danger: ‘fopen(&filename, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  534|   				/* strip trailing newline and carriage return */
#  535|   				cluster->sockdir = pg_strdup(line);
#  536|-> 				(void) pg_strip_crlf(cluster->sockdir);
#  537|   			}
#  538|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1897]
postgresql-18beta1/src/bin/pg_upgrade/parallel.c:76:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_upgrade/parallel.c:75:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_upgrade/parallel.c:76:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/parallel.c:76:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   74|   
#   75|   	va_start(args, fmt);
#   76|-> 	vsnprintf(cmd, sizeof(cmd), fmt, args);
#   77|   	va_end(args);
#   78|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1898]
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename_path, "a")’
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:266:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:270:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:279:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:283:37: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:286:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:290:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:293:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:300:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:304:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:304:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:306:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:306:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:309:15: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:311:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:314:34: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:314:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:314:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:318:39: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:320:23: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:322:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:324:27: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:324:27: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:324:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: danger: ‘fopen(&filename_path, "a")’ leaks here; was opened at [(23)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/22)
#  325|   			pg_fatal("could not write to log file \"%s\": %m", filename_path);
#  326|   
#  327|-> 		fprintf(fp,
#  328|   				"-----------------------------------------------------------------\n"
#  329|   				"  pg_upgrade run on %s"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1899]
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename_path, "a")’
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:266:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:270:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:279:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:283:37: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:286:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:290:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:293:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:300:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:304:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:304:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:306:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:306:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:309:15: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:311:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:314:34: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:314:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:314:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:318:39: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:320:23: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:322:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:324:27: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:324:27: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:324:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/pg_upgrade.c:327:17: danger: ‘fopen(&filename_path, "a")’ leaks here; was allocated at [(23)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/22)
#  325|   			pg_fatal("could not write to log file \"%s\": %m", filename_path);
#  326|   
#  327|-> 		fprintf(fp,
#  328|   				"-----------------------------------------------------------------\n"
#  329|   				"  pg_upgrade run on %s"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1900]
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:376:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(new_db_dir)’
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:373:15: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:374:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:374:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:376:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:376:33: danger: ‘opendir(new_db_dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  374|   	if (dir == NULL)
#  375|   		pg_fatal("could not open directory \"%s\": %m", new_db_dir);
#  376|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
#  377|   	{
#  378|   		snprintf(path, sizeof(path), "%s/%s", new_db_dir, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1901]
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:403:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(moved_db_dir)’
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:374:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:374:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:395:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:397:16: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:400:15: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:401:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:401:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:403:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/relfilenumber.c:403:33: danger: ‘opendir(moved_db_dir)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  401|   	if (dir == NULL)
#  402|   		pg_fatal("could not open directory \"%s\": %m", moved_db_dir);
#  403|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
#  404|   	{
#  405|   		snprintf(path, sizeof(path), "%s/%s", moved_db_dir, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1902]
postgresql-18beta1/src/bin/pg_upgrade/server.c:130:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_upgrade/server.c:129:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_upgrade/server.c:130:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/server.c:130:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  128|   
#  129|   	va_start(args, fmt);
#  130|-> 	vsnprintf(query, sizeof(query), fmt, args);
#  131|   	va_end(args);
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1903]
postgresql-18beta1/src/bin/pg_upgrade/util.c:135:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_upgrade/util.c:134:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_upgrade/util.c:135:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/util.c:135:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  133|   
#  134|   	va_start(args, fmt);
#  135|-> 	vsnprintf(message, sizeof(message), fmt, args);
#  136|   	va_end(args);
#  137|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1904]
postgresql-18beta1/src/bin/pg_upgrade/util.c:162:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_upgrade/util.c:161:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_upgrade/util.c:162:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/util.c:162:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  160|   
#  161|   	va_start(args, fmt);
#  162|-> 	vsnprintf(message, sizeof(message), fmt, args);
#  163|   	va_end(args);
#  164|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1905]
postgresql-18beta1/src/bin/pg_upgrade/util.c:184:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_upgrade/util.c:270:1: enter_function: entry to ‘pg_fatal’
postgresql-18beta1/src/bin/pg_upgrade/util.c:274:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_upgrade/util.c:275:9: call_function: calling ‘pg_log_v’ from ‘pg_fatal’
#  182|   	Assert(fmt[0] == '\0' || fmt[strlen(fmt) - 1] != '\n');
#  183|   
#  184|-> 	vsnprintf(message, sizeof(message), _(fmt), ap);
#  185|   
#  186|   	/* PG_VERBOSE and PG_STATUS are only output in verbose mode */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1906]
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   82|   					PQExpBufferData connectbuf;
#   83|   
#   84|-> 					initPQExpBuffer(&connectbuf);
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1907]
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#   82|   					PQExpBufferData connectbuf;
#   83|   
#   84|-> 					initPQExpBuffer(&connectbuf);
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1908]
postgresql-18beta1/src/bin/pg_upgrade/version.c:85:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:85:41: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:85:41: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#   83|   
#   84|   					initPQExpBuffer(&connectbuf);
#   85|-> 					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|   					termPQExpBuffer(&connectbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1909]
postgresql-18beta1/src/bin/pg_upgrade/version.c:85:41: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:85:41: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:85:41: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#   83|   
#   84|   					initPQExpBuffer(&connectbuf);
#   85|-> 					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|   					termPQExpBuffer(&connectbuf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1910]
postgresql-18beta1/src/bin/pg_upgrade/version.c:87:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:87:41: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:87:41: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|-> 					termPQExpBuffer(&connectbuf);
#   88|   					db_used = true;
#   89|   				}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1911]
postgresql-18beta1/src/bin/pg_upgrade/version.c:87:41: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:87:41: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:87:41: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#   85|   					appendPsqlMetaConnect(&connectbuf, active_db->db_name);
#   86|   					fputs(connectbuf.data, script);
#   87|-> 					termPQExpBuffer(&connectbuf);
#   88|   					db_used = true;
#   89|   				}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1912]
postgresql-18beta1/src/bin/pg_upgrade/version.c:90:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:90:33: throw: if ‘quote_identifier’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:90:33: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#   88|   					db_used = true;
#   89|   				}
#   90|-> 				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1913]
postgresql-18beta1/src/bin/pg_upgrade/version.c:90:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:90:33: throw: if ‘quote_identifier’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:90:33: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#   88|   					db_used = true;
#   89|   				}
#   90|-> 				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1914]
postgresql-18beta1/src/bin/pg_upgrade/version.c:91:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:91:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:91:66: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
#   89|   				}
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|-> 						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1915]
postgresql-18beta1/src/bin/pg_upgrade/version.c:91:66: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:91:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:91:66: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#   89|   				}
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|-> 						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|   						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1916]
postgresql-18beta1/src/bin/pg_upgrade/version.c:92:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:92:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:92:66: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|-> 						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}
#   94|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1917]
postgresql-18beta1/src/bin/pg_upgrade/version.c:92:66: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18beta1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:65: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18beta1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18beta1/src/bin/pg_upgrade/version.c:92:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_upgrade/version.c:92:66: danger: ‘script’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
#   90|   				fprintf(script, "REINDEX INDEX %s.%s;\n",
#   91|   						quote_identifier(PQgetvalue(res, rowno, i_nspname)),
#   92|-> 						quote_identifier(PQgetvalue(res, rowno, i_relname)));
#   93|   			}
#   94|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1918]
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:631:37: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:669:1: enter_function: entry to ‘verify_plain_backup_file’
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:675:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:691:13: branch_false: ...to here
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:691:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:693:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:693:17: call_function: calling ‘verify_plain_backup_directory’ from ‘verify_plain_backup_file’
#  629|   	}
#  630|   
#  631|-> 	while (errno = 0, (dirent = readdir(dir)) != NULL)
#  632|   	{
#  633|   		char	   *filename = dirent->d_name;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1919]
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1236:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1235:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1236:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1236:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1234|   
# 1235|   	va_start(ap, fmt);
# 1236|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, gettext(fmt), ap);
# 1237|   	va_end(ap);
# 1238|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1920]
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1253:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1252:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1253:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18beta1/src/bin/pg_verifybackup/pg_verifybackup.c:1253:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1251|   
# 1252|   	va_start(ap, fmt);
# 1253|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, gettext(fmt), ap);
# 1254|   	va_end(ap);
# 1255|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1921]
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:119:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(directory)’
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:115:35: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:117:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:119:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:119:9: danger: ‘opendir(directory)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  117|   	if (dir == NULL)
#  118|   		return false;
#  119|-> 	closedir(dir);
#  120|   	return true;
#  121|   }

Error: COMPILER_WARNING (CWE-704): [#def1922]
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c: scope_hint: In function ‘split_path’
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:166:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  166 |         sep = strrchr(path, '/');
#      |             ^
#  164|   
#  165|   	/* split filepath into directory & filename */
#  166|-> 	sep = strrchr(path, '/');
#  167|   
#  168|   	/* directory path */

Error: COMPILER_WARNING (CWE-704): [#def1923]
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:166:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  164|   
#  165|   	/* split filepath into directory & filename */
#  166|-> 	sep = strrchr(path, '/');
#  167|   
#  168|   	/* directory path */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1924]
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:228:32: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(directory)’
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:216:12: branch_false: following ‘false’ branch (when ‘fname’ is NULL)...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:224:27: branch_false: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:224:27: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:224:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:224:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:228:32: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:228:32: danger: ‘opendir(directory)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  226|   		struct dirent *xlde;
#  227|   
#  228|-> 		while ((xlde = readdir(xldir)) != NULL)
#  229|   		{
#  230|   			if (IsXLogFileName(xlde->d_name))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1925]
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:534:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "w")’
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:494:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:505:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:508:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:514:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:514:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:517:24: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:520:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:521:50: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:530:24: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:531:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:534:21: branch_false: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:534:20: danger: ‘fopen(&filename, "w")’ leaks here; was opened at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  532|   			pg_fatal("could not open file \"%s\": %m", filename);
#  533|   
#  534|-> 		if (fwrite(page, BLCKSZ, 1, file) != 1)
#  535|   			pg_fatal("could not write file \"%s\": %m", filename);
#  536|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1926]
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:534:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename, "w")’
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:494:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:505:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:508:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:514:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:514:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:517:24: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:520:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:521:50: branch_true: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:530:24: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:531:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:534:21: branch_false: ...to here
postgresql-18beta1/src/bin/pg_waldump/pg_waldump.c:534:20: danger: ‘fopen(&filename, "w")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  532|   			pg_fatal("could not open file \"%s\": %m", filename);
#  533|   
#  534|-> 		if (fwrite(page, BLCKSZ, 1, file) != 1)
#  535|   			pg_fatal("could not write file \"%s\": %m", filename);
#  536|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1927]
postgresql-18beta1/src/bin/pg_waldump/xlogreader.c:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_waldump/xlogreader.c:78:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_waldump/xlogreader.c:79:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_waldump/xlogreader.c:79:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   77|   
#   78|   	va_start(args, fmt);
#   79|-> 	vsnprintf(state->errormsg_buf, MAX_ERRORMSG_LEN, fmt, args);
#   80|   	va_end(args);
#   81|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1928]
postgresql-18beta1/src/bin/pg_walsummary/pg_walsummary.c:235:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/pg_walsummary/pg_walsummary.c:234:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/pg_walsummary/pg_walsummary.c:235:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18beta1/src/bin/pg_walsummary/pg_walsummary.c:235:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  233|   
#  234|   	va_start(ap, fmt);
#  235|-> 	pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, fmt, ap);
#  236|   	va_end(ap);
#  237|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1929]
postgresql-18beta1/src/bin/pgbench/exprparse.c:1117:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’
postgresql-18beta1/src/bin/pgbench/exprparse.c:1075:6: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1139:6: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1139:6: branch_false: following ‘false’ branch (when ‘yystate != 25’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1142:3: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1154:6: branch_false: following ‘false’ branch (when ‘yyn != -33’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1160:6: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1160:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1163:16: branch_true: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1172:11: branch_false: following ‘false’ branch (when ‘yychar != 256’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1184:17: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1191:6: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1194:6: branch_false: following ‘false’ branch (when ‘yyn > 0’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1204:6: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1204:6: branch_false: following ‘false’ branch (when ‘yyerrstatus == 0’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1211:3: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1075:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1081:28: branch_true: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1104:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1106:7: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1113:11: acquire_memory: allocated here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1115:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1117:9: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1120:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1120:12: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1133:10: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1139:6: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1139:6: branch_false: following ‘false’ branch (when ‘yystate != 25’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1142:3: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1154:6: branch_false: following ‘false’ branch (when ‘yyn != -33’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1160:6: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1160:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1163:16: branch_true: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1163:16: throw: if ‘expr_yylex’ throws an exception...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1117:9: danger: ‘yyptr’ leaks here; was allocated at [(21)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/20)
# 1115|           if (! yyptr)
# 1116|             YYNOMEM;
# 1117|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1118|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1119|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1930]
postgresql-18beta1/src/bin/pgbench/exprparse.c:1117:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/bin/pgbench/exprparse.c:1075:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1081:28: branch_true: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1104:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1106:7: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1115:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/src/bin/pgbench/exprparse.c:1117:9: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprparse.c:1117:9: danger: use of uninitialized value ‘yyss’ here
# 1115|           if (! yyptr)
# 1116|             YYNOMEM;
# 1117|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1118|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1119|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1931]
postgresql-18beta1/src/bin/pgbench/exprscan.c:1990:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/bin/pgbench/exprscan.l:319:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/src/bin/pgbench/exprscan.l:341:14: call_function: calling ‘expr_yylex’ from ‘expr_lex_one_word’
# 1988|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1989|   	 * we need to put in 2 end-of-buffer characters.
# 1990|-> 	 */
# 1991|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1992|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1932]
postgresql-18beta1/src/bin/pgbench/exprscan.c:2033:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/src/bin/pgbench/exprscan.l:319:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/src/bin/pgbench/exprscan.l:341:14: call_function: calling ‘expr_yylex’ from ‘expr_lex_one_word’
# 2031|   
# 2032|   	yy_flush_buffer( b , yyscanner);
# 2033|-> 
# 2034|   	b->yy_input_file = file;
# 2035|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1933]
postgresql-18beta1/src/bin/pgbench/exprscan.c:2153:3: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(8)’
postgresql-18beta1/src/bin/pgbench/exprscan.l:319:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/src/bin/pgbench/exprscan.l:332:19: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pgbench/exprscan.l:333:56: branch_true: ...to here
postgresql-18beta1/src/bin/pgbench/exprscan.l:333:10: call_function: calling ‘expr_yy_switch_to_buffer’ from ‘expr_lex_one_word’
# 2151|   		if ( ! yyg->yy_buffer_stack )
# 2152|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2153|-> 
# 2154|   		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
# 2155|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1934]
postgresql-18beta1/src/bin/pgbench/exprscan.c:2174:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/bin/pgbench/exprscan.l:319:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/src/bin/pgbench/exprscan.l:332:19: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pgbench/exprscan.l:333:56: branch_true: ...to here
postgresql-18beta1/src/bin/pgbench/exprscan.l:333:10: call_function: calling ‘expr_yy_switch_to_buffer’ from ‘expr_lex_one_word’
# 2172|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2173|   
# 2174|-> 		/* zero only the new slots.*/
# 2175|   		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
# 2176|   		yyg->yy_buffer_stack_max = num_to_alloc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1935]
postgresql-18beta1/src/bin/pgbench/exprscan.c:2199:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/bin/pgbench/exprscan.c:2185:17: enter_function: entry to ‘expr_yy_scan_buffer’
postgresql-18beta1/src/bin/pgbench/exprscan.c:2195:24: call_function: inlined call to ‘expr_yyalloc’ from ‘expr_yy_scan_buffer’
postgresql-18beta1/src/bin/pgbench/exprscan.c:2196:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pgbench/exprscan.c:2199:25: branch_false: ...to here
postgresql-18beta1/src/bin/pgbench/exprscan.c:2209:2: call_function: calling ‘expr_yy_switch_to_buffer’ from ‘expr_yy_scan_buffer’
# 2197|   	if ( ! b )
# 2198|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 2199|-> 
# 2200|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 2201|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1936]
postgresql-18beta1/src/bin/pgbench/exprscan.c:2302:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(*(struct yyguts_t *)yyscanner.yytext_r)’
postgresql-18beta1/src/bin/pgbench/exprscan.l:319:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18beta1/src/bin/pgbench/exprscan.l:341:14: call_function: calling ‘expr_yylex’ from ‘expr_lex_one_word’
# 2300|   YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
# 2301|   {
# 2302|->     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
# 2303|       return yyextra;
# 2304|   }

Error: CPPCHECK_WARNING (CWE-457): [#def1937]
postgresql-18beta1/src/bin/pgbench/pgbench.c:1649: warning[uninitvar]: Uninitialized variables: &key.svalue, &key.value
# 1647|   	/* Now we can search */
# 1648|   	key.name = name;
# 1649|-> 	return (Variable *) bsearch(&key,
# 1650|   								variables->vars,
# 1651|   								variables->nvars,

Error: COMPILER_WARNING (CWE-704): [#def1938]
postgresql-18beta1/src/bin/pgbench/pgbench.c: scope_hint: In function ‘parseScriptWeight’
postgresql-18beta1/src/bin/pgbench/pgbench.c:6196:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 6196 |         if ((sep = strrchr(option, WSEP)))
#      |                  ^
# 6194|   	int			weight;
# 6195|   
# 6196|-> 	if ((sep = strrchr(option, WSEP)))
# 6197|   	{
# 6198|   		int			namelen = sep - option;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1939]
postgresql-18beta1/src/bin/psql/command.c:3228:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/src/bin/psql/command.c:3175:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/src/bin/psql/command.c:3177:37: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3182:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3196:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3197:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3206:41: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3207:46: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:3209:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3227:42: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3227:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:3228:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3228:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:3228:33: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 3226|   			 */
# 3227|   			if (query_buf && query_buf->len > 0)
# 3228|-> 				fprintf(fd, "%s\n", query_buf->data);
# 3229|   			else if (previous_buf && previous_buf->len > 0)
# 3230|   				fprintf(fd, "%s\n", previous_buf->data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1940]
postgresql-18beta1/src/bin/psql/command.c:3228:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/src/bin/psql/command.c:3175:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/src/bin/psql/command.c:3177:37: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3182:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3196:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3197:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3206:41: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3207:46: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:3209:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3227:42: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3227:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:3228:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3228:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:3228:33: danger: ‘fd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
# 3226|   			 */
# 3227|   			if (query_buf && query_buf->len > 0)
# 3228|-> 				fprintf(fd, "%s\n", query_buf->data);
# 3229|   			else if (previous_buf && previous_buf->len > 0)
# 3230|   				fprintf(fd, "%s\n", previous_buf->data);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1941]
postgresql-18beta1/src/bin/psql/command.c:3230:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/src/bin/psql/command.c:3175:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/src/bin/psql/command.c:3177:37: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3182:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3196:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3197:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3206:41: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3207:46: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:3209:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3227:42: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3227:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3229:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3229:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:3230:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:3230:33: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 3228|   				fprintf(fd, "%s\n", query_buf->data);
# 3229|   			else if (previous_buf && previous_buf->len > 0)
# 3230|-> 				fprintf(fd, "%s\n", previous_buf->data);
# 3231|   
# 3232|   			if (is_pipe)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1942]
postgresql-18beta1/src/bin/psql/command.c:3230:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/src/bin/psql/command.c:3175:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/src/bin/psql/command.c:3177:37: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3182:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3196:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3197:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3206:41: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3207:46: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:3209:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3227:42: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3227:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3229:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3229:33: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:3230:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:3230:33: danger: ‘fd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 3228|   				fprintf(fd, "%s\n", query_buf->data);
# 3229|   			else if (previous_buf && previous_buf->len > 0)
# 3230|-> 				fprintf(fd, "%s\n", previous_buf->data);
# 3231|   
# 3232|   			if (is_pipe)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1943]
postgresql-18beta1/src/bin/psql/command.c:3234:42: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/src/bin/psql/command.c:3175:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18beta1/src/bin/psql/command.c:3177:37: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3182:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3189:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3196:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3197:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:3200:41: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3202:46: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:3209:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:3227:42: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3227:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:3229:33: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:3232:28: branch_true: following ‘true’ branch (when ‘is_pipe != 0’)...
postgresql-18beta1/src/bin/psql/command.c:3234:42: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:3234:42: throw: if ‘pclose’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:3234:42: danger: ‘fd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 3232|   			if (is_pipe)
# 3233|   			{
# 3234|-> 				result = pclose(fd);
# 3235|   
# 3236|   				if (result != 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1944]
postgresql-18beta1/src/bin/psql/command.c:4688:33: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
postgresql-18beta1/src/bin/psql/command.c:4634:12: branch_false: following ‘false’ branch (when ‘filename_arg’ is NULL)...
postgresql-18beta1/src/bin/psql/command.c:4640:38: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4673:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4674:34: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4674:34: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4676:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4683:43: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4686:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4688:33: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4688:33: danger: ‘stream’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 4686|   			if (ql > 0 && query_buf->data[ql - 1] != '\n')
# 4687|   			{
# 4688|-> 				appendPQExpBufferChar(query_buf, '\n');
# 4689|   				ql++;
# 4690|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1945]
postgresql-18beta1/src/bin/psql/command.c:4694:33: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
postgresql-18beta1/src/bin/psql/command.c:4634:12: branch_false: following ‘false’ branch (when ‘filename_arg’ is NULL)...
postgresql-18beta1/src/bin/psql/command.c:4640:38: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4673:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4674:34: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4674:34: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4676:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4683:43: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4692:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4694:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4694:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4694:33: danger: ‘stream’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 4692|   			if (fwrite(query_buf->data, 1, ql, stream) != ql)
# 4693|   			{
# 4694|-> 				pg_log_error("%s: %m", fname);
# 4695|   
# 4696|   				if (fclose(stream) != 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1946]
postgresql-18beta1/src/bin/psql/command.c:4764:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4764:25: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4764:25: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 4762|   			char		line[1024];
# 4763|   
# 4764|-> 			resetPQExpBuffer(query_buf);
# 4765|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4766|   				appendPQExpBufferStr(query_buf, line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1947]
postgresql-18beta1/src/bin/psql/command.c:4764:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4764:25: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4764:25: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 4762|   			char		line[1024];
# 4763|   
# 4764|-> 			resetPQExpBuffer(query_buf);
# 4765|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4766|   				appendPQExpBufferStr(query_buf, line);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1948]
postgresql-18beta1/src/bin/psql/command.c:4766:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4765:32: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4766:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4766:33: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4766:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 4764|   			resetPQExpBuffer(query_buf);
# 4765|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4766|-> 				appendPQExpBufferStr(query_buf, line);
# 4767|   
# 4768|   			if (ferror(stream))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1949]
postgresql-18beta1/src/bin/psql/command.c:4766:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4765:32: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4766:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4766:33: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4766:33: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 4764|   			resetPQExpBuffer(query_buf);
# 4765|   			while (fgets(line, sizeof(line), stream) != NULL)
# 4766|-> 				appendPQExpBufferStr(query_buf, line);
# 4767|   
# 4768|   			if (ferror(stream))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1950]
postgresql-18beta1/src/bin/psql/command.c:4770:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4768:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4770:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4770:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4770:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 4768|   			if (ferror(stream))
# 4769|   			{
# 4770|-> 				pg_log_error("%s: %m", fname);
# 4771|   				error = true;
# 4772|   				resetPQExpBuffer(query_buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1951]
postgresql-18beta1/src/bin/psql/command.c:4770:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4768:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4770:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4770:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4770:33: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 4768|   			if (ferror(stream))
# 4769|   			{
# 4770|-> 				pg_log_error("%s: %m", fname);
# 4771|   				error = true;
# 4772|   				resetPQExpBuffer(query_buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1952]
postgresql-18beta1/src/bin/psql/command.c:4772:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4768:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4770:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4772:33: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4772:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 4770|   				pg_log_error("%s: %m", fname);
# 4771|   				error = true;
# 4772|-> 				resetPQExpBuffer(query_buf);
# 4773|   			}
# 4774|   			else if (edited)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1953]
postgresql-18beta1/src/bin/psql/command.c:4772:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
postgresql-18beta1/src/bin/psql/command.c:4732:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4740:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4742:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4753:26: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4754:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4764:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4768:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:4770:33: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4772:33: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4772:33: danger: ‘fopen(fname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 4770|   				pg_log_error("%s: %m", fname);
# 4771|   				error = true;
# 4772|-> 				resetPQExpBuffer(query_buf);
# 4773|   			}
# 4774|   			else if (edited)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1954]
postgresql-18beta1/src/bin/psql/command.c:4868:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/src/bin/psql/command.c:4825:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:4830:18: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4830:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/psql/command.c:4832:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4851:22: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:4853:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4865:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4868:9: throw: if ‘pg_logging_config’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4868:9: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 4866|   	pset.inputfile = filename;
# 4867|   
# 4868|-> 	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4869|   
# 4870|   	result = MainLoop(fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1955]
postgresql-18beta1/src/bin/psql/command.c:4868:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/src/bin/psql/command.c:4825:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:4830:18: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4830:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/psql/command.c:4832:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4851:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4853:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4865:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4868:9: throw: if ‘pg_logging_config’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4868:9: danger: ‘fd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
# 4866|   	pset.inputfile = filename;
# 4867|   
# 4868|-> 	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4869|   
# 4870|   	result = MainLoop(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1956]
postgresql-18beta1/src/bin/psql/command.c:4870:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18beta1/src/bin/psql/command.c:4825:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:4830:18: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4830:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/psql/command.c:4832:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4851:22: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/command.c:4853:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4865:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4870:18: throw: if ‘MainLoop’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4870:18: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
# 4868|   	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4869|   
# 4870|-> 	result = MainLoop(fd);
# 4871|   
# 4872|   	if (fd != stdin)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1957]
postgresql-18beta1/src/bin/psql/command.c:4870:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
postgresql-18beta1/src/bin/psql/command.c:4825:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:4830:18: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4830:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/psql/command.c:4832:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:4851:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:4853:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:4865:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:4870:18: throw: if ‘MainLoop’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:4870:18: danger: ‘fd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
# 4868|   	pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4869|   
# 4870|-> 	result = MainLoop(fd);
# 4871|   
# 4872|   	if (fd != stdin)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1958]
postgresql-18beta1/src/bin/psql/command.c:5876:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/src/bin/psql/command.c:5790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5840:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5840:26: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5840:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5843:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:42: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5846:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5848:29: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:5850:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5874:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5876:17: throw: if ‘pg_malloc’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:5876:17: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/14)
# 5874|   	user_title = myopt.title;
# 5875|   	title_len = (user_title ? strlen(user_title) : 0) + 256;
# 5876|-> 	title = pg_malloc(title_len);
# 5877|   
# 5878|   	/* Loop to run query and then sleep awhile */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1959]
postgresql-18beta1/src/bin/psql/command.c:5893:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/src/bin/psql/command.c:5790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5840:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5840:26: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5840:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5843:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:42: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5846:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5848:29: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:5850:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5874:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5879:16: branch_false: following ‘false’ branch (when ‘done == 0’)...
postgresql-18beta1/src/bin/psql/command.c:5889:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5892:20: branch_true: following ‘true’ branch (when ‘user_title’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5893:25: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5893:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:5893:25: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/14)
# 5891|   
# 5892|   		if (user_title)
# 5893|-> 			snprintf(title, title_len, _("%s\t%s (every %gs)\n"),
# 5894|   					 user_title, timebuf, sleep_ms / 1000.0);
# 5895|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1960]
postgresql-18beta1/src/bin/psql/command.c:5896:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/src/bin/psql/command.c:5790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5840:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5840:26: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5840:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5843:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:42: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5846:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5848:29: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:5850:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5874:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5879:16: branch_false: following ‘false’ branch (when ‘done == 0’)...
postgresql-18beta1/src/bin/psql/command.c:5889:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5892:20: branch_false: following ‘false’ branch (when ‘user_title’ is NULL)...
postgresql-18beta1/src/bin/psql/command.c:5896:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5896:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:5896:25: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/14)
# 5894|   					 user_title, timebuf, sleep_ms / 1000.0);
# 5895|   		else
# 5896|-> 			snprintf(title, title_len, _("%s (every %gs)\n"),
# 5897|   					 timebuf, sleep_ms / 1000.0);
# 5898|   		myopt.title = title;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1961]
postgresql-18beta1/src/bin/psql/command.c:5901:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/src/bin/psql/command.c:5790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5840:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5840:26: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5840:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5843:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:42: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5846:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5848:29: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:5850:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5874:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5879:16: branch_false: following ‘false’ branch (when ‘done == 0’)...
postgresql-18beta1/src/bin/psql/command.c:5889:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5892:20: branch_true: following ‘true’ branch (when ‘user_title’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5893:25: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5901:23: throw: if ‘PSQLexecWatch’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:5901:23: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/14)
# 5899|   
# 5900|   		/* Run the query and print out the result */
# 5901|-> 		res = PSQLexecWatch(query_buf->data, &myopt, pagerpipe, min_rows);
# 5902|   
# 5903|   		/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1962]
postgresql-18beta1/src/bin/psql/command.c:5979:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pagerpipe’
postgresql-18beta1/src/bin/psql/command.c:5790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5840:12: branch_true: following ‘true’ branch (when ‘pagerprog’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5840:26: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5840:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5843:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5844:42: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5843:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/command.c:5846:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5848:29: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/command.c:5850:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/command.c:5874:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/command.c:5879:16: branch_true: following ‘true’ branch (when ‘done != 0’)...
postgresql-18beta1/src/bin/psql/command.c:5977:12: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5977:12: branch_true: following ‘true’ branch (when ‘pagerpipe’ is non-NULL)...
postgresql-18beta1/src/bin/psql/command.c:5979:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/command.c:5979:17: throw: if ‘pclose’ throws an exception...
postgresql-18beta1/src/bin/psql/command.c:5979:17: danger: ‘pagerpipe’ leaks here; was allocated at [(15)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/14)
# 5977|   	if (pagerpipe)
# 5978|   	{
# 5979|-> 		pclose(pagerpipe);
# 5980|   		restore_sigpipe_trap();
# 5981|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1963]
postgresql-18beta1/src/bin/psql/common.c:98:33: warning[-Wanalyzer-malloc-leak]: leak of ‘gfile_fout’
postgresql-18beta1/src/bin/psql/common.c:1556:1: enter_function: entry to ‘ExecQueryAndProcessResults’
postgresql-18beta1/src/bin/psql/common.c:1700:12: branch_true: following ‘true’ branch (when ‘success != 0’)...
postgresql-18beta1/src/bin/psql/common.c:1714:13: branch_true: ...to here
postgresql-18beta1/src/bin/psql/common.c:1769:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/common.c:1776:22: branch_true: ...to here
postgresql-18beta1/src/bin/psql/common.c:1776:22: call_function: calling ‘AcceptResult’ from ‘ExecQueryAndProcessResults’
postgresql-18beta1/src/bin/psql/common.c:1776:22: return_function: returning to ‘ExecQueryAndProcessResults’ from ‘AcceptResult’
postgresql-18beta1/src/bin/psql/common.c:1776:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/common.c:1845:25: branch_true: ...to here
postgresql-18beta1/src/bin/psql/common.c:1865:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/common.c:1911:20: branch_false: ...to here
postgresql-18beta1/src/bin/psql/common.c:1911:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/common.c:1913:51: branch_true: ...to here
postgresql-18beta1/src/bin/psql/common.c:1925:36: call_function: calling ‘SetupGOutput’ from ‘ExecQueryAndProcessResults’
#   96|   		{
#   97|   			if (*is_pipe)
#   98|-> 				disable_sigpipe_trap();
#   99|   		}
#  100|   		else

Error: CPPCHECK_WARNING (CWE-457): [#def1964]
postgresql-18beta1/src/bin/psql/crosstabview.c:363: error[uninitvar]: Uninitialized variables: &elt.sort_value, &elt.rank
#  361|   		else
#  362|   			elt.name = NULL;
#  363|-> 		rp = (pivot_field *) bsearch(&elt,
#  364|   									 piv_rows,
#  365|   									 num_rows,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1965]
postgresql-18beta1/src/bin/psql/crosstabview.c:369:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/bin/psql/crosstabview.c:350:22: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/crosstabview.c:359:22: branch_true: ...to here
postgresql-18beta1/src/bin/psql/crosstabview.c:369:17: danger: dereference of NULL ‘<unknown>’
#  367|   									 pivotFieldCompare);
#  368|   		Assert(rp != NULL);
#  369|-> 		row_number = rp->rank;
#  370|   
#  371|   		/* Find target column */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1966]
postgresql-18beta1/src/bin/psql/input.c:520:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘output’
postgresql-18beta1/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:511:26: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:520:9: throw: if ‘history_set_pos’ throws an exception...
postgresql-18beta1/src/bin/psql/input.c:520:9: danger: ‘output’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  518|   	}
#  519|   
#  520|-> 	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|   		fprintf(output, "%s\n", cur_hist->line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1967]
postgresql-18beta1/src/bin/psql/input.c:520:9: warning[-Wanalyzer-malloc-leak]: leak of ‘output’
postgresql-18beta1/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:511:26: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:520:9: throw: if ‘history_set_pos’ throws an exception...
postgresql-18beta1/src/bin/psql/input.c:520:9: danger: ‘output’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  518|   	}
#  519|   
#  520|-> 	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|   		fprintf(output, "%s\n", cur_hist->line);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1968]
postgresql-18beta1/src/bin/psql/input.c:522:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘output’
postgresql-18beta1/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:511:26: acquire_resource: opened here
postgresql-18beta1/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:520:9: branch_true: following ‘true’ branch (when ‘cur_hist’ is non-NULL)...
postgresql-18beta1/src/bin/psql/input.c:522:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/input.c:522:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/input.c:522:17: danger: ‘output’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  520|   	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|-> 		fprintf(output, "%s\n", cur_hist->line);
#  523|   	}
#  524|   	END_ITERATE_HISTORY();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1969]
postgresql-18beta1/src/bin/psql/input.c:522:17: warning[-Wanalyzer-malloc-leak]: leak of ‘output’
postgresql-18beta1/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18beta1/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18beta1/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:511:26: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18beta1/src/bin/psql/input.c:520:9: branch_true: following ‘true’ branch (when ‘cur_hist’ is non-NULL)...
postgresql-18beta1/src/bin/psql/input.c:522:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/input.c:522:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/input.c:522:17: danger: ‘output’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  520|   	BEGIN_ITERATE_HISTORY(cur_hist);
#  521|   	{
#  522|-> 		fprintf(output, "%s\n", cur_hist->line);
#  523|   	}
#  524|   	END_ITERATE_HISTORY();

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1970]
postgresql-18beta1/src/bin/psql/large_obj.c:29:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/psql/large_obj.c:23:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/large_obj.c:25:21: branch_false: ...to here
postgresql-18beta1/src/bin/psql/large_obj.c:28:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/psql/large_obj.c:29:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/large_obj.c:29:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   27|   
#   28|   		va_start(ap, fmt);
#   29|-> 		vfprintf(pset.queryFout, fmt, ap);
#   30|   		va_end(ap);
#   31|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1971]
postgresql-18beta1/src/bin/psql/large_obj.c:41:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/bin/psql/large_obj.c:38:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/large_obj.c:40:17: branch_true: ...to here
postgresql-18beta1/src/bin/psql/large_obj.c:40:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/bin/psql/large_obj.c:41:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18beta1/src/bin/psql/large_obj.c:41:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   39|   	{
#   40|   		va_start(ap, fmt);
#   41|-> 		vfprintf(pset.logfile, fmt, ap);
#   42|   		va_end(ap);
#   43|   		fputs("\n", pset.logfile);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1972]
postgresql-18beta1/src/bin/psql/prompt.c:297:57: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(pnstrdup(p + 1, (long unsigned int)cmdend), "r")’
postgresql-18beta1/src/bin/psql/prompt.c:101:18: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/prompt.c:105:20: branch_false: following ‘false’ branch (when ‘esc == 0’)...
postgresql-18beta1/src/bin/psql/prompt.c:344:26: branch_false: ...to here
postgresql-18beta1/src/bin/psql/prompt.c:101:18: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/prompt.c:292:54: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/prompt.c:293:52: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/prompt.c:295:61: branch_true: ...to here
postgresql-18beta1/src/bin/psql/prompt.c:295:60: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/prompt.c:297:57: branch_false: ...to here
postgresql-18beta1/src/bin/psql/prompt.c:297:57: danger: ‘popen(pnstrdup(p + 1, (long unsigned int)cmdend), "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  295|   							if (fgets(buf, sizeof(buf), fd) == NULL)
#  296|   								buf[0] = '\0';
#  297|-> 							pclose(fd);
#  298|   						}
#  299|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1973]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:1474:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:540:8: enter_function: entry to ‘psql_scan_slash_option’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:570:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_option’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:570:10: return_function: returning to ‘psql_scan_slash_option’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:581:14: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_option’
# 1472|   
# 1473|   		if ( ! YY_CURRENT_BUFFER ) {
# 1474|-> 			yyensure_buffer_stack (yyscanner);
# 1475|   			YY_CURRENT_BUFFER_LVALUE =
# 1476|   				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1974]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2473:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:679:1: enter_function: entry to ‘psql_scan_slash_command_end’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:689:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command_end’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:689:10: return_function: returning to ‘psql_scan_slash_command_end’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:697:2: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_command_end’
# 2471|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2472|   	 * we need to put in 2 end-of-buffer characters.
# 2473|-> 	 */
# 2474|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2475|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1975]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2473:54: warning[-Wanalyzer-malloc-leak]: leak of ‘slash_yy_create_buffer(*(struct yyguts_t *)yyscanner.yyin_r, 16384,  yyscanner)’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:540:8: enter_function: entry to ‘psql_scan_slash_option’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:570:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_option’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:570:10: return_function: returning to ‘psql_scan_slash_option’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:581:14: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_option’
# 2471|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2472|   	 * we need to put in 2 end-of-buffer characters.
# 2473|-> 	 */
# 2474|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 2475|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1976]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2516:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:679:1: enter_function: entry to ‘psql_scan_slash_command_end’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:689:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command_end’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:689:10: return_function: returning to ‘psql_scan_slash_command_end’ from ‘slash_yy_switch_to_buffer’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:697:2: call_function: calling ‘slash_yylex’ from ‘psql_scan_slash_command_end’
# 2514|   
# 2515|   	yy_flush_buffer( b , yyscanner);
# 2516|-> 
# 2517|   	b->yy_input_file = file;
# 2518|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1977]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2636:3: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(8)’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:481:1: enter_function: entry to ‘psql_scan_slash_command’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:495:19: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:496:10: branch_true: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:496:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command’
# 2634|   		if ( ! yyg->yy_buffer_stack )
# 2635|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2636|-> 
# 2637|   		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
# 2638|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1978]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2657:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:481:1: enter_function: entry to ‘psql_scan_slash_command’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:495:19: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:496:10: branch_true: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:496:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command’
# 2655|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 2656|   
# 2657|-> 		/* zero only the new slots.*/
# 2658|   		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
# 2659|   		yyg->yy_buffer_stack_max = num_to_alloc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1979]
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2682:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2668:17: enter_function: entry to ‘slash_yy_scan_buffer’
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2678:24: call_function: inlined call to ‘slash_yyalloc’ from ‘slash_yy_scan_buffer’
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2679:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2682:25: branch_false: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.c:2692:2: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘slash_yy_scan_buffer’
# 2680|   	if ( ! b )
# 2681|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 2682|-> 
# 2683|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 2684|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: CPPCHECK_WARNING (CWE-562): [#def1980]
postgresql-18beta1/src/bin/psql/psqlscanslash.l:492: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  490|   	/* Set current output target */
#  491|   	state->output_buf = &mybuf;
#  492|-> 
#  493|   	/* Set input source */
#  494|   	if (state->buffer_stack != NULL)

Error: CPPCHECK_WARNING (CWE-562): [#def1981]
postgresql-18beta1/src/bin/psql/psqlscanslash.l:566: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  564|   	/* Set current output target */
#  565|   	state->output_buf = &mybuf;
#  566|-> 
#  567|   	/* Set input source */
#  568|   	if (state->buffer_stack != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1982]
postgresql-18beta1/src/bin/psql/psqlscanslash.l:809:33: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:794:14: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:795:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:795:12: branch_false: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:809:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:809:33: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  807|   			{
#  808|   				pg_log_error("%s: %m", cmd);
#  809|-> 				error = true;
#  810|   				break;
#  811|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1983]
postgresql-18beta1/src/bin/psql/psqlscanslash.l:813:18: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:794:14: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:795:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:795:12: branch_false: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:807:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:813:18: branch_false: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:813:18: throw: if ‘appendBinaryPQExpBuffer’ throws an exception...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:813:18: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  811|   			}
#  812|   			appendBinaryPQExpBuffer(&cmd_output, buf, result);
#  813|-> 		} while (!feof(fd));
#  814|   	}
#  815|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1984]
postgresql-18beta1/src/bin/psql/psqlscanslash.l:824:29: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/src/bin/psql/psqlscanslash.l:794:14: acquire_memory: allocated here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:795:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:795:12: branch_false: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:817:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/psql/psqlscanslash.l:824:29: branch_true: ...to here
postgresql-18beta1/src/bin/psql/psqlscanslash.l:824:29: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  822|   		 */
#  823|   		exit_code = pclose(fd);
#  824|-> 		if (exit_code == -1)
#  825|   		{
#  826|   			pg_log_error("%s: %m", cmd);

Error: CPPCHECK_WARNING (CWE-457): [#def1985]
postgresql-18beta1/src/bin/psql/tab-complete.in.c:2555: warning[uninitvar]: Uninitialized variable: argarray
# 2553|   		COMPLETE_WITH("CONSTRAINT", "TO");
# 2554|   	/* ALTER DOMAIN <sth> RENAME CONSTRAINT <sth> */
# 2555|-> 	else if (Matches("ALTER", "DOMAIN", MatchAny, "RENAME", "CONSTRAINT", MatchAny))
# 2556|   		COMPLETE_WITH("TO");
# 2557|   

Error: CPPCHECK_WARNING (CWE-457): [#def1986]
postgresql-18beta1/src/bin/psql/tab-complete.in.c:2605: warning[uninitvar]: Uninitialized variable: argarray
# 2603|   		COMPLETE_WITH("TO");
# 2604|   	/* ALTER VIEW xxx RENAME COLUMN yyy */
# 2605|-> 	else if (Matches("ALTER", "VIEW", MatchAny, "RENAME", "COLUMN", MatchAnyExcept("TO")))
# 2606|   		COMPLETE_WITH("TO");
# 2607|   	/* ALTER VIEW xxx RESET ( */

Error: CPPCHECK_WARNING (CWE-457): [#def1987]
postgresql-18beta1/src/bin/psql/tab-complete.in.c:2693: warning[uninitvar]: Uninitialized variable: argarray
# 2691|   	else if (Matches("ALTER", "STATISTICS", MatchAny, "SET"))
# 2692|   		COMPLETE_WITH("SCHEMA", "STATISTICS");
# 2693|-> 
# 2694|   	/* ALTER TRIGGER <name>, add ON */
# 2695|   	else if (Matches("ALTER", "TRIGGER", MatchAny))

Error: CPPCHECK_WARNING (CWE-476): [#def1988]
postgresql-18beta1/src/bin/scripts/reindexdb.c:399: warning[nullPointer]: Possible null pointer dereference: process_list
#  397|   	 */
#  398|   	items_count = 0;
#  399|-> 	for (cell = process_list->head; cell; cell = cell->next)
#  400|   	{
#  401|   		items_count++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1989]
postgresql-18beta1/src/bin/scripts/reindexdb.c:399:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘process_list’
postgresql-18beta1/src/bin/scripts/reindexdb.c:313:12: branch_false: following ‘false’ branch (when ‘concurrentCons > 1’)...
postgresql-18beta1/src/bin/scripts/reindexdb.c:339:17: branch_false: ...to here
postgresql-18beta1/src/bin/scripts/reindexdb.c:399:14: danger: dereference of NULL ‘process_list’
#  397|   	 */
#  398|   	items_count = 0;
#  399|-> 	for (cell = process_list->head; cell; cell = cell->next)
#  400|   	{
#  401|   		items_count++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1990]
postgresql-18beta1/src/common/blkreftable.c:539:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/common/blkreftable.c:474:1: enter_function: entry to ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:489:9: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:489:9: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/src/common/blkreftable.c:492:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/blkreftable.c:500:32: branch_true: ...to here
postgresql-18beta1/src/common/blkreftable.c:502:36: call_function: calling ‘blockreftable_iterate’ from ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:502:36: return_function: returning to ‘WriteBlockRefTable’ from ‘blockreftable_iterate’
postgresql-18beta1/src/common/blkreftable.c:502:24: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/blkreftable.c:517:17: branch_false: ...to here
postgresql-18beta1/src/common/blkreftable.c:521:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/blkreftable.c:523:70: branch_true: ...to here
postgresql-18beta1/src/common/blkreftable.c:528:25: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:528:25: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/src/common/blkreftable.c:538:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/blkreftable.c:540:68: branch_true: ...to here
postgresql-18beta1/src/common/blkreftable.c:539:61: danger: dereference of NULL ‘blockreftable_lookup(*brtab.hash,  key)’
#  537|   			/* Write the untruncated portion of the chunk length array. */
#  538|   			if (sentry->nchunks != 0)
#  539|-> 				BlockRefTableWrite(&buffer, brtentry->chunk_usage,
#  540|   								   sentry->nchunks * sizeof(uint16));
#  541|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1991]
postgresql-18beta1/src/common/blkreftable.c:543:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/common/blkreftable.c:474:1: enter_function: entry to ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:489:9: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:489:9: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/src/common/blkreftable.c:492:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/blkreftable.c:500:32: branch_true: ...to here
postgresql-18beta1/src/common/blkreftable.c:502:36: call_function: calling ‘blockreftable_iterate’ from ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:502:36: return_function: returning to ‘WriteBlockRefTable’ from ‘blockreftable_iterate’
postgresql-18beta1/src/common/blkreftable.c:502:24: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/blkreftable.c:517:17: branch_false: ...to here
postgresql-18beta1/src/common/blkreftable.c:521:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/blkreftable.c:523:70: branch_true: ...to here
postgresql-18beta1/src/common/blkreftable.c:528:25: call_function: calling ‘BlockRefTableWrite’ from ‘WriteBlockRefTable’
postgresql-18beta1/src/common/blkreftable.c:528:25: return_function: returning to ‘WriteBlockRefTable’ from ‘BlockRefTableWrite’
postgresql-18beta1/src/common/blkreftable.c:538:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/blkreftable.c:543:25: branch_false: ...to here
postgresql-18beta1/src/common/blkreftable.c:543:41: danger: dereference of NULL ‘blockreftable_lookup(*brtab.hash,  key)’
#  541|   
#  542|   			/* Write the contents of each chunk. */
#  543|-> 			for (j = 0; j < brtentry->nchunks; ++j)
#  544|   			{
#  545|   				if (brtentry->chunk_usage[j] == 0)

Error: COMPILER_WARNING (CWE-704): [#def1992]
postgresql-18beta1/src/common/compression.c: scope_hint: In function ‘parse_compress_options’
postgresql-18beta1/src/common/compression.c:458:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  458 |         sep = strchr(option, ':');
#      |             ^
#  456|   	 * name.
#  457|   	 */
#  458|-> 	sep = strchr(option, ':');
#  459|   	if (sep == NULL)
#  460|   	{

Error: COMPILER_WARNING (CWE-704): [#def1993]
postgresql-18beta1/src/common/compression.c:458:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  456|   	 * name.
#  457|   	 */
#  458|-> 	sep = strchr(option, ':');
#  459|   	if (sep == NULL)
#  460|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1994]
postgresql-18beta1/src/common/cryptohash_openssl.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18beta1/src/common/cryptohash_openssl.c:135:15: acquire_memory: allocated here
postgresql-18beta1/src/common/cryptohash_openssl.c:136:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/src/common/cryptohash_openssl.c:136:12: branch_false: ...to here
postgresql-18beta1/src/common/cryptohash_openssl.c:148:9: throw: if ‘ERR_clear_error’ throws an exception...
postgresql-18beta1/src/common/cryptohash_openssl.c:148:9: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  146|   	 * previous runs.
#  147|   	 */
#  148|-> 	ERR_clear_error();
#  149|   	ctx->evpctx = EVP_MD_CTX_create();
#  150|   

Error: CPPCHECK_WARNING (CWE-457): [#def1995]
postgresql-18beta1/src/common/encnames.c:540: warning[uninitvar]: Uninitialized variable: newkey
#  538|   	}
#  539|   	*np = '\0';
#  540|-> 	return newkey;
#  541|   }
#  542|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1996]
postgresql-18beta1/src/common/exec.c:369:16: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18beta1/src/common/exec.c:360:25: acquire_memory: allocated here
postgresql-18beta1/src/common/exec.c:360:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/exec.c:368:9: branch_false: ...to here
postgresql-18beta1/src/common/exec.c:369:16: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/common/exec.c:369:16: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  367|   	/* Make sure popen() didn't change errno */
#  368|   	errno = 0;
#  369|-> 	line = pg_get_line(pipe_cmd, NULL);
#  370|   
#  371|   	if (line == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1997]
postgresql-18beta1/src/common/file_utils.c:308:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/src/common/file_utils.c:301:15: acquire_memory: allocated here
postgresql-18beta1/src/common/file_utils.c:302:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/file_utils.c:302:12: branch_false: ...to here
postgresql-18beta1/src/common/file_utils.c:308:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/common/file_utils.c:308:33: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  306|   	}
#  307|   
#  308|-> 	while (errno = 0, (de = readdir(dir)) != NULL)
#  309|   	{
#  310|   		char		subpath[MAXPGPATH * 2];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1998]
postgresql-18beta1/src/common/hmac_openssl.c:136:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18beta1/src/common/hmac_openssl.c:121:15: acquire_memory: allocated here
postgresql-18beta1/src/common/hmac_openssl.c:122:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/src/common/hmac_openssl.c:124:9: branch_false: ...to here
postgresql-18beta1/src/common/hmac_openssl.c:136:9: throw: if ‘ERR_clear_error’ throws an exception...
postgresql-18beta1/src/common/hmac_openssl.c:136:9: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  134|   	 * previous runs.
#  135|   	 */
#  136|-> 	ERR_clear_error();
#  137|   
#  138|   #ifdef USE_RESOWNER_FOR_HMAC

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1999]
postgresql-18beta1/src/common/hmac_openssl.c:142:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18beta1/src/common/hmac_openssl.c:121:15: acquire_memory: allocated here
postgresql-18beta1/src/common/hmac_openssl.c:122:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/src/common/hmac_openssl.c:124:9: branch_false: ...to here
postgresql-18beta1/src/common/hmac_openssl.c:142:24: throw: if ‘HMAC_CTX_new’ throws an exception...
postgresql-18beta1/src/common/hmac_openssl.c:142:24: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  140|   #endif
#  141|   
#  142|-> 	ctx->hmacctx = HMAC_CTX_new();
#  143|   
#  144|   	if (ctx->hmacctx == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2000]
postgresql-18beta1/src/common/logging.c:139:57: warning[-Wanalyzer-malloc-leak]: leak of ‘sgr_error’
postgresql-18beta1/src/common/logging.c:105:12: branch_true: following ‘true’ branch (when ‘pg_color_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:107:21: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:107:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:114:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:116:20: branch_true: following ‘true’ branch (when ‘pg_colors_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:118:46: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:120:28: branch_true: following ‘true’ branch (when ‘colors’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:123:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:139:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:139:69: acquire_memory: allocated here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:142:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:143:68: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:144:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:145:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:139:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:139:57: danger: ‘sgr_error’ leaks here; was allocated at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  137|   
#  138|   						if (strcmp(name, "error") == 0)
#  139|-> 							sgr_error = strdup(value);
#  140|   						if (strcmp(name, "warning") == 0)
#  141|   							sgr_warning = strdup(value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2001]
postgresql-18beta1/src/common/logging.c:141:57: warning[-Wanalyzer-malloc-leak]: leak of ‘sgr_warning’
postgresql-18beta1/src/common/logging.c:105:12: branch_true: following ‘true’ branch (when ‘pg_color_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:107:21: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:107:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:114:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:116:20: branch_true: following ‘true’ branch (when ‘pg_colors_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:118:46: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:120:28: branch_true: following ‘true’ branch (when ‘colors’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:123:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:139:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:141:71: acquire_memory: allocated here
postgresql-18beta1/src/common/logging.c:142:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:143:68: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:144:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:145:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/common/logging.c:140:53: branch_false: ...to here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:141:57: danger: ‘sgr_warning’ leaks here; was allocated at [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
#  139|   							sgr_error = strdup(value);
#  140|   						if (strcmp(name, "warning") == 0)
#  141|-> 							sgr_warning = strdup(value);
#  142|   						if (strcmp(name, "note") == 0)
#  143|   							sgr_note = strdup(value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2002]
postgresql-18beta1/src/common/logging.c:143:57: warning[-Wanalyzer-malloc-leak]: leak of ‘sgr_note’
postgresql-18beta1/src/common/logging.c:105:12: branch_true: following ‘true’ branch (when ‘pg_color_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:107:21: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:107:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:114:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:116:20: branch_true: following ‘true’ branch (when ‘pg_colors_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:118:46: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:120:28: branch_true: following ‘true’ branch (when ‘colors’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:123:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:139:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:142:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:143:68: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:143:68: acquire_memory: allocated here
postgresql-18beta1/src/common/logging.c:144:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:145:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/common/logging.c:140:53: branch_false: ...to here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:142:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:143:68: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:143:57: danger: ‘sgr_note’ leaks here; was allocated at [(21)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/20)
#  141|   							sgr_warning = strdup(value);
#  142|   						if (strcmp(name, "note") == 0)
#  143|-> 							sgr_note = strdup(value);
#  144|   						if (strcmp(name, "locus") == 0)
#  145|   							sgr_locus = strdup(value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2003]
postgresql-18beta1/src/common/logging.c:145:57: warning[-Wanalyzer-malloc-leak]: leak of ‘sgr_locus’
postgresql-18beta1/src/common/logging.c:105:12: branch_true: following ‘true’ branch (when ‘pg_color_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:107:21: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:107:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:114:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:116:20: branch_true: following ‘true’ branch (when ‘pg_colors_env’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:118:46: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:120:28: branch_true: following ‘true’ branch (when ‘colors’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:123:45: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:139:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:142:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:143:68: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:144:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:145:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:145:69: acquire_memory: allocated here
postgresql-18beta1/src/common/logging.c:125:40: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:127:57: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:129:44: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)...
postgresql-18beta1/src/common/logging.c:134:49: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:138:52: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/common/logging.c:140:53: branch_false: ...to here
postgresql-18beta1/src/common/logging.c:140:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:141:71: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:142:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:143:68: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:144:52: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/common/logging.c:145:69: branch_true: ...to here
postgresql-18beta1/src/common/logging.c:145:57: danger: ‘sgr_locus’ leaks here; was allocated at [(23)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/22)
#  143|   							sgr_note = strdup(value);
#  144|   						if (strcmp(name, "locus") == 0)
#  145|-> 							sgr_locus = strdup(value);
#  146|   					}
#  147|   				}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2004]
postgresql-18beta1/src/common/logging.c:242:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/logging.c:214:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  240|   	 * is buffered.
#  241|   	 */
#  242|-> 	fflush(stdout);
#  243|   
#  244|   	if (log_pre_callback)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2005]
postgresql-18beta1/src/common/logging.c:245:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/logging.c:214:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  243|   
#  244|   	if (log_pre_callback)
#  245|-> 		log_pre_callback();
#  246|   
#  247|   	if (log_locus_callback)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2006]
postgresql-18beta1/src/common/logging.c:248:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/logging.c:214:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  246|   
#  247|   	if (log_locus_callback)
#  248|-> 		log_locus_callback(&filename, &lineno);
#  249|   
#  250|   	fmt = _(fmt);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2007]
postgresql-18beta1/src/common/logging.c:255:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/logging.c:214:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  253|   	{
#  254|   		if (sgr_locus)
#  255|-> 			fprintf(stderr, ANSI_ESCAPE_FMT, sgr_locus);
#  256|   		if (!(log_flags & PG_LOG_FLAG_TERSE))
#  257|   			fprintf(stderr, "%s:", progname);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2008]
postgresql-18beta1/src/common/logging.c:257:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/logging.c:214:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  255|   			fprintf(stderr, ANSI_ESCAPE_FMT, sgr_locus);
#  256|   		if (!(log_flags & PG_LOG_FLAG_TERSE))
#  257|-> 			fprintf(stderr, "%s:", progname);
#  258|   		if (filename)
#  259|   		{

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2009]
postgresql-18beta1/src/common/logging.c:260:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18beta1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/logging.c:214:9: call_function: calling ‘pg_log_generic_v’ from ‘pg_log_generic’
#  258|   		if (filename)
#  259|   		{
#  260|-> 			fprintf(stderr, "%s:", filename);
#  261|   			if (lineno > 0)
#  262|   				fprintf(stderr, UINT64_FORMAT ":", lineno);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2010]
postgresql-18beta1/src/common/logging.c:314:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/logging.c:235:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/logging.c:242:9: branch_false: ...to here
postgresql-18beta1/src/common/logging.c:247:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/logging.c:250:15: branch_false: ...to here
postgresql-18beta1/src/common/logging.c:252:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/logging.c:269:14: branch_false: ...to here
postgresql-18beta1/src/common/logging.c:313:9: acquire_resource: ‘va_copy’ called here
postgresql-18beta1/src/common/logging.c:314:24: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/common/logging.c:314:24: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  312|   
#  313|   	va_copy(ap2, ap);
#  314|-> 	required_len = vsnprintf(NULL, 0, fmt, ap2) + 1;
#  315|   	va_end(ap2);
#  316|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2011]
postgresql-18beta1/src/common/md5_common.c:80:15: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   78|   
#   79|   	*errstr = NULL;
#   80|-> 	ctx = pg_cryptohash_create(PG_MD5);
#   81|   	if (ctx == NULL)
#   82|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2012]
postgresql-18beta1/src/common/md5_common.c:83:27: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   81|   	if (ctx == NULL)
#   82|   	{
#   83|-> 		*errstr = pg_cryptohash_error(NULL);	/* returns OOM */
#   84|   		return false;
#   85|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2013]
postgresql-18beta1/src/common/md5_common.c:87:13: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   85|   	}
#   86|   
#   87|-> 	if (pg_cryptohash_init(ctx) < 0 ||
#   88|   		pg_cryptohash_update(ctx, buff, len) < 0 ||
#   89|   		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2014]
postgresql-18beta1/src/common/md5_common.c:88:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   86|   
#   87|   	if (pg_cryptohash_init(ctx) < 0 ||
#   88|-> 		pg_cryptohash_update(ctx, buff, len) < 0 ||
#   89|   		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)
#   90|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2015]
postgresql-18beta1/src/common/md5_common.c:89:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   87|   	if (pg_cryptohash_init(ctx) < 0 ||
#   88|   		pg_cryptohash_update(ctx, buff, len) < 0 ||
#   89|-> 		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)
#   90|   	{
#   91|   		*errstr = pg_cryptohash_error(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2016]
postgresql-18beta1/src/common/md5_common.c:91:27: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   89|   		pg_cryptohash_final(ctx, sum, sizeof(sum)) < 0)
#   90|   	{
#   91|-> 		*errstr = pg_cryptohash_error(ctx);
#   92|   		pg_cryptohash_free(ctx);
#   93|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2017]
postgresql-18beta1/src/common/md5_common.c:92:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   90|   	{
#   91|   		*errstr = pg_cryptohash_error(ctx);
#   92|-> 		pg_cryptohash_free(ctx);
#   93|   		return false;
#   94|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2018]
postgresql-18beta1/src/common/md5_common.c:97:9: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18beta1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18beta1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18beta1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18beta1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18beta1/src/common/md5_common.c:168:15: call_function: calling ‘pg_md5_hash’ from ‘pg_md5_encrypt’
#   95|   
#   96|   	bytesToHex(sum, hexsum);
#   97|-> 	pg_cryptohash_free(ctx);
#   98|   	return true;
#   99|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2019]
postgresql-18beta1/src/common/percentrepl.c:106:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/percentrepl.c:65:38: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/percentrepl.c:67:20: branch_true: ...to here
postgresql-18beta1/src/common/percentrepl.c:75:33: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/percentrepl.c:95:33: branch_false: ...to here
postgresql-18beta1/src/common/percentrepl.c:97:33: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/percentrepl.c:98:64: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/percentrepl.c:100:53: branch_true: ...to here
postgresql-18beta1/src/common/percentrepl.c:104:52: branch_true: following ‘true’ branch (when ‘val’ is non-NULL)...
postgresql-18beta1/src/common/percentrepl.c:106:57: branch_true: ...to here
postgresql-18beta1/src/common/percentrepl.c:106:57: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/common/percentrepl.c:106:57: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  104|   						if (val)
#  105|   						{
#  106|-> 							appendStringInfoString(&result, val);
#  107|   							found = true;
#  108|   						}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2020]
postgresql-18beta1/src/common/pgfnames.c:52:31: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/src/common/pgfnames.c:45:15: acquire_memory: allocated here
postgresql-18beta1/src/common/pgfnames.c:46:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/pgfnames.c:52:31: branch_false: ...to here
postgresql-18beta1/src/common/pgfnames.c:52:31: throw: if ‘palloc’ throws an exception...
postgresql-18beta1/src/common/pgfnames.c:52:31: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   50|   	}
#   51|   
#   52|-> 	filenames = (char **) palloc(fnsize * sizeof(char *));
#   53|   
#   54|   	while (errno = 0, (file = readdir(dir)) != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2021]
postgresql-18beta1/src/common/pgfnames.c:54:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/src/common/pgfnames.c:45:15: acquire_memory: allocated here
postgresql-18beta1/src/common/pgfnames.c:46:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/pgfnames.c:52:31: branch_false: ...to here
postgresql-18beta1/src/common/pgfnames.c:54:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/common/pgfnames.c:54:35: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   52|   	filenames = (char **) palloc(fnsize * sizeof(char *));
#   53|   
#   54|-> 	while (errno = 0, (file = readdir(dir)) != NULL)
#   55|   	{
#   56|   		if (strcmp(file->d_name, ".") != 0 && strcmp(file->d_name, "..") != 0)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2022]
postgresql-18beta1/src/common/psprintf.c:107:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/psprintf.c:43:1: enter_function: entry to ‘psprintf’
postgresql-18beta1/src/common/psprintf.c:62:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/psprintf.c:63:26: call_function: calling ‘pvsnprintf’ from ‘psprintf’
#  105|   	int			nprinted;
#  106|   
#  107|-> 	nprinted = vsnprintf(buf, len, fmt, args);
#  108|   
#  109|   	/* We assume failure means the fmt is bogus, hence hard failure is OK */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2023]
postgresql-18beta1/src/common/rmtree.c:67:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/src/common/rmtree.c:60:15: acquire_memory: allocated here
postgresql-18beta1/src/common/rmtree.c:61:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/rmtree.c:67:30: branch_false: ...to here
postgresql-18beta1/src/common/rmtree.c:67:30: throw: if ‘palloc’ throws an exception...
postgresql-18beta1/src/common/rmtree.c:67:30: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   65|   	}
#   66|   
#   67|-> 	dirnames = (char **) palloc(sizeof(char *) * dirnames_capacity);
#   68|   
#   69|   	while (errno = 0, (de = readdir(dir)))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2024]
postgresql-18beta1/src/common/rmtree.c:69:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18beta1/src/common/rmtree.c:60:15: acquire_memory: allocated here
postgresql-18beta1/src/common/rmtree.c:61:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/rmtree.c:67:30: branch_false: ...to here
postgresql-18beta1/src/common/rmtree.c:69:33: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/common/rmtree.c:69:33: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   67|   	dirnames = (char **) palloc(sizeof(char *) * dirnames_capacity);
#   68|   
#   69|-> 	while (errno = 0, (de = readdir(dir)))
#   70|   	{
#   71|   		if (strcmp(de->d_name, ".") == 0 ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2025]
postgresql-18beta1/src/common/saslprep.c:1094:22: warning[-Wanalyzer-malloc-leak]: leak of ‘input_chars’
postgresql-18beta1/src/common/saslprep.c:1067:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/saslprep.c:1080:22: branch_false: ...to here
postgresql-18beta1/src/common/saslprep.c:1081:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/saslprep.c:1083:13: branch_false: ...to here
postgresql-18beta1/src/common/saslprep.c:1083:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/saslprep.c:1086:23: branch_false: ...to here
postgresql-18beta1/src/common/saslprep.c:1086:23: acquire_memory: allocated here
postgresql-18beta1/src/common/saslprep.c:1087:12: branch_false: following ‘false’ branch (when ‘input_chars’ is non-NULL)...
postgresql-18beta1/src/common/saslprep.c:1087:12: branch_false: ...to here
postgresql-18beta1/src/common/saslprep.c:1091:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/saslprep.c:1093:28: branch_true: ...to here
postgresql-18beta1/src/common/saslprep.c:1094:22: throw: if ‘pg_utf_mblen_private’ throws an exception...
postgresql-18beta1/src/common/saslprep.c:1094:22: danger: ‘input_chars’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1092|   	{
# 1093|   		input_chars[i] = utf8_to_unicode(p);
# 1094|-> 		p += pg_utf_mblen(p);
# 1095|   	}
# 1096|   	input_chars[i] = (pg_wchar) '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2026]
postgresql-18beta1/src/common/sprompt.c:142:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termin’
postgresql-18beta1/src/common/sprompt.c:95:18: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:142:17: danger: ‘termin’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2027]
postgresql-18beta1/src/common/sprompt.c:142:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:142:17: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2028]
postgresql-18beta1/src/common/sprompt.c:142:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termin’
postgresql-18beta1/src/common/sprompt.c:95:18: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:142:17: danger: ‘termin’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2029]
postgresql-18beta1/src/common/sprompt.c:142:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18beta1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:142:17: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  140|   	{
#  141|   		fputs(_(prompt), termout);
#  142|-> 		fflush(termout);
#  143|   	}
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2030]
postgresql-18beta1/src/common/sprompt.c:145:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘termin’
postgresql-18beta1/src/common/sprompt.c:95:18: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:145:18: danger: ‘termin’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2031]
postgresql-18beta1/src/common/sprompt.c:145:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:145:18: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2032]
postgresql-18beta1/src/common/sprompt.c:145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termin’
postgresql-18beta1/src/common/sprompt.c:95:18: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:145:18: danger: ‘termin’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2033]
postgresql-18beta1/src/common/sprompt.c:145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:145:18: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  143|   	}
#  144|   
#  145|-> 	result = pg_get_line(termin, prompt_ctx);
#  146|   
#  147|   	/* If we failed to read anything, just return an empty string */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2034]
postgresql-18beta1/src/common/sprompt.c:149:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:148:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/sprompt.c:149:26: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:149:26: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:149:26: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  147|   	/* If we failed to read anything, just return an empty string */
#  148|   	if (result == NULL)
#  149|-> 		result = pg_strdup("");
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2035]
postgresql-18beta1/src/common/sprompt.c:149:26: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:148:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/sprompt.c:149:26: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:149:26: throw: if ‘pg_strdup’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:149:26: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  147|   	/* If we failed to read anything, just return an empty string */
#  148|   	if (result == NULL)
#  149|-> 		result = pg_strdup("");
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2036]
postgresql-18beta1/src/common/sprompt.c:152:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:152:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:152:16: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */
#  152|-> 	(void) pg_strip_crlf(result);
#  153|   
#  154|   	if (!echo)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2037]
postgresql-18beta1/src/common/sprompt.c:152:16: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:152:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:152:16: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  150|   
#  151|   	/* strip trailing newline, including \r in case we're on Windows */
#  152|-> 	(void) pg_strip_crlf(result);
#  153|   
#  154|   	if (!echo)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2038]
postgresql-18beta1/src/common/sprompt.c:160:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:154:12: branch_false: following ‘false’ branch (when ‘echo == 0’)...
postgresql-18beta1/src/common/sprompt.c:158:17: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:160:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:160:17: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  158|   		tcsetattr(fileno(termin), TCSAFLUSH, &t_orig);
#  159|   		fputs("\n", termout);
#  160|-> 		fflush(termout);
#  161|   #elif defined(WIN32)
#  162|   		SetConsoleMode(t, t_orig);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2039]
postgresql-18beta1/src/common/sprompt.c:160:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:154:12: branch_false: following ‘false’ branch (when ‘echo == 0’)...
postgresql-18beta1/src/common/sprompt.c:158:17: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:160:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:160:17: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  158|   		tcsetattr(fileno(termin), TCSAFLUSH, &t_orig);
#  159|   		fputs("\n", termout);
#  160|-> 		fflush(termout);
#  161|   #elif defined(WIN32)
#  162|   		SetConsoleMode(t, t_orig);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2040]
postgresql-18beta1/src/common/sprompt.c:171:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:154:12: branch_true: following ‘true’ branch (when ‘echo != 0’)...
postgresql-18beta1/src/common/sprompt.c:167:17: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:167:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/sprompt.c:171:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:171:17: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  169|   		/* also echo \n if prompt was canceled */
#  170|   		fputs("\n", termout);
#  171|-> 		fflush(termout);
#  172|   	}
#  173|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2041]
postgresql-18beta1/src/common/sprompt.c:171:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:154:12: branch_true: following ‘true’ branch (when ‘echo != 0’)...
postgresql-18beta1/src/common/sprompt.c:167:17: branch_true: ...to here
postgresql-18beta1/src/common/sprompt.c:167:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/sprompt.c:171:17: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/common/sprompt.c:171:17: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  169|   		/* also echo \n if prompt was canceled */
#  170|   		fputs("\n", termout);
#  171|-> 		fflush(termout);
#  172|   	}
#  173|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2042]
postgresql-18beta1/src/common/sprompt.c:180:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:174:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:180:16: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:180:16: danger: ‘termout’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  178|   	}
#  179|   
#  180|-> 	return result;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2043]
postgresql-18beta1/src/common/sprompt.c:180:16: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18beta1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18beta1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:174:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/common/sprompt.c:180:16: branch_false: ...to here
postgresql-18beta1/src/common/sprompt.c:180:16: danger: ‘termout’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  178|   	}
#  179|   
#  180|-> 	return result;
#  181|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2044]
postgresql-18beta1/src/common/string.c:111:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
postgresql-18beta1/src/common/string.c:96:15: acquire_memory: allocated here
postgresql-18beta1/src/common/string.c:101:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
postgresql-18beta1/src/common/string.c:101:12: branch_false: ...to here
postgresql-18beta1/src/common/string.c:104:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/string.c:108:21: branch_true: ...to here
postgresql-18beta1/src/common/string.c:108:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/common/string.c:111:25: branch_true: ...to here
postgresql-18beta1/src/common/string.c:111:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/common/string.c:111:25: danger: ‘dst’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  109|   		{
#  110|   			Assert(i < (dstlen - 3));
#  111|-> 			snprintf(&dst[i], dstlen - i, "\\x%02x", (unsigned char) *p);
#  112|   			i += 4;
#  113|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2045]
postgresql-18beta1/src/common/stringinfo.c:203:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/common/stringinfo.c:145:1: enter_function: entry to ‘appendStringInfo’
postgresql-18beta1/src/common/stringinfo.c:156:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/common/stringinfo.c:157:26: call_function: calling ‘appendStringInfoVA’ from ‘appendStringInfo’
#  201|   		return 32;
#  202|   
#  203|-> 	nprinted = pvsnprintf(str->data + str->len, (size_t) avail, fmt, args);
#  204|   
#  205|   	if (nprinted < (size_t) avail)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2046]
postgresql-18beta1/src/fe_utils/astreamer_file.c:367:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
postgresql-18beta1/src/fe_utils/astreamer_file.c:362:16: acquire_resource: opened here
postgresql-18beta1/src/fe_utils/astreamer_file.c:363:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/astreamer_file.c:367:13: branch_false: ...to here
postgresql-18beta1/src/fe_utils/astreamer_file.c:367:12: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  365|   
#  366|   #ifndef WIN32
#  367|-> 	if (chmod(filename, mode))
#  368|   		pg_fatal("could not set permissions on file \"%s\": %m",
#  369|   				 filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2047]
postgresql-18beta1/src/fe_utils/astreamer_file.c:367:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’
postgresql-18beta1/src/fe_utils/astreamer_file.c:362:16: acquire_memory: allocated here
postgresql-18beta1/src/fe_utils/astreamer_file.c:363:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/astreamer_file.c:367:13: branch_false: ...to here
postgresql-18beta1/src/fe_utils/astreamer_file.c:367:12: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  365|   
#  366|   #ifndef WIN32
#  367|-> 	if (chmod(filename, mode))
#  368|   		pg_fatal("could not set permissions on file \"%s\": %m",
#  369|   				 filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2048]
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:129:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:111:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:124:46: branch_false: ...to here
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:124:46: acquire_resource: opened here
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:126:20: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:129:36: branch_false: ...to here
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:129:36: throw: if ‘gzdopen’ throws an exception...
postgresql-18beta1/src/fe_utils/astreamer_gzip.c:129:36: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  127|   			pg_fatal("could not duplicate stdout: %m");
#  128|   
#  129|-> 		streamer->gzfile = gzdopen(fd, "wb");
#  130|   		if (streamer->gzfile == NULL)
#  131|   			pg_fatal("could not open output file: %m");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2049]
postgresql-18beta1/src/fe_utils/print.c:909:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘width_header’
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  907|   			 * display across multiple lines.  We check for both cases below.
#  908|   			 */
#  909|-> 			if (width > 0 && width_wrap[i])
#  910|   			{
#  911|   				unsigned int extra_lines;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2050]
postgresql-18beta1/src/fe_utils/print.c:941:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  939|   						height;
#  940|   
#  941|-> 			pg_wcssize((const unsigned char *) cont->title, strlen(cont->title),
#  942|   					   encoding, &width, &height, NULL);
#  943|   			if (width >= width_total)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2051]
postgresql-18beta1/src/fe_utils/print.c:945:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  943|   			if (width >= width_total)
#  944|   				/* Aligned */
#  945|-> 				fprintf(fout, "%s\n", cont->title);
#  946|   			else
#  947|   				/* Centered */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2052]
postgresql-18beta1/src/fe_utils/print.c:948:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
#  946|   			else
#  947|   				/* Centered */
#  948|-> 				fprintf(fout, "%-*s%s\n", (width_total - width) / 2, "",
#  949|   						cont->title);
#  950|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2053]
postgresql-18beta1/src/fe_utils/print.c:1040:17: warning[-Wanalyzer-null-argument]: use of NULL ‘bytes_output’ where non-null expected
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
# 1038|   		}
# 1039|   
# 1040|-> 		memset(bytes_output, 0, col_count * sizeof(int));
# 1041|   
# 1042|   		/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2054]
postgresql-18beta1/src/fe_utils/print.c:1410:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
# 1408|   					fs;
# 1409|   
# 1410|-> 		pg_wcssize((const unsigned char *) *ptr, strlen(*ptr), encoding,
# 1411|   				   &width, &height, &fs);
# 1412|   		if (width > dwidth)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2055]
postgresql-18beta1/src/fe_utils/print.c:3432:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18beta1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18beta1/src/fe_utils/print.c:3609:9: call_function: calling ‘printTable’ from ‘printQuery’
# 3430|   	else
# 3431|   		*is_pager = false;
# 3432|-> }
# 3433|   
# 3434|   /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2056]
postgresql-18beta1/src/fe_utils/psqlscan.c:4571:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/fe_utils/psqlscan.l:1122:8: enter_function: entry to ‘psql_scan’
postgresql-18beta1/src/fe_utils/psqlscan.l:1137:10: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_scan’
postgresql-18beta1/src/fe_utils/psqlscan.l:1137:10: return_function: returning to ‘psql_scan’ from ‘psql_yy_switch_to_buffer’
postgresql-18beta1/src/fe_utils/psqlscan.l:1142:14: call_function: calling ‘psql_yylex’ from ‘psql_scan’
# 4569|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 4570|   	 * we need to put in 2 end-of-buffer characters.
# 4571|-> 	 */
# 4572|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 4573|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2057]
postgresql-18beta1/src/fe_utils/psqlscan.c:4614:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18beta1/src/fe_utils/psqlscan.l:1122:8: enter_function: entry to ‘psql_scan’
postgresql-18beta1/src/fe_utils/psqlscan.l:1137:10: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_scan’
postgresql-18beta1/src/fe_utils/psqlscan.l:1137:10: return_function: returning to ‘psql_scan’ from ‘psql_yy_switch_to_buffer’
postgresql-18beta1/src/fe_utils/psqlscan.l:1142:14: call_function: calling ‘psql_yylex’ from ‘psql_scan’
# 4612|   
# 4613|   	yy_flush_buffer( b , yyscanner);
# 4614|-> 
# 4615|   	b->yy_input_file = file;
# 4616|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2058]
postgresql-18beta1/src/fe_utils/psqlscan.c:4780:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/fe_utils/psqlscan.c:4766:17: enter_function: entry to ‘psql_yy_scan_buffer’
postgresql-18beta1/src/fe_utils/psqlscan.c:4776:24: call_function: inlined call to ‘psql_yyalloc’ from ‘psql_yy_scan_buffer’
postgresql-18beta1/src/fe_utils/psqlscan.c:4777:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/psqlscan.c:4780:25: branch_false: ...to here
postgresql-18beta1/src/fe_utils/psqlscan.c:4790:2: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_yy_scan_buffer’
# 4778|   	if ( ! b )
# 4779|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 4780|-> 
# 4781|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 4782|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2059]
postgresql-18beta1/src/fe_utils/recovery_gen.c:143:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename,  <unknown>)’
postgresql-18beta1/src/fe_utils/recovery_gen.c:139:14: acquire_resource: opened here
postgresql-18beta1/src/fe_utils/recovery_gen.c:140:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/recovery_gen.c:143:13: branch_false: ...to here
postgresql-18beta1/src/fe_utils/recovery_gen.c:143:13: danger: ‘fopen(&filename,  <unknown>)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  141|   		pg_fatal("could not open file \"%s\": %m", filename);
#  142|   
#  143|-> 	if (fwrite(contents->data, contents->len, 1, cf) != 1)
#  144|   		pg_fatal("could not write to file \"%s\": %m", filename);
#  145|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2060]
postgresql-18beta1/src/fe_utils/recovery_gen.c:143:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&filename,  <unknown>)’
postgresql-18beta1/src/fe_utils/recovery_gen.c:139:14: acquire_memory: allocated here
postgresql-18beta1/src/fe_utils/recovery_gen.c:140:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/fe_utils/recovery_gen.c:143:13: branch_false: ...to here
postgresql-18beta1/src/fe_utils/recovery_gen.c:143:13: danger: ‘fopen(&filename,  <unknown>)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  141|   		pg_fatal("could not open file \"%s\": %m", filename);
#  142|   
#  143|-> 	if (fwrite(contents->data, contents->len, 1, cf) != 1)
#  144|   		pg_fatal("could not write to file \"%s\": %m", filename);
#  145|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2061]
postgresql-18beta1/src/include/access/tableam.h:1017:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sscan’
postgresql-18beta1/src/backend/access/heap/heapam_handler.c:685:1: enter_function: entry to ‘heapam_relation_copy_for_cluster’
postgresql-18beta1/src/backend/access/heap/heapam_handler.c:729:12: branch_false: following ‘false’ branch (when ‘use_sort == 0’)...
postgresql-18beta1/src/backend/access/heap/heapam_handler.c:741:13: branch_false: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_handler.c:741:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/heap/heapam_handler.c:743:33: branch_true: ...to here
postgresql-18beta1/src/backend/access/heap/heapam_handler.c:802:30: call_function: calling ‘table_scan_getnextslot’ from ‘heapam_relation_copy_for_cluster’
# 1015|   table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
# 1016|   {
# 1017|-> 	slot->tts_tableOid = RelationGetRelid(sscan->rs_rd);
# 1018|   
# 1019|   	/* We don't expect actual scans using NoMovementScanDirection */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2062]
postgresql-18beta1/src/include/access/tupmacs.h:28:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:553:1: enter_function: entry to ‘brin_deform_tuple’
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:565:16: branch_true: following ‘true’ branch (when ‘dMemtuple’ is non-NULL)...
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:565:28: branch_true: ...to here
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:565:28: call_function: calling ‘brin_memtuple_initialize’ from ‘brin_deform_tuple’
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:565:28: return_function: returning to ‘brin_deform_tuple’ from ‘brin_memtuple_initialize’
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:568:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:572:14: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:583:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:587:9: branch_false: ...to here
postgresql-18beta1/src/backend/access/brin/brin_tuple.c:587:9: call_function: calling ‘brin_deconstruct_tuple’ from ‘brin_deform_tuple’
#   26|   att_isnull(int ATT, const bits8 *BITS)
#   27|   {
#   28|-> 	return !(BITS[ATT >> 3] & (1 << (ATT & 0x07)));
#   29|   }
#   30|   

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2063]
postgresql-18beta1/src/include/common/unicode_case_table.h:13563:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13561|   				else if (cp >= 0x2C00)
#13562|   				{
#13563|-> 					return case_map[cp - 0x2C00 + 2943];
#13564|   				}
#13565|   			}

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2064]
postgresql-18beta1/src/include/common/unicode_case_table.h:13570:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13568|   				if (cp < 0xA7F7)
#13569|   				{
#13570|-> 					return case_map[cp - 0xA640 + 3245];
#13571|   				}
#13572|   				else if (cp >= 0xAB53)

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2065]
postgresql-18beta1/src/include/common/unicode_case_table.h:13574:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13572|   				else if (cp >= 0xAB53)
#13573|   				{
#13574|-> 					return case_map[cp - 0xAB53 + 3684];
#13575|   				}
#13576|   			}

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2066]
postgresql-18beta1/src/include/common/unicode_case_table.h:13587:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13585|   				if (cp < 0xFB18)
#13586|   				{
#13587|-> 					return case_map[cp - 0xFB00 + 3793];
#13588|   				}
#13589|   				else if (cp >= 0xFF21)

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2067]
postgresql-18beta1/src/include/common/unicode_case_table.h:13591:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13589|   				else if (cp >= 0xFF21)
#13590|   				{
#13591|-> 					return case_map[cp - 0xFF21 + 3817];
#13592|   				}
#13593|   			}

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2068]
postgresql-18beta1/src/include/common/unicode_case_table.h:13598:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13596|   				if (cp < 0x105BD)
#13597|   				{
#13598|-> 					return case_map[cp - 0x10400 + 3875];
#13599|   				}
#13600|   				else if (cp >= 0x10C80)

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2069]
postgresql-18beta1/src/include/common/unicode_case_table.h:13602:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13600|   				else if (cp >= 0x10C80)
#13601|   				{
#13602|-> 					return case_map[cp - 0x10C80 + 4320];
#13603|   				}
#13604|   			}

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2070]
postgresql-18beta1/src/include/common/unicode_case_table.h:13612:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/common/unicode_case.c:438:1: enter_function: entry to ‘find_case_map’
postgresql-18beta1/src/common/unicode_case.c:444:20: call_function: calling ‘case_index’ from ‘find_case_map’
#13610|   				if (cp < 0x118E0)
#13611|   				{
#13612|-> 					return case_map[cp - 0x118A0 + 4582];
#13613|   				}
#13614|   				else if (cp >= 0x16E40)

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2071]
postgresql-18beta1/src/include/common/unicode_case_table.h:13616:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/include/common/unicode_case_table.h:13608:28: branch_true: following ‘true’ branch (when ‘cp <= 93823’)...
postgresql-18beta1/src/include/common/unicode_case_table.h:13610:36: branch_true: ...to here
postgresql-18beta1/src/include/common/unicode_case_table.h:13610:36: branch_false: following ‘false’ branch (when ‘cp > 71903’)...
postgresql-18beta1/src/include/common/unicode_case_table.h:13614:41: branch_false: ...to here
postgresql-18beta1/src/include/common/unicode_case_table.h:13614:41: branch_true: following ‘true’ branch (when ‘cp > 93759’)...
postgresql-18beta1/src/include/common/unicode_case_table.h:13616:57: branch_true: ...to here
postgresql-18beta1/src/include/common/unicode_case_table.h:13616:48: danger: read of 2 bytes at offset ‘cp * 2 + 8589756364’ exceeds ‘case_map’
#13614|   				else if (cp >= 0x16E40)
#13615|   				{
#13616|-> 					return case_map[cp - 0x16E40 + 4646];
#13617|   				}
#13618|   			}

Error: GCC_ANALYZER_WARNING (CWE-787): [#def2072]
postgresql-18beta1/src/include/common/unicode_case_table.h:13623:48: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18beta1/src/include/common/unicode_case_table.h:13608:28: branch_false: following ‘false’ branch (when ‘cp > 93823’)...
postgresql-18beta1/src/include/common/unicode_case_table.h:13619:33: branch_false: ...to here
postgresql-18beta1/src/include/common/unicode_case_table.h:13619:33: branch_true: following ‘true’ branch (when ‘cp > 125183’)...
postgresql-18beta1/src/include/common/unicode_case_table.h:13621:36: branch_true: ...to here
postgresql-18beta1/src/include/common/unicode_case_table.h:13621:36: branch_true: following ‘true’ branch (when ‘cp <= 125251’)...
postgresql-18beta1/src/include/common/unicode_case_table.h:13623:57: branch_true: ...to here
postgresql-18beta1/src/include/common/unicode_case_table.h:13623:48: danger: read of 2 bytes at offset ‘cp * 2 + 8589693644’ exceeds ‘case_map’
#13621|   				if (cp < 0x1E944)
#13622|   				{
#13623|-> 					return case_map[cp - 0x1E900 + 4710];
#13624|   				}
#13625|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2073]
postgresql-18beta1/src/include/lib/radixtree.h:1120:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘slot’
postgresql-18beta1/src/backend/access/common/tidstore.c:421:1: enter_function: entry to ‘TidStoreIsMember’
postgresql-18beta1/src/backend/access/common/tidstore.c:429:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/common/tidstore.c:432:24: branch_false: ...to here
postgresql-18beta1/src/backend/access/common/tidstore.c:432:24: call_function: calling ‘local_ts_find’ from ‘TidStoreIsMember’
# 1118|   	}
# 1119|   
# 1120|-> 	if (RT_CHILDPTR_IS_VALUE(*slot))
# 1121|   		return (RT_VALUE_TYPE *) slot;
# 1122|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2074]
postgresql-18beta1/src/include/libpq/pqformat.h:146:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18beta1/src/backend/libpq/auth.c:1920:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18beta1/src/backend/libpq/auth.c:1940:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1947:22: acquire_memory: allocated here
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18beta1/src/backend/libpq/auth.c:1947:12: branch_false: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1955:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18beta1/src/backend/libpq/auth.c:1957:28: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1960:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: branch_true: ...to here
postgresql-18beta1/src/backend/libpq/auth.c:1967:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
#  144|   pq_sendint32(StringInfo buf, uint32 i)
#  145|   {
#  146|-> 	enlargeStringInfo(buf, sizeof(uint32));
#  147|   	pq_writeint32(buf, i);
#  148|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2075]
postgresql-18beta1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘elemops’
postgresql-18beta1/src/backend/partitioning/partbounds.c:3868:1: enter_function: entry to ‘make_partition_op_expr’
postgresql-18beta1/src/backend/partitioning/partbounds.c:3876:19: call_function: calling ‘get_partition_operator’ from ‘make_partition_op_expr’
postgresql-18beta1/src/backend/partitioning/partbounds.c:3876:19: return_function: returning to ‘make_partition_op_expr’ from ‘get_partition_operator’
postgresql-18beta1/src/backend/partitioning/partbounds.c:3951:50: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/partitioning/partbounds.c:3951:100: call_function: inlined call to ‘list_nth_cell’ from ‘make_partition_op_expr’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2076]
postgresql-18beta1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘expanded_groups’
postgresql-18beta1/src/backend/parser/parse_agg.c:1894:1: enter_function: entry to ‘expand_grouping_sets’
postgresql-18beta1/src/backend/parser/parse_agg.c:1901:12: branch_false: following ‘false’ branch (when ‘groupingSets’ is non-NULL)...
postgresql-18beta1/src/backend/parser/parse_agg.c:1901:12: branch_false: ...to here
postgresql-18beta1/src/backend/parser/parse_agg.c:1904:9: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/parser/parse_agg.c:1927:9: call_function: inlined call to ‘list_nth_cell’ from ‘expand_grouping_sets’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2077]
postgresql-18beta1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_ops’
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3644:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3649:26: branch_true: ...to here
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3649:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3661:28: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3668:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3668:25: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3686:20: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3686:20: branch_false: following ‘false’ branch (when ‘matching_cols <= 1’)...
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3706:25: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3706:25: release_memory: ‘new_ops’ is NULL
postgresql-18beta1/src/backend/optimizer/path/indxpath.c:3708:44: call_function: inlined call to ‘list_nth_cell’ from ‘expand_indexqual_rowcompare’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2078]
postgresql-18beta1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘resultRelations’
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4489:1: enter_function: entry to ‘ExecInitModifyTable’
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4582:17: call_function: inlined call to ‘list_length’ from ‘ExecInitModifyTable’
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4588:19: call_function: inlined call to ‘newNode’ from ‘ExecInitModifyTable’
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4606:9: release_memory: ‘resultRelations’ is NULL
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4624:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4635:17: branch_false: ...to here
postgresql-18beta1/src/backend/executor/nodeModifyTable.c:4637:60: call_function: inlined call to ‘list_nth_cell’ from ‘ExecInitModifyTable’
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2079]
postgresql-18beta1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sortclause’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3080:1: enter_function: entry to ‘reorder_grouping_sets’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3086:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3092:50: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3092:24: branch_false: ...to here
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3092:24: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3086:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3092:24: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3092:50: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18beta1/src/backend/optimizer/plan/planner.c:3092:24: branch_true: following ‘true’ branch...
#  279|   	Assert(list != NIL);
#  280|   	Assert(n >= 0 && n < list->length);
#  281|-> 	return &list->elements[n];
#  282|   }
#  283|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2080]
postgresql-18beta1/src/include/storage/block.h:105:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:648:1: enter_function: entry to ‘_bt_bottomupdel_finish_pending’
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:657:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:659:39: branch_true: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:665:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:690:57: call_function: inlined call to ‘BTreeTupleGetNPosting’ from ‘_bt_bottomupdel_finish_pending’
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:696:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:709:42: branch_true: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:709:42: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘_bt_bottomupdel_finish_pending’
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:709:42: return_function: returning to ‘_bt_bottomupdel_finish_pending’ from ‘BTreeTupleGetHeapTID’
postgresql-18beta1/src/backend/access/nbtree/nbtdedup.c:712:48: call_function: inlined call to ‘ItemPointerGetBlockNumber’ from ‘_bt_bottomupdel_finish_pending’
#  103|   BlockIdGetBlockNumber(const BlockIdData *blockId)
#  104|   {
#  105|-> 	return (((BlockNumber) blockId->bi_hi) << 16) | ((BlockNumber) blockId->bi_lo);
#  106|   }
#  107|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2081]
postgresql-18beta1/src/include/storage/itemptr.h:116:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4225:1: enter_function: entry to ‘_bt_check_third_page’
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4234:12: branch_false: following ‘false’ branch (when ‘itemsz > 2704’)...
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4242:13: branch_false: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4242:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4249:18: branch_false: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4250:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4254:9: branch_false: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4254:9: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4254:9: branch_true: ...to here
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4254:9: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘_bt_check_third_page’
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4254:9: return_function: returning to ‘_bt_check_third_page’ from ‘BTreeTupleGetHeapTID’
postgresql-18beta1/src/backend/access/nbtree/nbtutils.c:4254:9: call_function: inlined call to ‘ItemPointerGetOffsetNumber’ from ‘_bt_check_third_page’
#  114|   ItemPointerGetOffsetNumberNoCheck(const ItemPointerData *pointer)
#  115|   {
#  116|-> 	return pointer->ip_posid;
#  117|   }
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2082]
postgresql-18beta1/src/include/storage/itemptr.h:116:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘nexttid’
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:923:1: enter_function: entry to ‘bt_entry_unique_check’
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:936:12: branch_false: following ‘false’ branch...
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:975:23: branch_false: ...to here
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:975:23: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘bt_entry_unique_check’
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:975:23: return_function: returning to ‘bt_entry_unique_check’ from ‘BTreeTupleGetHeapTID’
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:976:20: branch_true: following ‘true’ branch...
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:979:48: branch_true: ...to here
postgresql-18beta1/contrib/amcheck/verify_nbtree.c:981:33: call_function: calling ‘bt_report_duplicate’ from ‘bt_entry_unique_check’
#  114|   ItemPointerGetOffsetNumberNoCheck(const ItemPointerData *pointer)
#  115|   {
#  116|-> 	return pointer->ip_posid;
#  117|   }
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2083]
postgresql-18beta1/src/include/utils/expandedrecord.h:220:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘newerh’
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7587:1: enter_function: entry to ‘exec_move_row_from_datum’
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7592:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7600:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7703:21: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7703:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7714:17: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7715:17: call_function: calling ‘exec_move_row_from_fields’ from ‘exec_move_row_from_datum’
#  218|   expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
#  219|   {
#  220|-> 	if (likely(erh->er_tupdesc != NULL))
#  221|   		return erh->er_tupdesc;
#  222|   	else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2084]
postgresql-18beta1/src/include/utils/expandedrecord.h:220:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘srcerh’
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7587:1: enter_function: entry to ‘exec_move_row_from_datum’
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7592:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7600:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7703:21: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7703:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7714:17: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:7715:17: call_function: calling ‘exec_move_row_from_fields’ from ‘exec_move_row_from_datum’
#  218|   expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
#  219|   {
#  220|-> 	if (likely(erh->er_tupdesc != NULL))
#  221|   		return erh->er_tupdesc;
#  222|   	else

Error: CPPCHECK_WARNING (CWE-758): [#def2085]
postgresql-18beta1/src/include/utils/memutils.h:242: warning[objectIndex]: The address of variable 'PendingBgWriterStats' might be accessed at non-zero index.
#  240|   {
#  241|   	const unsigned char *p = (const unsigned char *) ptr;
#  242|-> 	const unsigned char *end = &p[len];
#  243|   	const unsigned char *aligned_end = (const unsigned char *)
#  244|   		((uintptr_t) end & (~(sizeof(size_t) - 1)));

Error: CPPCHECK_WARNING (CWE-758): [#def2086]
postgresql-18beta1/src/include/utils/memutils.h:242: warning[objectIndex]: The address of variable 'PendingCheckpointerStats' might be accessed at non-zero index.
#  240|   {
#  241|   	const unsigned char *p = (const unsigned char *) ptr;
#  242|-> 	const unsigned char *end = &p[len];
#  243|   	const unsigned char *aligned_end = (const unsigned char *)
#  244|   		((uintptr_t) end & (~(sizeof(size_t) - 1)));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2087]
postgresql-18beta1/src/include/utils/pgstat_internal.h:893:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1768:1: enter_function: entry to ‘pgstat_read_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1790:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1804:14: call_function: inlined call to ‘read_chunk’ from ‘pgstat_read_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1804:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1810:13: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1810:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1810:12: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1892:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1924:54: call_function: inlined call to ‘read_chunk’ from ‘pgstat_read_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1924:52: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1929:54: call_function: inlined call to ‘read_chunk’ from ‘pgstat_read_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1929:52: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1935:54: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1935:54: call_function: inlined call to ‘pgstat_is_kind_valid’ from ‘pgstat_read_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1942:61: call_function: inlined call to ‘pgstat_get_kind_info’ from ‘pgstat_read_statsfile’
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1950:52: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1957:54: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1957:52: branch_true: following ‘true’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:2040:1: branch_true: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1981:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1990:50: branch_false: ...to here
postgresql-18beta1/src/backend/utils/activity/pgstat.c:1993:46: call_function: calling ‘pgstat_get_entry_len’ from ‘pgstat_read_statsfile’
#  891|   pgstat_get_entry_len(PgStat_Kind kind)
#  892|   {
#  893|-> 	return pgstat_get_kind_info(kind)->shared_data_len;
#  894|   }
#  895|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2088]
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘response’
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:141:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:142:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:142:28: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:143:9: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:143:9: danger: ‘response’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  141|   	if (!PQExpBufferDataBroken(buf))
#  142|   		response = strdup(buf.data);
#  143|-> 	termPQExpBuffer(&buf);
#  144|   
#  145|   	if (!response)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2089]
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:307:17: warning[-Wanalyzer-malloc-leak]: leak of ‘*((struct json_ctx)*(void *)state).target_field’
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:265:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:271:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:271:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:273:20: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:273:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:290:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:290:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:299:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:299:20: branch_false: following ‘false’ branch (when ‘type == 1’)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:307:38: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:307:38: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:307:17: danger: ‘*((struct json_ctx)*(void *)state).target_field’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  305|   		}
#  306|   
#  307|-> 		*ctx->target_field = strdup(token);
#  308|   		if (!*ctx->target_field)
#  309|   			return JSON_OUT_OF_MEMORY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2090]
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:1096:20: warning[-Wanalyzer-malloc-leak]: leak of ‘*conn.oauth_issuer_id’
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:1117:1: enter_function: entry to ‘oauth_exchange’
postgresql-18beta1/src/interfaces/libpq/fe-auth-oauth.c:1134:30: call_function: calling ‘setup_oauth_parameters’ from ‘oauth_exchange’
# 1094|   		 */
# 1095|   		conn->oauth_issuer_id = strdup(conn->oauth_issuer);
# 1096|-> 		if (!conn->oauth_issuer_id)
# 1097|   		{
# 1098|   			libpq_append_conn_error(conn, "out of memory");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2091]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: warning[-Wanalyzer-malloc-leak]: leak of ‘state’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:107:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:108:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:110:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:117:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_true: following ‘true’ branch (when ‘password’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: throw: if ‘pg_saslprep’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: danger: ‘state’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  124|   	{
#  125|   		/* Normalize the password with SASLprep, if possible */
#  126|-> 		rc = pg_saslprep(password, &prep_password);
#  127|   		if (rc == SASLPREP_OOM)
#  128|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2092]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(sasl_mechanism)’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:108:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:110:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:116:33: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:117:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_true: following ‘true’ branch (when ‘password’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: throw: if ‘pg_saslprep’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:126:22: danger: ‘strdup(sasl_mechanism)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  124|   	{
#  125|   		/* Normalize the password with SASLprep, if possible */
#  126|-> 		rc = pg_saslprep(password, &prep_password);
#  127|   		if (rc == SASLPREP_OOM)
#  128|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2093]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:442:9: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:363:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:369:23: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:372:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:377:23: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:379:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:384:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:421:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:424:28: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:427:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:434:51: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:435:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:438:25: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:438:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:439:12: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:442:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:442:9: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:442:9: danger: ‘result’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  440|   		goto oom_error;
#  441|   
#  442|-> 	termPQExpBuffer(&buf);
#  443|   	return result;
#  444|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2094]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:509:37: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:474:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:478:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:488:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:495:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:500:31: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:501:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:506:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:509:37: throw: if ‘pg_b64_enc_len’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:509:37: danger: ‘cbind_input’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  507|   		memcpy(cbind_input + cbind_header_len, cbind_data, cbind_data_len);
#  508|   
#  509|-> 		encoded_cbind_len = pg_b64_enc_len(cbind_input_len);
#  510|   		if (!enlargePQExpBuffer(&buf, encoded_cbind_len))
#  511|   		{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2095]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:510:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:474:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:478:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:488:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:495:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:500:31: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:501:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:506:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:510:22: throw: if ‘enlargePQExpBuffer’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:510:22: danger: ‘cbind_input’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  508|   
#  509|   		encoded_cbind_len = pg_b64_enc_len(cbind_input_len);
#  510|-> 		if (!enlargePQExpBuffer(&buf, encoded_cbind_len))
#  511|   		{
#  512|   			free(cbind_data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2096]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:516:37: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:474:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:478:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:488:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:495:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:500:31: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:501:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:506:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:510:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:517:83: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:516:37: throw: if ‘pg_b64_encode’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:516:37: danger: ‘cbind_input’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  514|   			goto oom_error;
#  515|   		}
#  516|-> 		encoded_cbind_len = pg_b64_encode(cbind_input, cbind_input_len,
#  517|   										  buf.data + buf.len,
#  518|   										  encoded_cbind_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2097]
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:743:32: warning[-Wanalyzer-malloc-leak]: leak of ‘decoded_server_signature’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:693:1: enter_function: entry to ‘read_server_final_message’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:701:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:708:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:708:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:725:92: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:724:36: call_function: calling ‘read_attr_value’ from ‘read_server_final_message’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:724:36: return_function: returning to ‘read_server_final_message’ from ‘read_attr_value’
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:726:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:732:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:736:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:737:12: branch_false: following ‘false’ branch (when ‘decoded_server_signature’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:744:82: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:743:32: throw: if ‘pg_b64_decode’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth-scram.c:743:32: danger: ‘decoded_server_signature’ leaks here; was allocated at [(15)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/14)
#  741|   	}
#  742|   
#  743|-> 	server_signature_len = pg_b64_decode(encoded_server_signature,
#  744|   										 strlen(encoded_server_signature),
#  745|   										 decoded_server_signature,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2098]
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:84:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ginbuf.value’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:76:17: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:77:32: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:78:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:84:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:84:21: throw: if ‘pqGetnchar’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:84:21: danger: ‘ginbuf.value’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   82|   			return STATUS_ERROR;
#   83|   		}
#   84|-> 		if (pqGetnchar(ginbuf.value, payloadlen, conn))
#   85|   		{
#   86|   			/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2099]
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:721:13: warning[-Wanalyzer-malloc-leak]: leak of ‘challenge’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:713:21: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:714:12: branch_false: following ‘false’ branch (when ‘challenge’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:721:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:721:13: throw: if ‘pqGetnchar’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:721:13: danger: ‘challenge’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  719|   	}
#  720|   
#  721|-> 	if (pqGetnchar(challenge, payloadlen, conn))
#  722|   	{
#  723|   		free(challenge);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2100]
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:832:38: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:806:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:811:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:824:45: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:825:36: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:831:33: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:832:38: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:832:38: danger: ‘crypt_pwd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  830|   
#  831|   				crypt_pwd2 = crypt_pwd + MD5_PASSWD_LEN + 1;
#  832|-> 				if (!pg_md5_encrypt(password, conn->pguser,
#  833|   									strlen(conn->pguser), crypt_pwd2,
#  834|   									&errstr))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2101]
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1368:21: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1369:12: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: danger: ‘crypt_pwd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1370|   		return NULL;
# 1371|   
# 1372|-> 	if (!pg_md5_encrypt(passwd, user, strlen(user), crypt_pwd, &errstr))
# 1373|   	{
# 1374|   		free(crypt_pwd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2102]
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1485:30: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1413:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1416:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1419:12: branch_false: following ‘false’ branch (when ‘algorithm’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1461:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1468:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1478:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1478:17: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1480:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1480:29: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1481:20: branch_true: following ‘true’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1483:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1485:30: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1485:30: danger: ‘crypt_pwd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 1483|   			const char *errstr = NULL;
# 1484|   
# 1485|-> 			if (!pg_md5_encrypt(passwd, user, strlen(user), crypt_pwd, &errstr))
# 1486|   			{
# 1487|   				libpq_append_conn_error(conn, "could not encrypt password: %s", errstr);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2103]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:119:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)*conn.be_cancel_key_len)’ where non-null expected
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:73:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:77:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:77:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:83:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:83:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:90:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:99:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:101:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:107:14: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:107:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:113:30: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:114:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:116:52: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:116:45: acquire_memory: this call could return NULL
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:117:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:119:72: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:119:17: danger: argument 1 (‘malloc((long unsigned int)*conn.be_cancel_key_len)’) from [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14) could be NULL where non-null expected
#  117|   		if (!conn->be_cancel_key)
#  118|   			goto oom_error;
#  119|-> 		memcpy(cancelConn->be_cancel_key, conn->be_cancel_key, conn->be_cancel_key_len);
#  120|   	}
#  121|   	cancelConn->be_cancel_key_len = conn->be_cancel_key_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2104]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:398:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:373:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:384:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:385:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:388:32: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:396:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:398:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:398:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:398:22: danger: ‘cancel’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  396|   	if (conn->pgtcp_user_timeout != NULL)
#  397|   	{
#  398|-> 		if (!pqParseIntParam(conn->pgtcp_user_timeout,
#  399|   							 &cancel->pgtcp_user_timeout,
#  400|   							 conn, "tcp_user_timeout"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2105]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:405:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:373:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:384:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:385:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:388:32: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:396:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:405:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:405:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:405:22: danger: ‘cancel’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  403|   	if (conn->keepalives != NULL)
#  404|   	{
#  405|-> 		if (!pqParseIntParam(conn->keepalives,
#  406|   							 &cancel->keepalives,
#  407|   							 conn, "keepalives"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2106]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:412:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:373:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:384:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:385:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:388:32: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:396:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:410:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:410:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:412:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:412:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:412:22: danger: ‘cancel’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  410|   	if (conn->keepalives_idle != NULL)
#  411|   	{
#  412|-> 		if (!pqParseIntParam(conn->keepalives_idle,
#  413|   							 &cancel->keepalives_idle,
#  414|   							 conn, "keepalives_idle"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2107]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:419:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:373:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:384:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:385:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:388:32: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:396:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:410:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:410:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:417:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:417:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:419:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:419:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:419:22: danger: ‘cancel’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  417|   	if (conn->keepalives_interval != NULL)
#  418|   	{
#  419|-> 		if (!pqParseIntParam(conn->keepalives_interval,
#  420|   							 &cancel->keepalives_interval,
#  421|   							 conn, "keepalives_interval"))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2108]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:426:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cancel’
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:373:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:376:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:380:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:384:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:385:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:388:32: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:396:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:403:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:410:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:410:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:417:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:417:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:424:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:424:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:426:22: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:426:22: throw: if ‘pqParseIntParam’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:426:22: danger: ‘cancel’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  424|   	if (conn->keepalives_count != NULL)
#  425|   	{
#  426|-> 		if (!pqParseIntParam(conn->keepalives_count,
#  427|   							 &cancel->keepalives_count,
#  428|   							 conn, "keepalives_count"))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2109]
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:628:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmpsock’
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:538:12: branch_false: following ‘false’ branch (when ‘cancel’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:550:31: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:550:24: acquire_resource: stream socket created here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:550:12: branch_false: following ‘false’ branch (when ‘tmpsock != -1’)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:566:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:628:13: throw: if ‘connect’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:628:13: danger: ‘tmpsock’ leaks here
#  626|   
#  627|   retry3:
#  628|-> 	if (connect(tmpsock, (struct sockaddr *) &cancel->raddr.addr,
#  629|   				cancel->raddr.salen) < 0)
#  630|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2110]
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:192:43: warning[-Wanalyzer-malloc-leak]: leak of ‘PQmakeEmptyPGresult(conn, 0)’
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:2344:1: enter_function: entry to ‘PQexecStart’
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:2369:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
#  190|   		/* copy connection data we might need for operations on PGresult */
#  191|   		result->noticeHooks = conn->noticeHooks;
#  192|-> 		result->client_encoding = conn->client_encoding;
#  193|   
#  194|   		/* consider copying conn's errorMessage */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2111]
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:713:31: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:2344:1: enter_function: entry to ‘PQexecStart’
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:2369:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
#  711|   		res->errMsg = msg;
#  712|   	else
#  713|-> 		res->errMsg = libpq_gettext("out of memory\n");
#  714|   }
#  715|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2112]
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:737:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:2344:1: enter_function: entry to ‘PQexecStart’
postgresql-18beta1/src/interfaces/libpq/fe-exec.c:2369:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
#  735|   	{
#  736|   		/* only send DESTROY to successfully-initialized event procs */
#  737|-> 		if (res->events[i].resultInitialized)
#  738|   		{
#  739|   			PGEventResultDestroy evt;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2113]
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:112:9: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_gbuf.value’
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:94:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:95:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:106:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:107:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:112:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:112:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-gssapi-common.c:112:9: danger: ‘temp_gbuf.value’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  110|   		return STATUS_ERROR;
#  111|   	}
#  112|-> 	snprintf(temp_gbuf.value, maxlen, "%s@%s",
#  113|   			 conn->krbsrvname, host);
#  114|   	temp_gbuf.length = strlen(temp_gbuf.value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2114]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:897:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:897:15: throw: if ‘PQexec’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:897:15: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  895|   		"where nspname = 'pg_catalog')";
#  896|   
#  897|-> 	res = PQexec(conn, query);
#  898|   	if (res == NULL)
#  899|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2115]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:25: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:25: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  913|   	 * Examine the result and put the OID's into the struct
#  914|   	 */
#  915|-> 	for (n = 0; n < PQntuples(res); n++)
#  916|   	{
#  917|   		fname = PQgetvalue(res, n, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2116]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:917:25: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:917:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:917:25: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  915|   	for (n = 0; n < PQntuples(res); n++)
#  916|   	{
#  917|-> 		fname = PQgetvalue(res, n, 0);
#  918|   		foid = (Oid) atoi(PQgetvalue(res, n, 1));
#  919|   		if (strcmp(fname, "lo_open") == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2117]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:918:35: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:918:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:918:35: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  916|   	{
#  917|   		fname = PQgetvalue(res, n, 0);
#  918|-> 		foid = (Oid) atoi(PQgetvalue(res, n, 1));
#  919|   		if (strcmp(fname, "lo_open") == 0)
#  920|   			lobjfuncs->fn_lo_open = foid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2118]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:947:9: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:947:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:947:9: throw: if ‘PQclear’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:947:9: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  945|   	}
#  946|   
#  947|-> 	PQclear(res);
#  948|   
#  949|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2119]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:956:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:21: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:947:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:954:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:956:17: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:956:17: throw: if ‘libpq_append_conn_error’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:956:17: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  954|   	if (lobjfuncs->fn_lo_open == 0)
#  955|   	{
#  956|-> 		libpq_append_conn_error(conn, "cannot determine OID of function %s",
#  957|   								"lo_open");
#  958|   		free(lobjfuncs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2120]
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:963:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:919:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:920:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:954:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:961:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:961:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:963:17: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:963:17: throw: if ‘libpq_append_conn_error’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-lobj.c:963:17: danger: ‘lobjfuncs’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  961|   	if (lobjfuncs->fn_lo_close == 0)
#  962|   	{
#  963|-> 		libpq_append_conn_error(conn, "cannot determine OID of function %s",
#  964|   								"lo_close");
#  965|   		free(lobjfuncs);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2121]
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1365:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1357:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1364:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1365:24: throw: if ‘appendPQExpBufferVA’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1365:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1363|   		errno = save_errno;
# 1364|   		va_start(args, fmt);
# 1365|-> 		done = appendPQExpBufferVA(errorMessage, libpq_gettext(fmt), args);
# 1366|   		va_end(args);
# 1367|   	} while (!done);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2122]
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1394:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1386:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1386:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1393:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1394:24: throw: if ‘appendPQExpBufferVA’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-misc.c:1394:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1392|   		errno = save_errno;
# 1393|   		va_start(args, fmt);
# 1394|-> 		done = appendPQExpBufferVA(&conn->errorMessage, libpq_gettext(fmt), args);
# 1395|   		va_end(args);
# 1396|   	} while (!done);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2123]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2124]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2125]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:25: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2126]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2127]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2128]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:113:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  111|   		if (!fieldNames || !fieldNotNum || !fieldMax)
#  112|   		{
#  113|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  114|   			goto exit;
#  115|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2129]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  122|   			int			len;
#  123|   			const char *s = (j < numFieldName && po->fieldName[j][0]) ?
#  124|-> 				po->fieldName[j] : PQfname(res, j);
#  125|   
#  126|   			fieldNames[j] = s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2130]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  122|   			int			len;
#  123|   			const char *s = (j < numFieldName && po->fieldName[j][0]) ?
#  124|-> 				po->fieldName[j] : PQfname(res, j);
#  125|   
#  126|   			fieldNames[j] = s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2131]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:124:52: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  122|   			int			len;
#  123|   			const char *s = (j < numFieldName && po->fieldName[j][0]) ?
#  124|-> 				po->fieldName[j] : PQfname(res, j);
#  125|   
#  126|   			fieldNames[j] = s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2132]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  178|   				  )))
#  179|   			{
#  180|-> 				fflush(NULL);
#  181|   				fout = popen(pagerenv, "w");
#  182|   				if (fout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2133]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  178|   				  )))
#  179|   			{
#  180|-> 				fflush(NULL);
#  181|   				fout = popen(pagerenv, "w");
#  182|   				if (fout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2134]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:180:33: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  178|   				  )))
#  179|   			{
#  180|-> 				fflush(NULL);
#  181|   				fout = popen(pagerenv, "w");
#  182|   				if (fout)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2135]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: throw: if ‘popen’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  179|   			{
#  180|   				fflush(NULL);
#  181|-> 				fout = popen(pagerenv, "w");
#  182|   				if (fout)
#  183|   				{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2136]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: throw: if ‘popen’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  179|   			{
#  180|   				fflush(NULL);
#  181|-> 				fout = popen(pagerenv, "w");
#  182|   				if (fout)
#  183|   				{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2137]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: throw: if ‘popen’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  179|   			{
#  180|   				fflush(NULL);
#  181|-> 				fout = popen(pagerenv, "w");
#  182|   				if (fout)
#  183|   				{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2138]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2139]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2140]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2141]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(pagerenv, "w")’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: danger: ‘popen(pagerenv, "w")’ leaks here; was allocated at [(27)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/26)
#  184|   					usePipe = true;
#  185|   #ifndef WIN32
#  186|-> 					if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
#  187|   						sigpipe_masked = true;
#  188|   #endif							/* WIN32 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2142]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2143]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2144]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2145]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:33: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/26)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2146]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2147]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2148]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/2)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2149]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/26)
#  199|   			if (!fields)
#  200|   			{
#  201|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  202|   				goto exit;
#  203|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2150]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2151]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2152]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2153]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:41: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/26)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2154]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2155]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2156]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2157]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:211:103: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:210:55: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/26)
#  208|   			{
#  209|   				if (po->align)
#  210|-> 					fprintf(fout, libpq_gettext("%-*s%s Value\n"),
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2158]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2159]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2160]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2161]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:41: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/26)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2162]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2163]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2164]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/2)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2165]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:205:25: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:207:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:209:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:109: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:213:55: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/26)
#  211|   							fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
#  212|   				else
#  213|-> 					fprintf(fout, libpq_gettext("%s%sValue\n"), libpq_gettext("Field"), po->fieldSep);
#  214|   			}
#  215|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2166]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/2)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2167]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/2)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2168]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/2)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2169]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fields’ leaks here; was allocated at [(15)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/14)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2170]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:274:65: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:272:49: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/26)
#  270|   				{
#  271|   					if (po->caption)
#  272|-> 						fprintf(fout,
#  273|   								"<table %s><caption align=\"top\">%s</caption>\n",
#  274|   								po->tableOpt ? po->tableOpt : "",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2171]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/2)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2172]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/2)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2173]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/2)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2174]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fields’ leaks here; was allocated at [(15)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/14)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2175]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:271:44: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:281:65: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:277:49: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/26)
#  275|   								po->caption);
#  276|   					else
#  277|-> 						fprintf(fout,
#  278|   								"<table %s><caption align=\"top\">"
#  279|   								"Retrieved %d rows * %d fields"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2176]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fieldMax’ leaks here; was allocated at [(3)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/2)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2177]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fieldNames’ leaks here; was allocated at [(3)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/2)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2178]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fieldNotNum’ leaks here; was allocated at [(3)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/2)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2179]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fields’ leaks here; was allocated at [(15)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/14)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2180]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:269:36: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:69: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:284:41: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/26)
#  282|   				}
#  283|   				else
#  284|-> 					fprintf(fout, "<table %s>", po->tableOpt ? po->tableOpt : "");
#  285|   			}
#  286|   			if (po->header)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2181]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:318:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:140:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:139:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:147:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:168:33: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:169:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:167:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:170:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:181:40: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:182:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:186:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:201:49: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:303:20: branch_false: following ‘false’ branch (when ‘fields’ is NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:312:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:313:20: branch_true: following ‘true’ branch (when ‘usePipe != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:318:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:318:25: throw: if ‘pclose’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:318:25: danger: ‘fout’ leaks here; was allocated at [(27)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/26)
#  316|   			_pclose(fout);
#  317|   #else
#  318|-> 			pclose(fout);
#  319|   
#  320|   			/* we can't easily verify if EPIPE occurred, so say it did */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2182]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2183]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2184]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2185]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:342:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  340|   	bool		skipit;
#  341|   
#  342|-> 	plen = PQgetlength(res, i, j);
#  343|   	pval = PQgetvalue(res, i, j);
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2186]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2187]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2188]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2189]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  341|   
#  342|   	plen = PQgetlength(res, i, j);
#  343|-> 	pval = PQgetvalue(res, i, j);
#  344|   
#  345|   	if (plen < 1 || !pval || !*pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2190]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2191]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2192]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2193]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:365:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  363|   			char		ch = '0';
#  364|   
#  365|-> 			for (p = pval; *p; p += PQmblenBounded(p, res->client_encoding))
#  366|   			{
#  367|   				ch = *p;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2194]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2195]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2196]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2197]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:396:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:246:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:255:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:257:38: call_function: calling ‘do_field’ from ‘PQprint’
#  394|   			if (!(fields[i * nFields + j] = (char *) malloc(plen + 1)))
#  395|   			{
#  396|-> 				fprintf(stderr, libpq_gettext("out of memory\n"));
#  397|   				return false;
#  398|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2198]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2199]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2200]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2201]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2202]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:110:36: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2203]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:108:46: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2204]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:109:49: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2205]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:467:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:123:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:127:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:120:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:135:55: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:195:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:197:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:199:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:233:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:244:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:265:39: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:267:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:29: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:286:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:287:42: call_function: calling ‘do_header’ from ‘PQprint’
#  465|   		if (!border)
#  466|   		{
#  467|-> 			fprintf(stderr, libpq_gettext("out of memory\n"));
#  468|   			return NULL;
#  469|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2206]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:493:25: warning[-Wanalyzer-malloc-leak]: leak of ‘border’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:452:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:452:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:464:26: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:465:20: branch_false: following ‘false’ branch (when ‘border’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:471:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:471:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:473:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:475:32: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:476:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:492:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:493:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:493:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:493:25: danger: ‘border’ leaks here; was allocated at [(3)](sarif:/runs/0/results/95/codeFlows/0/threadFlows/0/locations/2)
#  491|   		*p = '\0';
#  492|   		if (po->standard)
#  493|-> 			fprintf(fout, "%s\n", border);
#  494|   	}
#  495|   	if (po->standard)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2207]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/96/codeFlows/0/threadFlows/0/locations/2)
#  611|   		for (j = 0; j < nFields; j++)
#  612|   		{
#  613|-> 			fLength[j] = strlen(PQfname(res, j));
#  614|   			for (i = 0; i < nTuples; i++)
#  615|   			{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2208]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:616:64: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:614:37: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:616:64: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:616:64: throw: if ‘PQgetlength’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:616:64: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/97/codeFlows/0/threadFlows/0/locations/2)
#  614|   			for (i = 0; i < nTuples; i++)
#  615|   			{
#  616|-> 				int			flen = PQgetlength(res, i, j);
#  617|   
#  618|   				if (flen > fLength[j])

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2209]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:629:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:627:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:629:31: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:629:31: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:629:31: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/98/codeFlows/0/threadFlows/0/locations/2)
#  627|   		for (i = 0; i < nFields; i++)
#  628|   		{
#  629|-> 			fputs(PQfname(res, i), fp);
#  630|   			if (fillAlign)
#  631|   				fill(strlen(PQfname(res, i)), fLength[i], ' ', fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2210]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:631:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:627:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:629:31: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:630:28: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:631:70: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:631:45: throw: if ‘PQfname’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:631:45: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/99/codeFlows/0/threadFlows/0/locations/2)
#  629|   			fputs(PQfname(res, i), fp);
#  630|   			if (fillAlign)
#  631|-> 				fill(strlen(PQfname(res, i)), fLength[i], ' ', fp);
#  632|   			fputs(fieldSep, fp);
#  633|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2211]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:634:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:627:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:634:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:634:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:634:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/100/codeFlows/0/threadFlows/0/locations/2)
#  632|   			fputs(fieldSep, fp);
#  633|   		}
#  634|-> 		fprintf(fp, "\n");
#  635|   
#  636|   		/* Underline the attribute names */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2212]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:643:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: following ‘true’ branch (when ‘printHeader != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:627:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:634:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:637:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:643:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:643:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:643:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/101/codeFlows/0/threadFlows/0/locations/2)
#  641|   			fputs(fieldSep, fp);
#  642|   		}
#  643|-> 		fprintf(fp, "\n");
#  644|   	}
#  645|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2213]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:651:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:618:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:619:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:611:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:647:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:647:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:649:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:651:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:651:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:651:25: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/102/codeFlows/0/threadFlows/0/locations/2)
#  649|   		for (j = 0; j < nFields; j++)
#  650|   		{
#  651|-> 			fprintf(fp, "%s", PQgetvalue(res, i, j));
#  652|   			if (fillAlign)
#  653|   				fill(strlen(PQgetvalue(res, i, j)), fLength[j], ' ', fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2214]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:653:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:611:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:613:45: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:618:36: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:619:41: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:611:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:624:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:647:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:647:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:649:29: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:651:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:652:28: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:653:76: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:653:45: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:653:45: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/104/codeFlows/0/threadFlows/0/locations/2)
#  651|   			fprintf(fp, "%s", PQgetvalue(res, i, j));
#  652|   			if (fillAlign)
#  653|-> 				fill(strlen(PQgetvalue(res, i, j)), fLength[j], ' ', fp);
#  654|   			fputs(fieldSep, fp);
#  655|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2215]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:656:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:647:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:647:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:649:29: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:656:17: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:656:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:656:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/105/codeFlows/0/threadFlows/0/locations/2)
#  654|   			fputs(fieldSep, fp);
#  655|   		}
#  656|-> 		fprintf(fp, "\n");
#  657|   	}
#  658|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2216]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:660:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:659:12: branch_true: following ‘true’ branch (when ‘quiet == 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:661:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:660:17: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:660:17: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/106/codeFlows/0/threadFlows/0/locations/2)
#  658|   
#  659|   	if (!quiet)
#  660|-> 		fprintf(fp, "\nQuery returned %d row%s.\n", PQntuples(res),
#  661|   				(PQntuples(res) == 1) ? "" : "s");
#  662|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2217]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:661:34: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:659:12: branch_true: following ‘true’ branch (when ‘quiet == 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:661:34: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:661:34: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:661:34: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/108/codeFlows/0/threadFlows/0/locations/2)
#  659|   	if (!quiet)
#  660|   		fprintf(fp, "\nQuery returned %d row%s.\n", PQntuples(res),
#  661|-> 				(PQntuples(res) == 1) ? "" : "s");
#  662|   
#  663|   	fflush(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2218]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:663:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fLength’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:602:12: branch_true: following ‘true’ branch (when ‘fillAlign != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:604:35: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: following ‘false’ branch (when ‘fLength’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:605:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:663:9: throw: if ‘fflush’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:663:9: danger: ‘fLength’ leaks here; was allocated at [(3)](sarif:/runs/0/results/109/codeFlows/0/threadFlows/0/locations/2)
#  661|   				(PQntuples(res) == 1) ? "" : "s");
#  662|   
#  663|-> 	fflush(fp);
#  664|   
#  665|   	free(fLength);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2219]
postgresql-18beta1/src/interfaces/libpq/fe-print.c:710:25: warning[-Wanalyzer-malloc-leak]: leak of ‘tborder’
postgresql-18beta1/src/interfaces/libpq/fe-print.c:693:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:696:20: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:696:20: branch_true: following ‘true’ branch (when ‘TerseOutput == 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:700:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:701:44: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:702:28: branch_false: following ‘false’ branch (when ‘tborder’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:702:28: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-print.c:710:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-print.c:710:25: danger: ‘tborder’ leaks here; was allocated at [(5)](sarif:/runs/0/results/110/codeFlows/0/threadFlows/0/locations/4)
#  708|   				tborder[i] = '-';
#  709|   			tborder[width] = '\0';
#  710|-> 			fprintf(fout, "%s\n", tborder);
#  711|   		}
#  712|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2220]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1222:24: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: throw: if ‘pg_encoding_max_length’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: danger: ‘qidx’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 1235|   
# 1236|   	/* We can optimize a bit if it's a single-byte encoding */
# 1237|-> 	mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1238|   
# 1239|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2221]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: throw: if ‘pg_encoding_max_length’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: danger: ‘scridx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 1235|   
# 1236|   	/* We can optimize a bit if it's a single-byte encoding */
# 1237|-> 	mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1238|   
# 1239|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2222]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: throw: if ‘pg_encoding_max_length’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1235|   
# 1236|   	/* We can optimize a bit if it's a single-byte encoding */
# 1237|-> 	mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1238|   
# 1239|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2223]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1222:24: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1254:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1258:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1266:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1267:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1294:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: danger: ‘qidx’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 1296|   			int			w;
# 1297|   
# 1298|-> 			w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1299|   			/* treat any non-tab control chars as width 1 */
# 1300|   			if (w <= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2224]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1254:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1258:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1266:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1267:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1294:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: danger: ‘scridx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
# 1296|   			int			w;
# 1297|   
# 1298|-> 			w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1299|   			/* treat any non-tab control chars as width 1 */
# 1300|   			if (w <= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2225]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1254:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1258:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1266:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1267:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1294:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1296|   			int			w;
# 1297|   
# 1298|-> 			w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1299|   			/* treat any non-tab control chars as width 1 */
# 1300|   			if (w <= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2226]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1222:24: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1254:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1258:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1266:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1267:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1294:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: danger: ‘qidx’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 1301|   				w = 1;
# 1302|   			scroffset += w;
# 1303|-> 			qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1304|   		}
# 1305|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2227]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1254:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1258:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1266:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1267:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1294:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: danger: ‘scridx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 1301|   				w = 1;
# 1302|   			scroffset += w;
# 1303|-> 			qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1304|   		}
# 1305|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2228]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1203:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1207:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1208:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1220:16: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1223:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1228:26: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1229:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1237:24: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1254:23: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1258:21: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1266:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1267:25: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1294:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1298:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1303:36: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1301|   				w = 1;
# 1302|   			scroffset += w;
# 1303|-> 			qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1304|   		}
# 1305|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2229]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1592:13: warning[-Wanalyzer-malloc-leak]: leak of ‘svname’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1584:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1586:20: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1586:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1589:25: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1589:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1590:12: branch_false: following ‘false’ branch (when ‘svname’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1592:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1592:13: throw: if ‘pqGets’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:1592:13: danger: ‘svname’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 1590|   	if (!svname)
# 1591|   		return EOF;
# 1592|-> 	if (pqGets(&conn->workBuffer, conn))
# 1593|   	{
# 1594|   		free(svname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2230]
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2388:29: warning[-Wanalyzer-malloc-leak]: leak of ‘startpacket’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2313:1: enter_function: entry to ‘pqBuildStartupPacket3’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2318:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2318:22: return_function: returning to ‘pqBuildStartupPacket3’ from ‘build_startup_packet’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2319:32: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2320:12: branch_false: following ‘false’ branch (when ‘startpacket’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2322:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2322:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
# 2386|   		if ((val = getenv(next_eo->envName)) != NULL)
# 2387|   		{
# 2388|-> 			if (pg_strcasecmp(val, "default") != 0)
# 2389|   				ADD_STARTUP_OPTION(next_eo->pgName, val);
# 2390|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2231]
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:63:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:87:1: enter_function: entry to ‘pq_verify_peer_name_matches_certificate_name’
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:97:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:107:16: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:108:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:113:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:120:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:127:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:127:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:132:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:132:18: call_function: calling ‘wildcard_certificate_match’ from ‘pq_verify_peer_name_matches_certificate_name’
#   61|   	 * If string does not end in pattern (minus the wildcard), we don't match
#   62|   	 */
#   63|-> 	if (pg_strcasecmp(pattern + 1, string + lenstr - lenpat + 1) != 0)
#   64|   		return false;
#   65|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2232]
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:127:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:97:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:107:16: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:108:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:113:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:120:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:127:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:127:13: throw: if ‘pg_strcasecmp’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-common.c:127:13: danger: ‘name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  125|   	}
#  126|   
#  127|-> 	if (pg_strcasecmp(name, host) == 0)
#  128|   	{
#  129|   		/* Exact name match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2233]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:17: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:47: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:17: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:17: danger: ‘errbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1558|   	if (ecode == 0)
# 1559|   	{
# 1560|-> 		snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("no SSL error reported"));
# 1561|   		return errbuf;
# 1562|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2234]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:47: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:47: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:47: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1560:47: danger: ‘errbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1558|   	if (ecode == 0)
# 1559|   	{
# 1560|-> 		snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("no SSL error reported"));
# 1561|   		return errbuf;
# 1562|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2235]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: throw: if ‘ERR_reason_error_string’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: danger: ‘errbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1561|   		return errbuf;
# 1562|   	}
# 1563|-> 	errreason = ERR_reason_error_string(ecode);
# 1564|   	if (errreason != NULL)
# 1565|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2236]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1582:17: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1550:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1579:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1579:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1580:17: call_function: inlined call to ‘ERR_GET_REASON’ from ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1579:13: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1582:17: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1582:17: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1582:17: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
# 1580|   		ERR_GET_REASON(ecode) == SSL_AD_REASON_OFFSET + SSL_AD_NO_APPLICATION_PROTOCOL)
# 1581|   	{
# 1582|-> 		snprintf(errbuf, SSL_ERR_LEN, "no application protocol");
# 1583|   		return errbuf;
# 1584|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2237]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1597:17: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1550:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1579:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1595:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1597:17: call_function: inlined call to ‘ERR_GET_REASON’ from ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1597:17: throw: if ‘pg_strerror_r’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1597:17: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/1)
# 1595|   	if (ERR_SYSTEM_ERROR(ecode))
# 1596|   	{
# 1597|-> 		strerror_r(ERR_GET_REASON(ecode), errbuf, SSL_ERR_LEN);
# 1598|   		return errbuf;
# 1599|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2238]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1550:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1579:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1595:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:39: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:9: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/1)
# 1601|   
# 1602|   	/* No choice but to report the numeric ecode */
# 1603|-> 	snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("SSL error code %lu"), ecode);
# 1604|   	return errbuf;
# 1605|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2239]
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:39: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1550:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1555:18: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1556:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1558:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1563:21: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1564:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1579:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1595:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:39: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:39: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-secure-openssl.c:1603:39: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
# 1601|   
# 1602|   	/* No choice but to report the numeric ecode */
# 1603|-> 	snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("SSL error code %lu"), ecode);
# 1604|   	return errbuf;
# 1605|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2240]
postgresql-18beta1/src/interfaces/libpq/pqexpbuffer.c:308:28: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/interfaces/libpq/pqexpbuffer.c:265:1: enter_function: entry to ‘appendPQExpBuffer’
postgresql-18beta1/src/interfaces/libpq/pqexpbuffer.c:271:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/pqexpbuffer.c:278:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/interfaces/libpq/pqexpbuffer.c:279:24: call_function: calling ‘appendPQExpBufferVA’ from ‘appendPQExpBuffer’
#  306|   		avail = str->maxlen - str->len;
#  307|   
#  308|-> 		nprinted = vsnprintf(str->data + str->len, avail, fmt, args);
#  309|   
#  310|   		/*

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2241]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1196:45: warning[-Wanalyzer-null-argument]: use of NULL ‘colname’ where non-null expected
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1073:1: enter_function: entry to ‘resolve_column_ref’
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1104:17: call_function: inlined call to ‘list_length’ from ‘resolve_column_ref’
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1170:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1173:17: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1180:28: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1182:28: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1182:28: branch_true: following ‘true’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1185:68: branch_true: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1190:40: branch_true: following ‘true’ branch (when ‘i >= 0’)...
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1192:100: branch_true: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1196:45: danger: argument 2 (‘colname’) NULL where non-null expected
# 1194|   					Assert(fld->dtype == PLPGSQL_DTYPE_RECFIELD &&
# 1195|   						   fld->recparentno == nse->itemno);
# 1196|-> 					if (strcmp(fld->fieldname, colname) == 0)
# 1197|   					{
# 1198|   						return make_datum_param(expr, i, cref->location);

Error: CPPCHECK_WARNING (CWE-768): [#def2242]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1346: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1344|   	int			nnames;
# 1345|   
# 1346|-> 	idents = list_make2(makeString(word1),
# 1347|   						makeString(word2));
# 1348|   

Error: CPPCHECK_WARNING (CWE-768): [#def2243]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1463: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1461|   							 */
# 1462|   							new = plpgsql_build_recfield(rec, word2);
# 1463|-> 							idents = list_make2(makeString(word1),
# 1464|   												makeString(word2));
# 1465|   						}

Error: CPPCHECK_WARNING (CWE-768): [#def2244]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1470: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1468|   							/* Block-qualified reference to record variable. */
# 1469|   							new = plpgsql_build_recfield(rec, word3);
# 1470|-> 							idents = list_make3(makeString(word1),
# 1471|   												makeString(word2),
# 1472|   												makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def2245]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1470: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))},(union ListCell){.ptr_value=(makeString(word3))}' depends on order of evaluation of side effects
# 1468|   							/* Block-qualified reference to record variable. */
# 1469|   							new = plpgsql_build_recfield(rec, word3);
# 1470|-> 							idents = list_make3(makeString(word1),
# 1471|   												makeString(word2),
# 1472|   												makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def2246]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1488: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))}' depends on order of evaluation of side effects
# 1486|   
# 1487|   	/* Nothing found */
# 1488|-> 	idents = list_make3(makeString(word1),
# 1489|   						makeString(word2),
# 1490|   						makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def2247]
postgresql-18beta1/src/pl/plpgsql/src/pl_comp.c:1488: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(makeString(word1))},(union ListCell){.ptr_value=(makeString(word2))},(union ListCell){.ptr_value=(makeString(word3))}' depends on order of evaluation of side effects
# 1486|   
# 1487|   	/* Nothing found */
# 1488|-> 	idents = list_make3(makeString(word1),
# 1489|   						makeString(word2),
# 1490|   						makeString(word3));

Error: CPPCHECK_WARNING (CWE-768): [#def2248]
postgresql-18beta1/src/pl/plpgsql/src/pl_exec.c:8493: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sbsref->refexpr)},(union ListCell){.ptr_value=(sbsref->refassgnexpr)}' depends on order of evaluation of side effects
# 8491|   		 * the fargs list somehow.
# 8492|   		 */
# 8493|-> 		fargs = list_make2(sbsref->refexpr, sbsref->refassgnexpr);
# 8494|   	}
# 8495|   	else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2249]
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1885:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1840:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1846:34: branch_true: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1872:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1874:7: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1883:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1883:12: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1885:9: danger: use of uninitialized value ‘yyss’ here
# 1883|           if (! yyptr)
# 1884|             YYNOMEM;
# 1885|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1886|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1887|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2250]
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:2016:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1840:6: branch_false: following ‘false’ branch...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1909:6: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1909:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1912:3: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1924:6: branch_true: following ‘true’ branch (when ‘yyn == -249’)...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1925:5: branch_true: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1996:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:1998:3: branch_false: ...to here
postgresql-18beta1/src/pl/plpgsql/src/pl_gram.c:2016:3: danger: use of uninitialized value ‘*<unknown>’ here
# 2014|        unconditionally makes the parser a bit smaller, and it avoids a
# 2015|        GCC warning that YYVAL may be used uninitialized.  */
# 2016|->   yyval = yyvsp[1-yylen];
# 2017|   
# 2018|     /* Default location. */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2251]
postgresql-18beta1/src/pl/plpython/plpy_elog.c:478:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/pl/plpython/plpy_elog.c:477:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/pl/plpython/plpy_elog.c:478:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/pl/plpython/plpy_elog.c:478:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  476|   
#  477|   	va_start(ap, fmt);
#  478|-> 	vsnprintf(buf, sizeof(buf), dgettext(TEXTDOMAIN, fmt), ap);
#  479|   	va_end(ap);
#  480|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2252]
postgresql-18beta1/src/pl/plpython/plpy_elog.c:494:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/pl/plpython/plpy_elog.c:493:9: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/pl/plpython/plpy_elog.c:494:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18beta1/src/pl/plpython/plpy_elog.c:494:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  492|   
#  493|   	va_start(ap, n);
#  494|-> 	vsnprintf(buf, sizeof(buf),
#  495|   			  dngettext(TEXTDOMAIN, fmt_singular, fmt_plural, n),
#  496|   			  ap);

Error: CPPCHECK_WARNING (CWE-457): [#def2253]
postgresql-18beta1/src/pl/plpython/plpy_exec.c:282: warning[uninitvar]: Uninitialized variable: plerrcontext.previous
#  280|   	PG_END_TRY();
#  281|   
#  282|-> 	error_context_stack = plerrcontext.previous;
#  283|   
#  284|   	/* Pop old arguments from the stack if they were pushed above */

Error: CPPCHECK_WARNING (CWE-457): [#def2254]
postgresql-18beta1/src/pl/plpython/plpy_exec.c:305: warning[uninitvar]: Uninitialized variable: rv
#  303|   
#  304|   	/* Plain function, just return the Datum value (possibly null) */
#  305|-> 	return rv;
#  306|   }
#  307|   

Error: CPPCHECK_WARNING (CWE-457): [#def2255]
postgresql-18beta1/src/pl/plpython/plpy_exec.c:1046: warning[uninitvar]: Uninitialized variables: rtup.t_len, rtup.t_self, rtup.t_tableOid, rtup.t_data
# 1044|   	error_context_stack = plerrcontext.previous;
# 1045|   
# 1046|-> 	return rtup;
# 1047|   }
# 1048|   

Error: CPPCHECK_WARNING (CWE-457): [#def2256]
postgresql-18beta1/src/pl/plpython/plpy_main.c:261: warning[uninitvar]: Uninitialized variable: retval
#  259|   	PLy_pop_execution_context();
#  260|   
#  261|-> 	return retval;
#  262|   }
#  263|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2257]
postgresql-18beta1/src/port/chklocale.c:341:21: warning[-Wanalyzer-malloc-leak]: leak of ‘sys’
postgresql-18beta1/src/port/chklocale.c:316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:317:17: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:316:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:322:15: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:323:12: branch_false: following ‘false’ branch (when ‘loc’ is non-NULL)...
postgresql-18beta1/src/port/chklocale.c:326:15: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:327:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/port/chklocale.c:328:23: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:328:23: acquire_memory: allocated here
postgresql-18beta1/src/port/chklocale.c:335:12: branch_false: following ‘false’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/src/port/chklocale.c:335:12: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:339:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/port/chklocale.c:341:21: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:341:21: throw: if ‘pg_strcasecmp’ throws an exception...
postgresql-18beta1/src/port/chklocale.c:341:21: danger: ‘sys’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  339|   	for (i = 0; encoding_match_list[i].system_enc_name; i++)
#  340|   	{
#  341|-> 		if (pg_strcasecmp(sys, encoding_match_list[i].system_enc_name) == 0)
#  342|   		{
#  343|   			free(sys);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2258]
postgresql-18beta1/src/port/chklocale.c:370:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sys’
postgresql-18beta1/src/port/chklocale.c:316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:317:17: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:316:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:322:15: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:323:12: branch_false: following ‘false’ branch (when ‘loc’ is non-NULL)...
postgresql-18beta1/src/port/chklocale.c:326:15: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:327:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/port/chklocale.c:328:23: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:328:23: acquire_memory: allocated here
postgresql-18beta1/src/port/chklocale.c:335:12: branch_false: following ‘false’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/src/port/chklocale.c:335:12: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:339:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/port/chklocale.c:341:21: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:341:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:339:61: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:341:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:339:61: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:367:12: branch_true: following ‘true’ branch (when ‘write_message != 0’)...
postgresql-18beta1/src/port/chklocale.c:370:33: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:370:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/port/chklocale.c:370:17: danger: ‘sys’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  368|   	{
#  369|   #ifdef FRONTEND
#  370|-> 		fprintf(stderr, _("could not determine encoding for locale \"%s\": codeset is \"%s\""),
#  371|   				ctype, sys);
#  372|   		/* keep newline separate so there's only one translatable string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2259]
postgresql-18beta1/src/port/chklocale.c:375:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sys’
postgresql-18beta1/src/port/chklocale.c:316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:317:17: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:316:13: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:322:15: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:323:12: branch_false: following ‘false’ branch (when ‘loc’ is non-NULL)...
postgresql-18beta1/src/port/chklocale.c:326:15: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:327:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/port/chklocale.c:328:23: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:328:23: acquire_memory: allocated here
postgresql-18beta1/src/port/chklocale.c:335:12: branch_false: following ‘false’ branch (when ‘sys’ is non-NULL)...
postgresql-18beta1/src/port/chklocale.c:335:12: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:339:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/port/chklocale.c:341:21: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:341:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:339:61: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:341:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/chklocale.c:339:61: branch_false: ...to here
postgresql-18beta1/src/port/chklocale.c:367:12: branch_true: following ‘true’ branch (when ‘write_message != 0’)...
postgresql-18beta1/src/port/chklocale.c:375:17: branch_true: ...to here
postgresql-18beta1/src/port/chklocale.c:375:17: throw: if ‘errstart’ throws an exception...
postgresql-18beta1/src/port/chklocale.c:375:17: danger: ‘sys’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  373|   		fputc('\n', stderr);
#  374|   #else
#  375|-> 		ereport(WARNING,
#  376|   				(errmsg("could not determine encoding for locale \"%s\": codeset is \"%s\"",
#  377|   						ctype, sys)));

Error: CPPCHECK_WARNING (CWE-758): [#def2260]
postgresql-18beta1/src/port/pg_crc32c_sse42_choose.c:100: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   98|   #ifdef USE_AVX512_CRC32C_WITH_RUNTIME_CHECK
#   99|   			if (exx[2] & (1 << 10) &&	/* VPCLMULQDQ */
#  100|-> 				exx[1] & (1 << 31)) /* AVX512-VL */
#  101|   				pg_comp_crc32c = pg_comp_crc32c_avx512;
#  102|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2261]
postgresql-18beta1/src/port/pgcheckdir.c:46:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
postgresql-18beta1/src/port/pgcheckdir.c:42:18: acquire_memory: allocated here
postgresql-18beta1/src/port/pgcheckdir.c:43:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/port/pgcheckdir.c:43:12: branch_false: ...to here
postgresql-18beta1/src/port/pgcheckdir.c:46:35: throw: if ‘readdir’ throws an exception...
postgresql-18beta1/src/port/pgcheckdir.c:46:35: danger: ‘opendir(dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   44|   		return (errno == ENOENT) ? 0 : -1;
#   45|   
#   46|-> 	while (errno = 0, (file = readdir(chkdir)) != NULL)
#   47|   	{
#   48|   		if (strcmp(".", file->d_name) == 0 ||

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2262]
postgresql-18beta1/src/test/isolation/specparse.c:1006:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18beta1/src/test/isolation/specparse.c:964:6: branch_true: following ‘true’ branch...
postgresql-18beta1/src/test/isolation/specparse.c:970:28: branch_true: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:993:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18beta1/src/test/isolation/specparse.c:995:7: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:1004:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18beta1/src/test/isolation/specparse.c:1006:9: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:1006:9: danger: use of uninitialized value ‘yyss’ here
# 1004|           if (! yyptr)
# 1005|             YYNOMEM;
# 1006|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1007|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1008|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2263]
postgresql-18beta1/src/test/isolation/specparse.c:1133:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18beta1/src/test/isolation/specparse.c:964:6: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/isolation/specparse.c:1028:6: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:1028:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18beta1/src/test/isolation/specparse.c:1031:3: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:1043:6: branch_true: following ‘true’ branch (when ‘yyn == -14’)...
postgresql-18beta1/src/test/isolation/specparse.c:1044:5: branch_true: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:1113:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18beta1/src/test/isolation/specparse.c:1115:3: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specparse.c:1133:3: danger: use of uninitialized value ‘*<unknown>’ here
# 1131|        unconditionally makes the parser a bit smaller, and it avoids a
# 1132|        GCC warning that YYVAL may be used uninitialized.  */
# 1133|->   yyval = yyvsp[1-yylen];
# 1134|   
# 1135|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2264]
postgresql-18beta1/src/test/isolation/specscanner.c:1727:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/test/isolation/specscanner.c:1714:21: enter_function: entry to ‘spec_yy_create_buffer’
postgresql-18beta1/src/test/isolation/specscanner.c:1718:24: call_function: inlined call to ‘spec_yyalloc’ from ‘spec_yy_create_buffer’
postgresql-18beta1/src/test/isolation/specscanner.c:1719:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/isolation/specscanner.c:1722:2: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specscanner.c:1727:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1725|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1726|   	 * we need to put in 2 end-of-buffer characters.
# 1727|-> 	 */
# 1728|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 1729|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def2265]
postgresql-18beta1/src/test/isolation/specscanner.c:1768: warning[nullPointer]: Possible null pointer dereference: b
# 1766|       
# 1767|   	yy_flush_buffer( b );
# 1768|-> 
# 1769|   	b->yy_input_file = file;
# 1770|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def2266]
postgresql-18beta1/src/test/isolation/specscanner.c:1769: warning[nullPointer]: Possible null pointer dereference: b
# 1767|   	yy_flush_buffer( b );
# 1768|   
# 1769|-> 	b->yy_input_file = file;
# 1770|   	b->yy_fill_buffer = 1;
# 1771|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2267]
postgresql-18beta1/src/test/isolation/specscanner.c:1930:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18beta1/src/test/isolation/specscanner.c:1916:17: enter_function: entry to ‘spec_yy_scan_buffer’
postgresql-18beta1/src/test/isolation/specscanner.c:1926:24: call_function: inlined call to ‘spec_yyalloc’ from ‘spec_yy_scan_buffer’
postgresql-18beta1/src/test/isolation/specscanner.c:1927:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/isolation/specscanner.c:1930:25: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specscanner.c:1940:2: call_function: calling ‘spec_yy_switch_to_buffer’ from ‘spec_yy_scan_buffer’
# 1928|   	if ( ! b )
# 1929|   		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 1930|-> 
# 1931|   	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
# 1932|   	b->yy_buf_pos = b->yy_ch_buf = base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2268]
postgresql-18beta1/src/test/isolation/specscanner.c:1982:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18beta1/src/test/isolation/specscanner.c:1966:17: enter_function: entry to ‘spec_yy_scan_bytes’
postgresql-18beta1/src/test/isolation/specscanner.c:1975:24: call_function: inlined call to ‘spec_yyalloc’ from ‘spec_yy_scan_bytes’
postgresql-18beta1/src/test/isolation/specscanner.c:1976:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/isolation/specscanner.c:1976:12: branch_false: ...to here
postgresql-18beta1/src/test/isolation/specscanner.c:1984:6: call_function: calling ‘spec_yy_scan_buffer’ from ‘spec_yy_scan_bytes’
# 1980|   	for ( i = 0; i < _yybytes_len; ++i )
# 1981|   		buf[i] = yybytes[i];
# 1982|-> 
# 1983|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1984|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2269]
postgresql-18beta1/src/test/regress/pg_regress.c:387:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/src/test/regress/pg_regress.c:1294:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  385|   		|| (type == NOTE_DETAIL && !in_note))
#  386|   	{
#  387|-> 		fprintf(fp, "# ");
#  388|   		if (logfile)
#  389|   			fprintf(logfile, "# ");

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2270]
postgresql-18beta1/src/test/regress/pg_regress.c:389:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/src/test/regress/pg_regress.c:1294:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  387|   		fprintf(fp, "# ");
#  388|   		if (logfile)
#  389|-> 			fprintf(logfile, "# ");
#  390|   	}
#  391|   	errno = save_errno;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2271]
postgresql-18beta1/src/test/regress/pg_regress.c:392:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/src/test/regress/pg_regress.c:1294:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  390|   	}
#  391|   	errno = save_errno;
#  392|-> 	vfprintf(fp, fmt, argp);
#  393|   	if (logfile)
#  394|   	{

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2272]
postgresql-18beta1/src/test/regress/pg_regress.c:396:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18beta1/src/test/regress/pg_regress.c:1294:17: call_function: calling ‘emit_tap_output’ from ‘file_line_count’
#  394|   	{
#  395|   		errno = save_errno;
#  396|-> 		vfprintf(logfile, fmt, argp_logfile);
#  397|   	}
#  398|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2273]
postgresql-18beta1/src/test/regress/pg_regress.c:413:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1331:1: enter_function: entry to ‘make_directory’
postgresql-18beta1/src/test/regress/pg_regress.c:1334:17: call_function: calling ‘bail_out’ from ‘make_directory’
#  411|   	if (type == BAIL)
#  412|   	{
#  413|-> 		fprintf(stdout, "Bail out!");
#  414|   		if (logfile)
#  415|   			fprintf(logfile, "Bail out!");

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2274]
postgresql-18beta1/src/test/regress/pg_regress.c:415:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1916:1: enter_function: entry to ‘open_result_files’
postgresql-18beta1/src/test/regress/pg_regress.c:1922:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1926:9: branch_true: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1929:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1930:17: branch_true: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1930:17: call_function: calling ‘bail_out’ from ‘open_result_files’
#  413|   		fprintf(stdout, "Bail out!");
#  414|   		if (logfile)
#  415|-> 			fprintf(logfile, "Bail out!");
#  416|   	}
#  417|   

Error: COMPILER_WARNING (CWE-704): [#def2275]
postgresql-18beta1/src/test/regress/pg_regress.c: scope_hint: In function ‘get_expectfile’
postgresql-18beta1/src/test/regress/pg_regress.c:703:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  703 |         if (!file || !(file_type = strrchr(file, '.')))
#      |                                  ^
#  701|   	 * following the last dot in the file name.
#  702|   	 */
#  703|-> 	if (!file || !(file_type = strrchr(file, '.')))
#  704|   		return NULL;
#  705|   

Error: COMPILER_WARNING (CWE-704): [#def2276]
postgresql-18beta1/src/test/regress/pg_regress.c:703:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  701|   	 * following the last dot in the file name.
#  702|   	 */
#  703|-> 	if (!file || !(file_type = strrchr(file, '.')))
#  704|   		return NULL;
#  705|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2277]
postgresql-18beta1/src/test/regress/pg_regress.c:1148:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18beta1/src/test/regress/pg_regress.c:1147:17: acquire_resource: ‘va_start’ called here
postgresql-18beta1/src/test/regress/pg_regress.c:1148:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1148:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1146|   
# 1147|   		va_start(args, query);
# 1148|-> 		needed = appendStringInfoVA(&cmdbuf, query, args);
# 1149|   		va_end(args);
# 1150|   		if (needed == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2278]
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1269:25: acquire_resource: opened here
postgresql-18beta1/src/test/regress/pg_regress.c:1271:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: throw: if ‘fseek’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1274|   		return -1;
# 1275|   	}
# 1276|-> 	fseek(f, 0, SEEK_END);
# 1277|   	r = ftell(f);
# 1278|   	fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2279]
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1269:25: acquire_memory: allocated here
postgresql-18beta1/src/test/regress/pg_regress.c:1271:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: throw: if ‘fseek’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1274|   		return -1;
# 1275|   	}
# 1276|-> 	fseek(f, 0, SEEK_END);
# 1277|   	r = ftell(f);
# 1278|   	fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2280]
postgresql-18beta1/src/test/regress/pg_regress.c:1277:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1269:25: acquire_resource: opened here
postgresql-18beta1/src/test/regress/pg_regress.c:1271:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1277:13: throw: if ‘ftell’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1277:13: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1275|   	}
# 1276|   	fseek(f, 0, SEEK_END);
# 1277|-> 	r = ftell(f);
# 1278|   	fclose(f);
# 1279|   	return r;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2281]
postgresql-18beta1/src/test/regress/pg_regress.c:1277:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1269:25: acquire_memory: allocated here
postgresql-18beta1/src/test/regress/pg_regress.c:1271:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1276:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1277:13: throw: if ‘ftell’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1277:13: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 1275|   	}
# 1276|   	fseek(f, 0, SEEK_END);
# 1277|-> 	r = ftell(f);
# 1278|   	fclose(f);
# 1279|   	return r;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2282]
postgresql-18beta1/src/test/regress/pg_regress.c:1297:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1290:25: acquire_resource: opened here
postgresql-18beta1/src/test/regress/pg_regress.c:1292:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1292:12: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1297:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1297:21: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1295|   		return -1;
# 1296|   	}
# 1297|-> 	while ((c = fgetc(f)) != EOF)
# 1298|   	{
# 1299|   		if (c == '\n')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2283]
postgresql-18beta1/src/test/regress/pg_regress.c:1297:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1290:25: acquire_memory: allocated here
postgresql-18beta1/src/test/regress/pg_regress.c:1292:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1292:12: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1297:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1297:21: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 1295|   		return -1;
# 1296|   	}
# 1297|-> 	while ((c = fgetc(f)) != EOF)
# 1298|   	{
# 1299|   		if (c == '\n')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2284]
postgresql-18beta1/src/test/regress/pg_regress.c:1366:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
postgresql-18beta1/src/test/regress/pg_regress.c:1348:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
postgresql-18beta1/src/test/regress/pg_regress.c:1351:28: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1351:28: acquire_memory: allocated here
postgresql-18beta1/src/test/regress/pg_regress.c:1351:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/test/regress/pg_regress.c:1357:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1359:12: branch_false: following ‘false’ branch (when ‘last_dot’ is non-NULL)...
postgresql-18beta1/src/test/regress/pg_regress.c:1365:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1366:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1366:9: danger: ‘s’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1364|   	}
# 1365|   	*last_dot = '\0';
# 1366|-> 	snprintf(s, ssize, "%s_%d.%s", tmp, i, last_dot + 1);
# 1367|   	free(tmp);
# 1368|   	return s;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2285]
postgresql-18beta1/src/test/regress/pg_regress.c:1366:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
postgresql-18beta1/src/test/regress/pg_regress.c:1348:30: acquire_memory: allocated here
postgresql-18beta1/src/test/regress/pg_regress.c:1348:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
postgresql-18beta1/src/test/regress/pg_regress.c:1351:28: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1351:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
postgresql-18beta1/src/test/regress/pg_regress.c:1357:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1359:12: branch_false: following ‘false’ branch (when ‘last_dot’ is non-NULL)...
postgresql-18beta1/src/test/regress/pg_regress.c:1365:9: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1366:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/test/regress/pg_regress.c:1366:9: danger: ‘tmp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
# 1364|   	}
# 1365|   	*last_dot = '\0';
# 1366|-> 	snprintf(s, ssize, "%s_%d.%s", tmp, i, last_dot + 1);
# 1367|   	free(tmp);
# 1368|   	return s;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2286]
postgresql-18beta1/src/test/regress/pg_regress.c:1683:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(schedule, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1664:15: acquire_resource: opened here
postgresql-18beta1/src/test/regress/pg_regress.c:1665:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1665:12: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1668:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1676:17: branch_true: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1683:21: danger: ‘fopen(schedule, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 1681|   			scbuf[--i] = '\0';
# 1682|   
# 1683|-> 		if (scbuf[0] == '\0' || scbuf[0] == '#')
# 1684|   			continue;
# 1685|   		if (strncmp(scbuf, "test: ", 6) == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2287]
postgresql-18beta1/src/test/regress/pg_regress.c:1683:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(schedule, "r")’
postgresql-18beta1/src/test/regress/pg_regress.c:1664:15: acquire_memory: allocated here
postgresql-18beta1/src/test/regress/pg_regress.c:1665:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1665:12: branch_false: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1668:16: branch_true: following ‘true’ branch...
postgresql-18beta1/src/test/regress/pg_regress.c:1676:17: branch_true: ...to here
postgresql-18beta1/src/test/regress/pg_regress.c:1683:21: danger: ‘fopen(schedule, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 1681|   			scbuf[--i] = '\0';
# 1682|   
# 1683|-> 		if (scbuf[0] == '\0' || scbuf[0] == '#')
# 1684|   			continue;
# 1685|   		if (strncmp(scbuf, "test: ", 6) == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2288]
postgresql-18beta1/src/timezone/localtime.c:233:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/src/timezone/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/src/timezone/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  231|   		++name;
#  232|   
#  233|-> 	fid = pg_open_tzfile(name, canonname);
#  234|   	if (fid < 0)
#  235|   		return ENOENT;			/* pg_open_tzfile may not set errno */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2289]
postgresql-18beta1/src/timezone/localtime.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/src/timezone/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/src/timezone/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  240|   		int			err = nread < 0 ? errno : EINVAL;
#  241|   
#  242|-> 		close(fid);
#  243|   		return err;
#  244|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2290]
postgresql-18beta1/src/timezone/localtime.c:245:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lsp’
postgresql-18beta1/src/timezone/localtime.c:1389:1: enter_function: entry to ‘pg_gmtime’
postgresql-18beta1/src/timezone/localtime.c:1391:16: call_function: calling ‘gmtsub’ from ‘pg_gmtime’
#  243|   		return err;
#  244|   	}
#  245|-> 	if (close(fid) < 0)
#  246|   		return errno;
#  247|   	for (stored = 4; stored <= 8; stored *= 2)

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-181.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-namepostgresql18-18beta1-4.fc43
store-results-to/tmp/tmpeu5rmtu7/postgresql18-18beta1-4.fc43.tar.xz
time-created2026-01-08 20:19:57
time-finished2026-01-08 20:44:11
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpeu5rmtu7/postgresql18-18beta1-4.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpeu5rmtu7/postgresql18-18beta1-4.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9