Task #91755 - added.err
back to task #91755download
Error: SHELLCHECK_WARNING (CWE-571):
/usr/bin/postgresql-setup:398:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 396| local line var_name var_value
# 397| debug "Parsing ${service_file}"
# 398|-> local systemd_env="$(cat "${service_file}")" \
# 399| || { return; }
# 400|
Error: SHELLCHECK_WARNING (CWE-456):
/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:
/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:
/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):
/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):
/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):
/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):
/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):
/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):
/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:
/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):
/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):
/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):
/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):
/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: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-16.11/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):
postgresql-18.1/postgresql-16.11/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):
postgresql-18.1/postgresql-16.11/contrib/pgcrypto/px.c:158:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-16.11/contrib/pgcrypto/px.c:153:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-16.11/contrib/pgcrypto/px.c:154:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/contrib/pgcrypto/px.c:158:17: branch_true: ...to here
postgresql-18.1/postgresql-16.11/contrib/pgcrypto/px.c:158:17: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/postgresql-16.11/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: GCC_ANALYZER_WARNING (CWE-688):
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:78:25: warning[-Wanalyzer-null-argument]: use of NULL ‘replaceTo’ where non-null expected
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:96:1: enter_function: entry to ‘initTrie’
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:104:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:117:17: branch_true: ...to here
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:119:17: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:119:17: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:119:17: branch_true: ...to here
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:150:50: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:152:50: branch_true: ...to here
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:156:52: branch_true: following ‘true’ branch (when ‘state == 1’)...
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:154:44: branch_true: ...to here
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:198:36: branch_true: following ‘true’ branch (when ‘state > 0’)...
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:199:52: branch_true: ...to here
postgresql-18.1/postgresql-16.11/contrib/unaccent/unaccent.c:199:52: call_function: calling ‘placeChar’ from ‘initTrie’
# 76| curnode->replacelen = replacelen;
# 77| curnode->replaceTo = (char *) palloc(replacelen);
# 78|-> memcpy(curnode->replaceTo, replaceTo, replacelen);
# 79| }
# 80| }
Error: GCC_ANALYZER_WARNING (CWE-688):
postgresql-18.1/postgresql-16.11/src/backend/access/transam/xact.c:5936:76: warning[-Wanalyzer-null-argument]: use of NULL ‘twophase_gid’ where non-null expected
postgresql-18.1/postgresql-16.11/src/backend/access/transam/xact.c:3305:1: enter_function: entry to ‘AbortCurrentTransaction’
postgresql-18.1/postgresql-16.11/src/backend/access/transam/xact.c:3339:25: call_function: calling ‘AbortTransaction’ from ‘AbortCurrentTransaction’
# 5934| XLogRegisterData((char *) (&xl_twophase), sizeof(xl_xact_twophase));
# 5935| if (xl_xinfo.xinfo & XACT_XINFO_HAS_GID)
# 5936|-> XLogRegisterData(unconstify(char *, twophase_gid), strlen(twophase_gid) + 1);
# 5937| }
# 5938|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/bootstrap/bootscanner.c:1982:32: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-16.11/src/backend/bootstrap/bootscanner.c:1968:17: enter_function: entry to ‘boot_yy_scan_buffer’
postgresql-18.1/postgresql-16.11/src/backend/bootstrap/bootscanner.c:1978:31: call_function: inlined call to ‘boot_yyalloc’ from ‘boot_yy_scan_buffer’
postgresql-18.1/postgresql-16.11/src/backend/bootstrap/bootscanner.c:1979:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/bootstrap/bootscanner.c:1982:32: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/bootstrap/bootscanner.c:1992:9: call_function: calling ‘boot_yy_switch_to_buffer’ from ‘boot_yy_scan_buffer’
# 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;
# 1984| b->yy_is_our_buffer = 0;
Error: CPPCHECK_WARNING (CWE-786):
postgresql-18.1/postgresql-16.11/src/backend/commands/tablecmds.c:4988: error[negativeIndex]: Array 'tab->subcmds[11]' accessed at index -1, which is out of bounds.
# 4986|
# 4987| /* Add the subcommand to the appropriate list for phase 2 */
# 4988|-> tab->subcmds[pass] = lappend(tab->subcmds[pass], cmd);
# 4989| }
# 4990|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:676:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1921:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1941:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1948:22: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1948:22: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1948:12: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1956:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1958:28: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1961:36: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1968:41: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/libpq/auth.c:1968:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
# 674| CHECK_FOR_INTERRUPTS();
# 675|
# 676|-> pq_beginmessage(&buf, 'R');
# 677| pq_sendint32(&buf, (int32) areq);
# 678| if (extralen > 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:360:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rw’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:256:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:256:12: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:269:26: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:271:67: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:285:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:311:20: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:321:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:347:22: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:347:22: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:348:20: branch_false: following ‘false’ branch (when ‘rw’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:361:52: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:360:17: throw: if ‘ascii_safe_strlcpy’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/bgworker.c:360:17: danger: ‘rw’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 358| * source data might not even be NUL-terminated.
# 359| */
# 360|-> ascii_safe_strlcpy(rw->rw_worker.bgw_name,
# 361| slot->worker.bgw_name, BGW_MAXLEN);
# 362| ascii_safe_strlcpy(rw->rw_worker.bgw_type,
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:2545:13: warning[-Wanalyzer-malloc-leak]: leak of ‘port’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:2537:31: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:2537:12: branch_false: following ‘false’ branch (when ‘port’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:2545:13: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:2545:13: throw: if ‘StreamConnection’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:2545:13: danger: ‘port’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2543| }
# 2544|
# 2545|-> if (StreamConnection(serverFd, port) != STATUS_OK)
# 2546| {
# 2547| if (port->sock != PGINVALID_SOCKET)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4161:50: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4119:1: enter_function: entry to ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4128:26: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4129:12: branch_false: following ‘false’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:14: call_function: inlined call to ‘RandomCancelKey’ from ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4151:9: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4160:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4161:50: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4161:50: throw: if ‘AssignPostmasterChildSlot’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4161:50: danger: ‘bn’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
# 4159| */
# 4160| if (!bn->dead_end)
# 4161|-> bn->child_slot = MyPMChildSlot = AssignPostmasterChildSlot();
# 4162| else
# 4163| bn->child_slot = 0;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4171:15: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4119:1: enter_function: entry to ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4128:26: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4129:12: branch_false: following ‘false’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:14: call_function: inlined call to ‘RandomCancelKey’ from ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4151:9: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4154:38: call_function: calling ‘canAcceptConnections’ from ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4154:38: return_function: returning to ‘BackendStartup’ from ‘canAcceptConnections’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4160:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4160:12: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4171:15: throw: if ‘fork_process’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4171:15: danger: ‘bn’ leaks here; was allocated at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
# 4169| pid = backend_forkexec(port);
# 4170| #else /* !EXEC_BACKEND */
# 4171|-> pid = fork_process();
# 4172| if (pid == 0) /* child */
# 4173| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4215:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4119:1: enter_function: entry to ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4128:26: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4129:12: branch_false: following ‘false’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:14: call_function: inlined call to ‘RandomCancelKey’ from ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4151:9: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4154:38: call_function: calling ‘canAcceptConnections’ from ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4154:38: return_function: returning to ‘BackendStartup’ from ‘canAcceptConnections’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4172:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4199:12: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4199:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4215:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4215:9: throw: if ‘errstart’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4215:9: danger: ‘bn’ leaks here; was allocated at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
# 4213|
# 4214| /* in parent, successful fork */
# 4215|-> ereport(DEBUG2,
# 4216| (errmsg_internal("forked new backend, pid=%d socket=%d",
# 4217| (int) pid, (int) port->sock)));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5282:16: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4119:1: enter_function: entry to ‘BackendStartup’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4128:26: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4129:12: branch_false: following ‘false’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:4142:14: call_function: inlined call to ‘RandomCancelKey’ from ‘BackendStartup’
# 5280| RandomCancelKey(int32 *cancel_key)
# 5281| {
# 5282|-> return pg_strong_random(cancel_key, sizeof(int32));
# 5283| }
# 5284|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5477:58: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5443:1: enter_function: entry to ‘StartAutovacuumWorker’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5454:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5462:22: call_function: inlined call to ‘RandomCancelKey’ from ‘StartAutovacuumWorker’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5462:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5470:34: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5470:34: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5471:20: branch_true: following ‘true’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5473:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5477:58: throw: if ‘AssignPostmasterChildSlot’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5477:58: danger: ‘bn’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 5475| /* Autovac workers are not dead_end and need a child slot */
# 5476| bn->dead_end = false;
# 5477|-> bn->child_slot = MyPMChildSlot = AssignPostmasterChildSlot();
# 5478| bn->bgworker_notify = false;
# 5479|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5480:35: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5443:1: enter_function: entry to ‘StartAutovacuumWorker’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5454:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5462:22: call_function: inlined call to ‘RandomCancelKey’ from ‘StartAutovacuumWorker’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5462:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5470:34: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5470:34: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5471:20: branch_true: following ‘true’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5473:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5480:35: throw: if ‘StartAutoVacWorker’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5480:35: danger: ‘bn’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
# 5478| bn->bgworker_notify = false;
# 5479|
# 5480|-> bn->pid = StartAutoVacWorker();
# 5481| if (bn->pid > 0)
# 5482| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5496:32: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5443:1: enter_function: entry to ‘StartAutovacuumWorker’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5454:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5462:22: call_function: inlined call to ‘RandomCancelKey’ from ‘StartAutovacuumWorker’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5462:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5470:34: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5470:34: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5471:20: branch_true: following ‘true’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5473:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5481:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5496:32: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5496:32: throw: if ‘ReleasePostmasterChildSlot’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5496:32: danger: ‘bn’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
# 5494| * logged by StartAutoVacWorker
# 5495| */
# 5496|-> (void) ReleasePostmasterChildSlot(bn->child_slot);
# 5497| free(bn);
# 5498| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5878:42: warning[-Wanalyzer-malloc-leak]: leak of ‘bn’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5837:1: enter_function: entry to ‘assign_backendlist_entry’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5846:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5860:14: call_function: inlined call to ‘RandomCancelKey’ from ‘assign_backendlist_entry’
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5860:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5868:14: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5868:14: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5869:12: branch_false: following ‘false’ branch (when ‘bn’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5877:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5878:42: throw: if ‘AssignPostmasterChildSlot’ throws an exception...
postgresql-18.1/postgresql-16.11/src/backend/postmaster/postmaster.c:5878:42: danger: ‘bn’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 5876|
# 5877| bn->cancel_key = MyCancelKey;
# 5878|-> bn->child_slot = MyPMChildSlot = AssignPostmasterChildSlot();
# 5879| bn->bkend_type = BACKEND_TYPE_BGWORKER;
# 5880| bn->dead_end = false;
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/postgresql-16.11/src/backend/replication/logical/reorderbuffer.c:3791:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘txn’
postgresql-18.1/postgresql-16.11/src/backend/replication/logical/reorderbuffer.c:3712:1: enter_function: entry to ‘ReorderBufferCheckMemoryLimit’
postgresql-18.1/postgresql-16.11/src/backend/replication/logical/reorderbuffer.c:3758:31: call_function: calling ‘ReorderBufferLargestTXN’ from ‘ReorderBufferCheckMemoryLimit’
postgresql-18.1/postgresql-16.11/src/backend/replication/logical/reorderbuffer.c:3758:31: return_function: returning to ‘ReorderBufferCheckMemoryLimit’ from ‘ReorderBufferLargestTXN’
postgresql-18.1/postgresql-16.11/src/backend/replication/logical/reorderbuffer.c:3765:25: call_function: calling ‘ReorderBufferSerializeTXN’ from ‘ReorderBufferCheckMemoryLimit’
# 3789| XLogSegNo curOpenSegNo = 0;
# 3790| Size spilled = 0;
# 3791|-> Size size = txn->size;
# 3792|
# 3793| elog(DEBUG2, "spill %u changes in XID %u to disk",
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/replication/repl_scanner.c:2173:32: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-16.11/src/backend/replication/repl_scanner.c:2159:17: enter_function: entry to ‘replication_yy_scan_buffer’
postgresql-18.1/postgresql-16.11/src/backend/replication/repl_scanner.c:2169:31: call_function: inlined call to ‘replication_yyalloc’ from ‘replication_yy_scan_buffer’
postgresql-18.1/postgresql-16.11/src/backend/replication/repl_scanner.c:2170:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/replication/repl_scanner.c:2173:32: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/replication/repl_scanner.c:2183:9: call_function: calling ‘replication_yy_switch_to_buffer’ from ‘replication_yy_scan_buffer’
# 2171| YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
# 2172|
# 2173|-> b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
# 2174| b->yy_buf_pos = b->yy_ch_buf = base;
# 2175| b->yy_is_our_buffer = 0;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/replication/syncrep_scanner.c:1848:32: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-16.11/src/backend/replication/syncrep_scanner.c:1834:17: enter_function: entry to ‘syncrep_yy_scan_buffer’
postgresql-18.1/postgresql-16.11/src/backend/replication/syncrep_scanner.c:1844:31: call_function: inlined call to ‘syncrep_yyalloc’ from ‘syncrep_yy_scan_buffer’
postgresql-18.1/postgresql-16.11/src/backend/replication/syncrep_scanner.c:1845:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/replication/syncrep_scanner.c:1848:32: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/replication/syncrep_scanner.c:1858:9: call_function: calling ‘syncrep_yy_switch_to_buffer’ from ‘syncrep_yy_scan_buffer’
# 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;
# 1850| b->yy_is_our_buffer = 0;
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-16.11/src/backend/utils/adt/jsonb.c:127: error[legacyUninitvar]: Uninitialized variable: nbytes
# 125| elog(ERROR, "unsupported jsonb version number %d", version);
# 126|
# 127|-> return jsonb_from_cstring(str, nbytes, NULL);
# 128| }
# 129|
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-16.11/src/backend/utils/adt/jsonb.c:127: error[legacyUninitvar]: Uninitialized variable: str
# 125| elog(ERROR, "unsupported jsonb version number %d", version);
# 126|
# 127|-> return jsonb_from_cstring(str, nbytes, NULL);
# 128| }
# 129|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.c:1630:54: warning[-Wanalyzer-malloc-leak]: leak of ‘GUC_yy_create_buffer(fp, 16384)’
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:573:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:586:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:586:12: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:593:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:595:47: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:595:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 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 )
# 1632| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.c:1630:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:573:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:586:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:586:12: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:593:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:595:47: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/misc/guc-file.l:595:22: call_function: calling ‘ParseConfigFile’ from ‘ParseConfigDirectory’
# 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 )
# 1632| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:991:1: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:699:1: enter_function: entry to ‘AllocSetAlloc’
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:714:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:790:16: call_function: inlined call to ‘AllocSetFreeIndex’ from ‘AllocSetAlloc’
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:792:12: branch_false: following ‘false’ branch (when ‘chunk’ is NULL)...
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:830:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:930:24: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:932:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:933:28: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:935:46: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:935:46: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:930:24: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:932:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:938:20: branch_true: following ‘true’ branch (when ‘block’ is NULL)...
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:938:20: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:991:1: danger: ‘block’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
# 989|
# 990| return MemoryChunkGetPointer(chunk);
# 991|-> }
# 992|
# 993| /*
Error: CPPCHECK_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/backend/utils/mmgr/aset.c:1159: error[memleakOnRealloc]: Common realloc mistake: 'block' nulled but not freed upon failure
# 1157| oldblksize = block->endptr - ((char *) block);
# 1158|
# 1159|-> block = (AllocBlock) realloc(block, blksize);
# 1160| if (block == NULL)
# 1161| {
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:190:32: warning[-Wanalyzer-file-leak]: leak of FILE ‘*<unknown>.tarFH’
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:166:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:168:21: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:168:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:170:38: acquire_resource: opened here
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:171:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:182:17: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:190:32: danger: ‘*<unknown>.tarFH’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 188| /* setvbuf(ctx->tarFH, NULL, _IONBF, 0); */
# 189|
# 190|-> ctx->hasSeek = checkSeek(ctx->tarFH);
# 191|
# 192| /*
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:224:32: warning[-Wanalyzer-file-leak]: leak of FILE ‘*<unknown>.tarFH’
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:166:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:202:21: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:202:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:204:38: acquire_resource: opened here
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:205:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:222:17: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/bin/pg_dump/pg_backup_tar.c:224:32: danger: ‘*<unknown>.tarFH’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 222| ctx->tarFHpos = 0;
# 223|
# 224|-> ctx->hasSeek = checkSeek(ctx->tarFH);
# 225|
# 226| ctx->FH = (void *) tarOpen(AH, "toc.dat", 'r');
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-16.11/src/bin/pg_upgrade/version.c:120:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-16.11/src/bin/pg_upgrade/version.c:153:1: enter_function: entry to ‘check_for_data_type_usage’
postgresql-18.1/postgresql-16.11/src/bin/pg_upgrade/version.c:163:17: call_function: calling ‘check_for_data_types_usage’ from ‘check_for_data_type_usage’
# 118| if (!db_used)
# 119| {
# 120|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 121| db_used = true;
# 122| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/common/exec.c:380:25: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:22: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:376:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:377:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:379:21: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:379:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:380:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:380:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-16.11/src/common/exec.c:380:25: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 378| {
# 379| if (feof(pgver))
# 380|-> fprintf(stderr, "no data was returned by command \"%s\"\n", cmd);
# 381| else
# 382| perror("fgets failure");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/common/exec.c:382:25: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:22: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:376:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:377:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:379:21: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:379:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:382:25: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:382:25: throw: if ‘perror’ throws an exception...
postgresql-18.1/postgresql-16.11/src/common/exec.c:382:25: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 380| fprintf(stderr, "no data was returned by command \"%s\"\n", cmd);
# 381| else
# 382|-> perror("fgets failure");
# 383| pclose(pgver); /* no error checking */
# 384| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/common/exec.c:383:17: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:22: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:376:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:377:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:379:21: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:383:17: danger: ‘popen(cmd, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 381| else
# 382| perror("fgets failure");
# 383|-> pclose(pgver); /* no error checking */
# 384| return NULL;
# 385| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/common/exec.c:405:12: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "r")’
postgresql-18.1/postgresql-16.11/src/common/exec.c:363:1: enter_function: entry to ‘pipe_read_line’
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:22: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/common/exec.c:370:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:376:9: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:377:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/exec.c:387:13: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/exec.c:387:13: call_function: calling ‘pclose_check’ from ‘pipe_read_line’
# 403| exitstatus = pclose(stream);
# 404|
# 405|-> if (exitstatus == 0)
# 406| return 0; /* all is well */
# 407|
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:521:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘iov’
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:541:1: enter_function: entry to ‘pg_pwrite_zeros’
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:550:16: branch_true: following ‘true’ branch (when ‘remaining_size != 0’)...
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:550:16: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:555:24: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:559:25: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:555:24: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:570:27: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/file_utils.c:570:27: call_function: calling ‘pg_pwritev_with_retry’ from ‘pg_pwrite_zeros’
# 519| */
# 520| Assert(iovcnt > 0);
# 521|-> memmove(iov_copy, iov, sizeof(*iov) * iovcnt);
# 522| Assert(iov->iov_len > part);
# 523| iov_copy[0].iov_base = (char *) iov_copy[0].iov_base + part;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1095:34: warning[-Wanalyzer-malloc-leak]: leak of ‘input_chars’
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1069:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1082:22: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1083:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1085:13: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1085:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1088:23: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1088:23: acquire_memory: allocated here
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1089:12: branch_false: following ‘false’ branch (when ‘input_chars’ is non-NULL)...
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1089:12: branch_false: ...to here
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1093:21: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1095:28: branch_true: ...to here
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1095:34: throw: if ‘utf8_to_unicode’ throws an exception...
postgresql-18.1/postgresql-16.11/src/common/saslprep.c:1095:34: danger: ‘input_chars’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1093| for (i = 0; i < input_size; i++)
# 1094| {
# 1095|-> input_chars[i] = utf8_to_unicode(p);
# 1096| p += pg_utf_mblen(p);
# 1097| }
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/btree_gist/btree_utils_num.c:90:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘leaf’
postgresql-18.1/postgresql-17.7/contrib/btree_gist/btree_utils_num.c:18:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/btree_gist/btree_utils_num.c:34:56: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:971:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:929:6: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:935:28: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:958:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:960:7: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:969:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/cube/cubeparse.c:971:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:692: error[legacyUninitvar]: Uninitialized variable: conn
# 690|
# 691| /* async query send */
# 692|-> retval = PQsendQuery(conn, sql);
# 693| if (retval != 1)
# 694| elog(NOTICE, "could not send query: %s", pchomp(PQerrorMessage(conn)));
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:692: error[legacyUninitvar]: Uninitialized variable: sql
# 690|
# 691| /* async query send */
# 692|-> retval = PQsendQuery(conn, sql);
# 693| if (retval != 1)
# 694| elog(NOTICE, "could not send query: %s", pchomp(PQerrorMessage(conn)));
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:2773:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:2713:1: enter_function: entry to ‘dblink_res_error’
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:2772:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:2773:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/contrib/dblink/dblink.c:2773:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 2771| */
# 2772| va_start(ap, fmt);
# 2773|-> vsnprintf(dblink_context_msg, sizeof(dblink_context_msg), fmt, ap);
# 2774| va_end(ap);
# 2775|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:341:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:292:1: enter_function: entry to ‘hstore_delete_array’
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:307:33: call_function: calling ‘hstoreArrayToPairs’ from ‘hstore_delete_array’
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:307:33: return_function: returning to ‘hstore_delete_array’ from ‘hstoreArrayToPairs’
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:317:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:317:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:331:25: branch_true: following ‘true’ branch (when ‘i < hs_count’)...
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:335:21: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:335:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/hstore/hstore_op.c:339:59: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/ltree/ltree_gist.c:76:17: warning[-Wanalyzer-null-argument]: use of NULL ‘left’ where non-null expected
postgresql-18.1/postgresql-17.7/contrib/ltree/ltree_gist.c:192:1: enter_function: entry to ‘ltree_union’
postgresql-18.1/postgresql-17.7/contrib/ltree/ltree_gist.c:207:21: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/ltree/ltree_gist.c:240:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/ltree/ltree_gist.c:240:12: branch_false: following ‘false’ branch (when ‘isalltrue == 0’)...
postgresql-18.1/postgresql-17.7/contrib/ltree/ltree_gist.c:240:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/pg_trgm/trgm_regexp.c:1999:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/postgresql-17.7/contrib/pg_trgm/trgm_regexp.c:1969:16: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/pg_trgm/trgm_regexp.c:1969:16: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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-457):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/pgcrypto/px.c:158:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/contrib/pgcrypto/px.c:153:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/contrib/pgcrypto/px.c:154:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/pgcrypto/px.c:158:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/pgcrypto/px.c:158:17: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/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-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:1412: 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
# 1410| * Items in the list must match order in enum FdwScanPrivateIndex.
# 1411| */
# 1412|-> fdw_private = list_make3(makeString(sql.data),
# 1413| retrieved_attrs,
# 1414| makeInteger(fpinfo->fetch_size));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:1412: 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
# 1410| * Items in the list must match order in enum FdwScanPrivateIndex.
# 1411| */
# 1412|-> fdw_private = list_make3(makeString(sql.data),
# 1413| retrieved_attrs,
# 1414| makeInteger(fpinfo->fetch_size));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:1900: 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
# 1898| * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1899| */
# 1900|-> return list_make5(makeString(sql.data),
# 1901| targetAttrs,
# 1902| makeInteger(values_end_len),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:1900: 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
# 1898| * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1899| */
# 1900|-> return list_make5(makeString(sql.data),
# 1901| targetAttrs,
# 1902| makeInteger(values_end_len),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:1900: 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
# 1898| * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1899| */
# 1900|-> return list_make5(makeString(sql.data),
# 1901| targetAttrs,
# 1902| makeInteger(values_end_len),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:1900: 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
# 1898| * Items in the list must match enum FdwModifyPrivateIndex, above.
# 1899| */
# 1900|-> return list_make5(makeString(sql.data),
# 1901| targetAttrs,
# 1902| makeInteger(values_end_len),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:2609: 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
# 2607| * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2608| */
# 2609|-> fscan->fdw_private = list_make4(makeString(sql.data),
# 2610| makeBoolean((retrieved_attrs != NIL)),
# 2611| retrieved_attrs,
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:2609: 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
# 2607| * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2608| */
# 2609|-> fscan->fdw_private = list_make4(makeString(sql.data),
# 2610| makeBoolean((retrieved_attrs != NIL)),
# 2611| retrieved_attrs,
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:2609: 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
# 2607| * Items in the list must match enum FdwDirectModifyPrivateIndex, above.
# 2608| */
# 2609|-> fscan->fdw_private = list_make4(makeString(sql.data),
# 2610| makeBoolean((retrieved_attrs != NIL)),
# 2611| retrieved_attrs,
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:6985: 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
# 6983| * Items in the list must match order in enum FdwPathPrivateIndex.
# 6984| */
# 6985|-> fdw_private = list_make2(makeBoolean(true), makeBoolean(false));
# 6986|
# 6987| /* Create foreign ordering path */
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:7234: 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
# 7232| * Items in the list must match order in enum FdwPathPrivateIndex.
# 7233| */
# 7234|-> fdw_private = list_make2(makeBoolean(has_final_sort),
# 7235| makeBoolean(extra->limit_needed));
# 7236|
Error: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/contrib/postgres_fdw/postgres_fdw.c:7601: warning[nullPointer]: Possible null pointer dereference: fsstate
# 7599| {
# 7600| Assert(fsstate);
# 7601|-> tupdesc = fsstate->ss.ss_ScanTupleSlot->tts_tupleDescriptor;
# 7602| }
# 7603|
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:971:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:929:6: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:935:28: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:958:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:960:7: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:969:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/seg/segparse.c:971:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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-476):
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:160:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argtypes’
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:75:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:80:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:85:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:101:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:105:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:111:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:119:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:129:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:133:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:133:21: branch_true: following ‘true’ branch (when ‘i < nkeys’)...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:136:76: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:139:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:146:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:153:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:159:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:159:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:160:33: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:407:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argtypes’
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:275:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:280:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:285:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:285:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:290:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:297:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:299:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:306:12: branch_false: following ‘false’ branch (when ‘nargs > 4’)...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:311:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:312:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:315:18: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:322:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:331:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:339:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:349:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:355:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:355:17: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:361:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:361:21: branch_true: following ‘true’ branch (when ‘i < nkeys’)...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:364:76: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:367:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:374:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:381:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:392:20: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:392:20: branch_true: following ‘true’ branch (when ‘newtuple’ is non-NULL)...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:394:46: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:398:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:401:34: branch_false: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:402:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:406:21: branch_true: ...to here
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:406:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/contrib/spi/refint.c:407:33: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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-476):
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10056:63: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘<unknown>’
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:9930:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:9971:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10002:12: branch_true: following ‘true’ branch (when ‘newaction == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10009:27: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10015:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10018:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10018:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10021:25: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10024:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10031:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10045:20: branch_true: following ‘true’ branch (when ‘prefixlen != 0’)...
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10050:31: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/access/heap/heapam.c:10056:63: danger: dereference of NULL ‘oldtup.t_data’
#10054|
#10055| /* copy prefix from old tuple */
#10056|-> memcpy(newp, (char *) oldtup.t_data + oldtup.t_data->t_hoff, prefixlen);
#10057| newp += prefixlen;
#10058|
Error: GCC_ANALYZER_WARNING (CWE-688):
postgresql-18.1/postgresql-17.7/src/backend/access/transam/xact.c:6051:76: warning[-Wanalyzer-null-argument]: use of NULL ‘twophase_gid’ where non-null expected
postgresql-18.1/postgresql-17.7/src/backend/access/transam/xact.c:5162:1: enter_function: entry to ‘AbortSubTransaction’
postgresql-18.1/postgresql-17.7/src/backend/access/transam/xact.c:5219:9: call_function: calling ‘ShowTransactionState’ from ‘AbortSubTransaction’
postgresql-18.1/postgresql-17.7/src/backend/access/transam/xact.c:5219:9: return_function: returning to ‘AbortSubTransaction’ from ‘ShowTransactionState’
postgresql-18.1/postgresql-17.7/src/backend/access/transam/xact.c:5255:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/access/transam/xact.c:5257:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:1981:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:1967:17: enter_function: entry to ‘boot_yy_scan_buffer’
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:1977:24: call_function: inlined call to ‘boot_yyalloc’ from ‘boot_yy_scan_buffer’
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:1978:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:1981:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:2033:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:2017:17: enter_function: entry to ‘boot_yy_scan_bytes’
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:2026:24: call_function: inlined call to ‘boot_yyalloc’ from ‘boot_yy_scan_bytes’
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:2027:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/bootstrap/bootscanner.c:2027:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:600:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisdata’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:280:1: enter_function: entry to ‘do_analyze_rel’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:401:29: branch_false: following ‘false’ branch (when ‘i > attr_cnt’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:419:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:419:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:428:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:428:17: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:430:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:440:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:21: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:494:23: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:510:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:519:9: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:519:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:522:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:527:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:537:12: branch_true: following ‘true’ branch (when ‘numrows > 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:542:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:550:29: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:579:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:579:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:585:17: call_function: inlined call to ‘MemoryContextSwitchTo’ from ‘do_analyze_rel’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:593:17: call_function: inlined call to ‘update_attstats’ from ‘do_analyze_rel’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:596:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:596:31: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:598:60: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:653:47: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisdata’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:401:29: branch_false: following ‘false’ branch (when ‘i > attr_cnt’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:419:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:419:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:428:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:428:17: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:430:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:440:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:21: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:494:23: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:510:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:519:9: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:519:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:522:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:527:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:623:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:627:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:648:31: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:650:60: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:848:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisdata’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:280:1: enter_function: entry to ‘do_analyze_rel’
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:401:29: branch_false: following ‘false’ branch (when ‘i > attr_cnt’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:419:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:419:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:428:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:428:17: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:430:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:440:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:21: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:489:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:494:23: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:510:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:519:9: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:519:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:522:12: branch_false: following ‘false’ branch (when ‘inh == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:527:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:537:12: branch_true: following ‘true’ branch (when ‘numrows > 0’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:542:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:550:29: branch_false: following ‘false’ branch (when ‘attr_cnt <= i’)...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:579:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:579:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/commands/analyze.c:580:25: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/commands/tablecmds.c:12667: error[legacyUninitvar]: Uninitialized variable: contype
#12665| * the dependency mechanism, so we're done here.
#12666| */
#12667|-> if (contype != CONSTRAINT_CHECK &&
#12668| rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
#12669| {
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:196:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(get_user_name_or_exit(progname))’
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:147:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:152:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:185:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:185:25: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:185:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:187:30: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:187:18: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:193:30: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:193:18: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:195:30: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:195:18: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:197:60: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:197:60: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/main/main.c:196: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)
# 194| GucInfoMain();
# 195| else if (argc > 1 && strcmp(argv[1], "--single") == 0)
# 196|-> PostgresSingleUserMain(argc, argv,
# 197| strdup(get_user_name_or_exit(progname)));
# 198| else
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2212:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2198:17: enter_function: entry to ‘replication_yy_scan_buffer’
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2208:24: call_function: inlined call to ‘replication_yyalloc’ from ‘replication_yy_scan_buffer’
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2209:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2212:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2264:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2248:17: enter_function: entry to ‘replication_yy_scan_bytes’
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2257:24: call_function: inlined call to ‘replication_yyalloc’ from ‘replication_yy_scan_bytes’
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2258:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/replication/repl_scanner.c:2258:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1847:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1833:17: enter_function: entry to ‘syncrep_yy_scan_buffer’
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1843:24: call_function: inlined call to ‘syncrep_yyalloc’ from ‘syncrep_yy_scan_buffer’
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1844:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1847:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1899:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1883:17: enter_function: entry to ‘syncrep_yy_scan_bytes’
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1892:24: call_function: inlined call to ‘syncrep_yyalloc’ from ‘syncrep_yy_scan_bytes’
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1893:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/replication/syncrep_scanner.c:1893:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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: GCC_ANALYZER_WARNING (CWE-126):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:9330:30: warning[-Wanalyzer-out-of-bounds]: buffer over-read
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11109:1: enter_function: entry to ‘power_var_int’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11153:12: branch_false: following ‘false’ branch (when ‘f <= 1.31072e+5’)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11157:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11157:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11169:43: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11204:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11229:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11247:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11248:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11252:16: branch_false: following ‘false’ branch (when ‘mask == 0’)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11298:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11298:9: call_function: calling ‘free_var’ from ‘power_var_int’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11298:9: return_function: returning to ‘power_var_int’ from ‘free_var’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11301:12: branch_true: following ‘true’ branch (when ‘neg != 0’)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11302:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/numeric.c:11302:17: call_function: calling ‘div_var_fast’ from ‘power_var_int’
# 9328| load_ndigits = Min(div_ndigits, var1ndigits);
# 9329| for (i = 0; i < load_ndigits; i++)
# 9330|-> div[i + 1] = var1digits[i];
# 9331|
# 9332| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:672:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:674:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:686:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:643:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:628:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:630:30: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:642:37: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:644:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:646:34: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:645:39: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:648:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:647:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:560:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:564:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:582:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:586:12: branch_false: following ‘false’ branch (when ‘save_lc_monetary’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:588:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:591:12: branch_false: following ‘false’ branch (when ‘save_lc_numeric’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:593:27: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:629:35: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:671:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:673:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: setjmp: ‘sigsetjmp’ called here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:681:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/adt/pg_locale.c:687:17: throw: if ‘pfree’ throws an exception...
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/backend/utils/misc/guc-file.l:384:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18.1/postgresql-17.7/src/backend/utils/misc/guc-file.l:573:1: enter_function: entry to ‘ParseConfigDirectory’
postgresql-18.1/postgresql-17.7/src/backend/utils/misc/guc-file.l:586:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/misc/guc-file.l:586:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/backend/utils/misc/guc-file.l:593:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/utils/misc/guc-file.l:595:47: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_file.c:364:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_file.c:359:16: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_file.c:360:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_file.c:364:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:91:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:100:46: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:100:46: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:102:20: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_basebackup/bbstreamer_gzip.c:105:36: throw: if ‘gzdopen’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:500:49: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:362:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:364:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:367:40: branch_true: following ‘true’ branch (when ‘n_data_types_usage_checks > checknum’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:377:66: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:471:36: branch_false: following ‘false’ branch (when ‘found == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:472:41: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:495:44: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:495:73: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:495:73: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:495:45: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:498:44: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:498:44: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:500:49: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:500:49: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:500:49: danger: ‘script’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 498| if (!db_used)
# 499| {
# 500|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 501| db_used = true;
# 502| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1262:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1222:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1230:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1234:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1242:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1258:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1258:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1258:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1258:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1260:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1260:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1262:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1262:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1262:33: danger: ‘script’ leaks here; was opened at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1260| if (!db_used)
# 1261| {
# 1262|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1263| db_used = true;
# 1264| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1356:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1308:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1319:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1351:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1352:43: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1352:43: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1351:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1354:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1354:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1356:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1356:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1356:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 1354| if (!db_used)
# 1355| {
# 1356|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1357| db_used = true;
# 1358| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1484:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1426:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1429:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1479:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1480:43: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1480:43: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1479:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1482:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1482:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1484:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1484:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1484:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 1482| if (!db_used)
# 1483| {
# 1484|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1485| db_used = true;
# 1486| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1560:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1532:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1540:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1556:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1556:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1556:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1556:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1558:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1558:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1560:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1560:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1560:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 1558| if (!db_used)
# 1559| {
# 1560|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1561| db_used = true;
# 1562| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1637:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1607:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1614:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1633:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1633:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1633:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1633:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1635:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1635:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1637:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1637:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1637:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 1635| if (!db_used)
# 1636| {
# 1637|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1638| db_used = true;
# 1639| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1741:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1750:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1771:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1772:43: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1772:43: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1771:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1774:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1774:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/4)
# 1774| if (!db_used)
# 1775| {
# 1776|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1777| db_used = true;
# 1778| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: warning[-Wanalyzer-malloc-leak]: leak of ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1741:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1750:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1771:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1772:43: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1772:43: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1771:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1774:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1774:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/check.c:1776:33: danger: ‘script’ leaks here; was allocated at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
# 1774| if (!db_used)
# 1775| {
# 1776|-> fprintf(script, "In database: %s\n", active_db->db_name);
# 1777| db_used = true;
# 1778| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18.1/postgresql-17.7/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-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:183:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:183:33: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18.1/postgresql-17.7/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-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:185:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:185:33: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18.1/postgresql-17.7/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-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:188:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:188:25: throw: if ‘quote_identifier’ throws an exception...
postgresql-18.1/postgresql-17.7/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-775):
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:189:58: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:155:25: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:162:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:28: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:57: acquire_resource: opened here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:176:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:178:28: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:182:33: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/bin/pg_upgrade/version.c:189:58: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/common/cryptohash_openssl.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18.1/postgresql-17.7/src/common/cryptohash_openssl.c:135:15: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/common/cryptohash_openssl.c:136:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/common/cryptohash_openssl.c:136:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/common/cryptohash_openssl.c:148:9: throw: if ‘ERR_clear_error’ throws an exception...
postgresql-18.1/postgresql-17.7/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: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:141:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:126:15: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:127:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:129:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:141:9: throw: if ‘ERR_clear_error’ throws an exception...
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:141:9: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 139| * previous runs.
# 140| */
# 141|-> ERR_clear_error();
# 142|
# 143| #ifdef USE_RESOWNER_FOR_HMAC
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:148:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:126:15: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:127:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:129:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:148:24: throw: if ‘HMAC_CTX_new’ throws an exception...
postgresql-18.1/postgresql-17.7/src/common/hmac_openssl.c:148:24: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 146|
# 147| #ifdef HAVE_HMAC_CTX_NEW
# 148|-> ctx->hmacctx = HMAC_CTX_new();
# 149| #else
# 150| ctx->hmacctx = ALLOC(sizeof(HMAC_CTX));
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/src/include/storage/bufpage.h:340:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘childpage’
postgresql-18.1/postgresql-17.7/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18.1/postgresql-17.7/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:166:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:158:1: enter_function: entry to ‘ECPGsetcommit’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:160:34: call_function: calling ‘ecpg_get_connection’ from ‘ECPGsetcommit’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:160:34: return_function: returning to ‘ECPGsetcommit’ from ‘ecpg_get_connection’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:163:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:166:9: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/connect.c:166:9: danger: dereference of NULL ‘ecpg_get_connection(connection_name)’
# 164| return false;
# 165|
# 166|-> ecpg_log("ECPGsetcommit on line %d: action \"%s\"; connection \"%s\"\n", lineno, mode, con->name);
# 167|
# 168| if (con->autocommit && strncmp(mode, "off", strlen("off")) == 0)
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:42:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:143:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:219:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:252:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:252:9: throw: if ‘ecpg_init_sqlca’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: throw: if ‘PQntuples’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch (when ‘index > 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:34: throw: if ‘PQnfields’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:264:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:264:17: throw: if ‘ecpg_raise’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:269:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:269:9: throw: if ‘ecpg_log’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: throw: if ‘PQfname’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: call_function: calling ‘get_char_item’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:322:38: return_function: returning to ‘ECPGget_desc’ from ‘get_char_item’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:322:36: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:328:33: throw: if ‘ecpg_log’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:350:74: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:350:74: throw: if ‘PQfmod’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:360:73: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:360:73: throw: if ‘PQfmod’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:370:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:370:38: throw: if ‘PQfsize’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:380:73: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:380:73: throw: if ‘PQfmod’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:390:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:390:38: throw: if ‘PQftype’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:400:73: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:400:73: throw: if ‘PQftype’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:410:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:410:38: throw: if ‘PQntuples’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:429:41: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:422:33: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:429:41: throw: if ‘ecpg_log’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:431:41: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:422:33: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:431:41: throw: if ‘ecpg_raise’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:438:68: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:422:33: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:427:36: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:436:36: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:438:68: throw: if ‘ecpg_auto_alloc’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:462:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:462:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:463:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:253:22: call_function: inlined call to ‘ecpg_result_by_descriptor’ from ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:254:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:260:19: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:262:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:278:16: branch_true: following ‘true’ branch (when ‘type != 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:287:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:463:33: throw: if ‘ecpg_raise’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:720:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:605:1: enter_function: entry to ‘ECPGset_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:612:16: call_function: calling ‘ecpg_find_desc’ from ‘ECPGset_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:612:16: return_function: returning to ‘ECPGset_desc’ from ‘ecpg_find_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:613:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:616:14: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:634:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:637:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:637:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:646:20: branch_true: following ‘true’ branch (when ‘itemtype == 16’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:724:1: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:720:9: throw: if ‘ecpg_free’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:842:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:234:1: enter_function: entry to ‘ECPGget_desc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:244:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:251:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:912:47: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:912:47: throw: if ‘PQdescribePrepared’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:913:46: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:913:46: throw: if ‘ecpg_check_PQresult’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:916:41: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:916:41: throw: if ‘PQclear’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:929:55: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:929:55: throw: if ‘PQdescribePrepared’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:930:54: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:930:54: throw: if ‘ecpg_check_PQresult’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:933:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:933:57: throw: if ‘ecpg_build_compat_sqlda’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:934:52: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:950:49: throw: if ‘PQclear’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:957:55: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:957:55: throw: if ‘PQdescribePrepared’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:958:54: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:958:54: throw: if ‘ecpg_check_PQresult’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:961:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:961:57: throw: if ‘ecpg_build_native_sqlda’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:856:12: branch_false: following ‘false’ branch (when ‘input == 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:862:15: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:863:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:869:16: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:870:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:876:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:886:20: branch_false: following ‘false’ branch (when ‘type != 28’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:890:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:962:52: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/descriptor.c:978:49: throw: if ‘PQclear’ throws an exception...
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:1960:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:1964:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:1966:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:1968:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:1971:37: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2277:1: enter_function: entry to ‘ECPGdo’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/execute.c:2282:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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-404):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:271:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:232:1: enter_function: entry to ‘ecpg_log’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:235:33: call_function: calling ‘ECPGget_sqlca’ from ‘ecpg_log’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:235:33: return_function: returning to ‘ecpg_log’ from ‘ECPGget_sqlca’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:245:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:249:23: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:257:12: branch_false: following ‘false’ branch (when ‘fmt’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:260:13: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:268:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:270:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:270:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/ecpglib/misc.c:271:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18.1/postgresql-17.7/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: COMPILER_WARNING (CWE-704):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/pgtypeslib/datetime.c: scope_hint: In function ‘PGTYPESdate_defmt_asc’
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/pgtypeslib/timestamp.c:759:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘replace_val’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/pgtypeslib/timestamp.c:782:1: enter_function: entry to ‘PGTYPEStimestamp_fmt_asc’
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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: CPPCHECK_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/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-457):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39445:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39400:6: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39406:34: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39432:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39434:7: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39443:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39443:12: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39576:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39400:6: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39469:6: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39469:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39472:3: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39484:6: branch_true: following ‘true’ branch (when ‘yyn == -6472’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39485:5: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39556:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.c:39558:3: branch_false: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:116:1: enter_function: entry to ‘mmfatal’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:120:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:84:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:106:1: enter_function: entry to ‘mmerror’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:110:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:87:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:116:1: enter_function: entry to ‘mmfatal’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:120:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:91:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:116:1: enter_function: entry to ‘mmfatal’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:120:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:141:35: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:153:1: enter_function: entry to ‘cat_str’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:159:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:164:21: branch_true: following ‘true’ branch (when ‘i < count’)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/preproc.y:165:27: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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-688):
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:590:50: warning[-Wanalyzer-null-argument]: use of NULL ‘ind_name’ where non-null expected
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:581:1: enter_function: entry to ‘ECPGdump_a_struct’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:589:37: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:589:37: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:590:41: call_function: calling ‘mm_alloc’ from ‘ECPGdump_a_struct’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:590:41: return_function: returning to ‘ECPGdump_a_struct’ from ‘mm_alloc’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:599:12: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:601:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:601:17: branch_true: following ‘true’ branch (when ‘ind_type’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:603:21: call_function: inlined call to ‘atoi’ from ‘ECPGdump_a_struct’
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:603:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:604:25: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:612:35: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: following ‘true’ branch (when ‘ind_p’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/ecpg/preproc/type.c:614:17: branch_true: ...to here
postgresql-18.1/postgresql-17.7/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):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:504:37: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:469:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:473:33: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:483:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:490:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:495:31: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:496:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:501:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:504:37: throw: if ‘pg_b64_enc_len’ throws an exception...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:504:37: danger: ‘cbind_input’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 502| memcpy(cbind_input + cbind_header_len, cbind_data, cbind_data_len);
# 503|
# 504|-> encoded_cbind_len = pg_b64_enc_len(cbind_input_len);
# 505| if (!enlargePQExpBuffer(&buf, encoded_cbind_len))
# 506| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:505:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:469:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:473:33: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:483:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:490:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:495:31: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:496:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:501:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:505:22: throw: if ‘enlargePQExpBuffer’ throws an exception...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:505:22: danger: ‘cbind_input’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 503|
# 504| encoded_cbind_len = pg_b64_enc_len(cbind_input_len);
# 505|-> if (!enlargePQExpBuffer(&buf, encoded_cbind_len))
# 506| {
# 507| free(cbind_data);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:511:37: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:469:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:473:33: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:483:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:490:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:495:31: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:496:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:501:17: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:505:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:512:83: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:511:37: throw: if ‘pg_b64_encode’ throws an exception...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-auth-scram.c:511:37: danger: ‘cbind_input’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 509| goto oom_error;
# 510| }
# 511|-> encoded_cbind_len = pg_b64_encode(cbind_input, cbind_input_len,
# 512| buf.data + buf.len,
# 513| encoded_cbind_len);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:207:44: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:207:44: acquire_memory: allocated here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/postgresql-17.7/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: COMPILER_WARNING:
postgresql-18.1/postgresql-17.7/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:
postgresql-18.1/postgresql-17.7/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:
postgresql-18.1/postgresql-17.7/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: GCC_ANALYZER_WARNING (CWE-688):
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:813:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:721:1: enter_function: entry to ‘brin_range_deserialize’
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:789:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:798:9: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:798:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_true: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_true: following ‘true’ branch (when ‘typlen > 0’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:811:44: call_function: inlined call to ‘PointerGetDatum’ from ‘brin_range_deserialize’
postgresql-18.1/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):
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:822:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:789:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:798:9: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:798:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_true: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: following ‘false’ branch (when ‘typlen <= 0’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:818:25: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:832:25: warning[-Wanalyzer-null-argument]: use of NULL ‘dataptr’ where non-null expected
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:789:12: branch_false: following ‘false’ branch (when ‘datalen == 0’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:798:9: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:798:21: branch_true: following ‘true’ branch (when ‘i < nvalues’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_true: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:800:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:809:25: branch_false: following ‘false’ branch (when ‘typlen <= 0’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:818:25: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:818:25: branch_false: following ‘false’ branch (when ‘typlen != -1’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:826:25: branch_false: ...to here
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:826:25: branch_true: following ‘true’ branch (when ‘typlen == -2’)...
postgresql-18.1/src/backend/access/brin/brin_minmax_multi.c:828:48: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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-688):
postgresql-18.1/src/backend/access/gin/ginbtree.c:576:25: warning[-Wanalyzer-null-argument]: use of NULL ‘newrootpg’ where non-null expected
postgresql-18.1/src/backend/access/gin/ginbtree.c:816:1: enter_function: entry to ‘ginInsertValue’
postgresql-18.1/src/backend/access/gin/ginbtree.c:822:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/gin/ginbtree.c:823:17: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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-688):
postgresql-18.1/src/backend/access/hash/hashpage.c:1531:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
postgresql-18.1/src/backend/access/hash/hashpage.c:1516:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/hash/hashpage.c:1521:21: branch_false: ...to here
postgresql-18.1/src/backend/access/hash/hashpage.c:1529:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/hash/hashpage.c:1530:25: branch_true: ...to here
postgresql-18.1/src/backend/access/hash/hashpage.c:1531:24: release_memory: using NULL here
postgresql-18.1/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):
postgresql-18.1/src/backend/access/hash/hashpage.c:1531:17: warning[-Wanalyzer-null-argument]: use of NULL ‘*rel.rd_amcache’ where non-null expected
postgresql-18.1/src/backend/access/hash/hashpage.c:1559:1: enter_function: entry to ‘_hash_getbucketbuf_from_hashkey’
postgresql-18.1/src/backend/access/hash/hashpage.c:1573:17: call_function: calling ‘_hash_getcachedmetap’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18.1/src/backend/access/hash/hashpage.c:1573:17: return_function: returning to ‘_hash_getbucketbuf_from_hashkey’ from ‘_hash_getcachedmetap’
postgresql-18.1/src/backend/access/hash/hashpage.c:1592:23: call_function: calling ‘_hash_getbuf’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18.1/src/backend/access/hash/hashpage.c:1592:23: return_function: returning to ‘_hash_getbucketbuf_from_hashkey’ from ‘_hash_getbuf’
postgresql-18.1/src/backend/access/hash/hashpage.c:1601:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/hash/hashpage.c:1605:17: call_function: inlined call to ‘_hash_relbuf’ from ‘_hash_getbucketbuf_from_hashkey’
postgresql-18.1/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):
postgresql-18.1/src/backend/access/heap/heapam.c:5909: error[legacyUninitvar]: Uninitialized variable: status
# 5907| }
# 5908|
# 5909|-> result = test_lockmode_for_conflict(status, rawxmax, mode,
# 5910| &mytup, &needwait);
# 5911|
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/src/backend/access/heap/heapam.c:6465: error[legacyUninitvar]: Uninitialized variable: ret
# 6463| * don't bother optimizing that.
# 6464| */
# 6465|-> if (!ret)
# 6466| {
# 6467| UnlockTuple(relation, &oldtup.t_self, InplaceUpdateTupleLock);
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/backend/access/index/amvalidate.c:178:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/access/index/amvalidate.c:152:1: enter_function: entry to ‘check_amproc_signature’
postgresql-18.1/src/backend/access/index/amvalidate.c:162:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/index/amvalidate.c:164:35: call_function: inlined call to ‘GETSTRUCT’ from ‘check_amproc_signature’
postgresql-18.1/src/backend/access/index/amvalidate.c:170:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/backend/access/index/amvalidate.c:171:21: branch_true: following ‘true’ branch (when ‘i < maxargs’)...
postgresql-18.1/src/backend/access/index/amvalidate.c:173:41: branch_true: ...to here
postgresql-18.1/src/backend/access/index/amvalidate.c:178:26: throw: if ‘IsBinaryCoercible’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:1163:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘split’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:934:1: enter_function: entry to ‘_bt_strategy’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:954:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:961:9: branch_true: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:961:9: call_function: calling ‘_bt_interval_edges’ from ‘_bt_strategy’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:961:9: return_function: returning to ‘_bt_strategy’ from ‘_bt_interval_edges’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:962:20: release_memory: ‘leftinterval’ is NULL
postgresql-18.1/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):
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:1179:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘split’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:934:1: enter_function: entry to ‘_bt_strategy’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:954:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:961:9: branch_true: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:961:9: call_function: calling ‘_bt_interval_edges’ from ‘_bt_strategy’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:961:9: return_function: returning to ‘_bt_strategy’ from ‘_bt_interval_edges’
postgresql-18.1/src/backend/access/nbtree/nbtsplitloc.c:963:21: release_memory: ‘rightinterval’ is NULL
postgresql-18.1/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):
postgresql-18.1/src/backend/access/spgist/spgscan.c:123:17: warning[-Wanalyzer-null-argument]: use of NULL ‘distances’ where non-null expected
postgresql-18.1/src/backend/access/spgist/spgscan.c:942:1: enter_function: entry to ‘spggetbitmap’
postgresql-18.1/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):
postgresql-18.1/src/backend/access/spgist/spgutils.c:803:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/access/spgist/spgutils.c:1002:1: enter_function: entry to ‘spgFormInnerTuple’
postgresql-18.1/src/backend/access/spgist/spgutils.c:1045:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: ...to here
postgresql-18.1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: following ‘false’ branch (when ‘nNodes <= 8191’)...
postgresql-18.1/src/backend/access/spgist/spgutils.c:1051:34: branch_false: ...to here
postgresql-18.1/src/backend/access/spgist/spgutils.c:1057:12: branch_true: following ‘true’ branch (when ‘hasPrefix != 0’)...
postgresql-18.1/src/backend/access/spgist/spgutils.c:1058:17: branch_true: ...to here
postgresql-18.1/src/backend/access/spgist/spgutils.c:1058:17: branch_false: following ‘false’ branch...
postgresql-18.1/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):
postgresql-18.1/src/backend/access/spgist/spgutils.c:808:17: warning[-Wanalyzer-null-argument]: use of NULL ‘target’ where non-null expected
postgresql-18.1/src/backend/access/spgist/spgutils.c:1002:1: enter_function: entry to ‘spgFormInnerTuple’
postgresql-18.1/src/backend/access/spgist/spgutils.c:1045:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: ...to here
postgresql-18.1/src/backend/access/spgist/spgutils.c:1045:13: branch_false: following ‘false’ branch (when ‘nNodes <= 8191’)...
postgresql-18.1/src/backend/access/spgist/spgutils.c:1051:34: branch_false: ...to here
postgresql-18.1/src/backend/access/spgist/spgutils.c:1057:12: branch_true: following ‘true’ branch (when ‘hasPrefix != 0’)...
postgresql-18.1/src/backend/access/spgist/spgutils.c:1058:17: branch_true: ...to here
postgresql-18.1/src/backend/access/spgist/spgutils.c:1058:17: branch_false: following ‘false’ branch...
postgresql-18.1/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-476):
postgresql-18.1/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):
postgresql-18.1/src/backend/access/transam/xlog.c:1652: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 1650| Assert(((XLogPageHeader) cachedPos)->xlp_magic == XLOG_PAGE_MAGIC);
# 1651| Assert(((XLogPageHeader) cachedPos)->xlp_pageaddr == ptr - (ptr % XLOG_BLCKSZ));
# 1652|-> return cachedPos + ptr % XLOG_BLCKSZ;
# 1653| }
# 1654|
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/backend/access/transam/xlogreader.c:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/access/transam/xlogreader.c:78:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/backend/access/transam/xlogreader.c:79:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/backend/bootstrap/bootparse.c:1150:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/backend/bootstrap/bootparse.c:1108:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/bootstrap/bootparse.c:1114:28: branch_true: ...to here
postgresql-18.1/src/backend/bootstrap/bootparse.c:1137:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/backend/bootstrap/bootparse.c:1139:7: branch_false: ...to here
postgresql-18.1/src/backend/bootstrap/bootparse.c:1148:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/bootstrap/bootparse.c:1150:9: branch_false: ...to here
postgresql-18.1/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-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/catalog/partition.c:288:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partexprs_item’
postgresql-18.1/src/backend/catalog/partition.c:255:1: enter_function: entry to ‘has_partition_attrs’
postgresql-18.1/src/backend/catalog/partition.c:263:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/catalog/partition.c:270:26: call_function: inlined call to ‘list_head’ from ‘has_partition_attrs’
postgresql-18.1/src/backend/catalog/partition.c:271:9: branch_false: ...to here
postgresql-18.1/src/backend/catalog/partition.c:271:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/catalog/partition.c:273:45: call_function: inlined call to ‘get_partition_col_attnum’ from ‘has_partition_attrs’
postgresql-18.1/src/backend/catalog/partition.c:275:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/catalog/partition.c:288:37: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/catalog/pg_type.c: scope_hint: In function ‘makeMultirangeTypeName’
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/commands/copy.c:339:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18.1/src/backend/commands/copy.c:62:1: enter_function: entry to ‘DoCopy’
postgresql-18.1/src/backend/commands/copy.c:112:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/commands/copy.c:323:25: call_function: inlined call to ‘newNode’ from ‘DoCopy’
postgresql-18.1/src/backend/commands/copy.c:332:12: branch_true: following ‘true’ branch (when ‘is_from != 0’)...
postgresql-18.1/src/backend/commands/copy.c:339:21: branch_true: ...to here
postgresql-18.1/src/backend/commands/copy.c:339:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/commands/copy.c:339:38: branch_true: ...to here
postgresql-18.1/src/backend/commands/copy.c:339:38: danger: dereference of NULL ‘rel’
# 337|
# 338| /* check read-only transaction and parallel mode */
# 339|-> if (XactReadOnly && !rel->rd_islocaltemp)
# 340| PreventCommandIfReadOnly("COPY FROM");
# 341|
Error: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/commands/extension.c:3389: warning[nullPointer]: Possible null pointer dereference: versionName
# 3387| * If we're already at that version, just say so
# 3388| */
# 3389|-> if (strcmp(oldVersionName, versionName) == 0)
# 3390| {
# 3391| ereport(NOTICE,
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/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-768):
postgresql-18.1/src/backend/commands/tablecmds.c:15851: 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
#15849| cmd->objtype = OBJECT_TABCONSTRAINT;
#15850| cmd->object = (Node *)
#15851|-> list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
#15852| makeString(pstrdup(RelationGetRelationName(rel))),
#15853| makeString(pstrdup(conname)));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/commands/tablecmds.c:15851: 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
#15849| cmd->objtype = OBJECT_TABCONSTRAINT;
#15850| cmd->object = (Node *)
#15851|-> list_make3(makeString(get_namespace_name(RelationGetNamespace(rel))),
#15852| makeString(pstrdup(RelationGetRelationName(rel))),
#15853| makeString(pstrdup(conname)));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/commands/tablecmds.c:15859: 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
#15857| cmd->objtype = OBJECT_DOMCONSTRAINT;
#15858| cmd->object = (Node *)
#15859|-> list_make2(makeTypeNameFromNameList(copyObject(domname)),
#15860| makeString(pstrdup(conname)));
#15861| }
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/executor/execJunk.c:176:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘t’
postgresql-18.1/src/backend/executor/execJunk.c:137:1: enter_function: entry to ‘ExecInitJunkFilterConversion’
postgresql-18.1/src/backend/executor/execJunk.c:166:12: branch_true: following ‘true’ branch (when ‘cleanLength > 0’)...
postgresql-18.1/src/backend/executor/execJunk.c:168:43: branch_true: ...to here
postgresql-18.1/src/backend/executor/execJunk.c:169:21: call_function: inlined call to ‘list_head’ from ‘ExecInitJunkFilterConversion’
postgresql-18.1/src/backend/executor/execJunk.c:170:17: branch_false: ...to here
postgresql-18.1/src/backend/executor/execJunk.c:170:29: branch_true: following ‘true’ branch (when ‘i < cleanLength’)...
postgresql-18.1/src/backend/executor/execJunk.c:172:29: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/execTuples.c:2474:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘isnull’
postgresql-18.1/src/backend/executor/execTuples.c:2492:1: enter_function: entry to ‘do_text_output_multiline’
postgresql-18.1/src/backend/executor/execTuples.c:2497:16: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/execTuples.c:2502:23: branch_true: ...to here
postgresql-18.1/src/backend/executor/execTuples.c:2503:20: branch_true: following ‘true’ branch (when ‘eol’ is non-NULL)...
postgresql-18.1/src/backend/executor/execTuples.c:2505:31: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1233:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1214:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1220:25: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1265:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1158:1: enter_function: entry to ‘ExecIndexBuildScanKeys’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1214:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1220:25: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1226:43: call_function: inlined call to ‘get_leftop’ from ‘ExecIndexBuildScanKeys’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1228:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1228:39: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1233:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1234:35: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1233:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1237:25: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1238:28: branch_false: following ‘false’ branch...
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1350:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1329:25: branch_true: following ‘true’ branch...
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1389:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1329:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1345:36: branch_true: following ‘true’ branch (when ‘leftop’ is non-NULL)...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1345:47: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1350:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1351:43: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1350:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1354:33: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1360:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1360:37: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1360:37: branch_false: following ‘false’ branch (when ‘varattno > 0’)...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1360:37: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1360:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1363:44: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1370:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1373:44: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1377:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1384:36: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1474:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1311:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1451:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1461:25: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1469:28: branch_false: following ‘false’ branch (when ‘leftop’ is NULL)...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1474:31: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1507:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rightop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1311:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1451:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1461:25: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1469:28: branch_true: following ‘true’ branch (when ‘leftop’ is non-NULL)...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1469:39: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1474:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1475:35: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1474:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1478:25: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1479:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1498:28: branch_false: following ‘false’ branch (when ‘rightop’ is NULL)...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1503:29: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1503:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1507:37: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1588:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftop’
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1198:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1311:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1451:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1570:25: branch_false: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1570:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1581:25: branch_true: ...to here
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1583:28: branch_false: following ‘false’ branch (when ‘leftop’ is NULL)...
postgresql-18.1/src/backend/executor/nodeIndexscan.c:1588:31: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/lib/pairingheap.c:275:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pairs’
postgresql-18.1/src/backend/lib/pairingheap.c:251:20: branch_true: following ‘true’ branch (when ‘next’ is NULL)...
postgresql-18.1/src/backend/lib/pairingheap.c:275:9: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/libpq/auth.c:681:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
# 679| StringInfoData buf;
# 680|
# 681|-> CHECK_FOR_INTERRUPTS();
# 682|
# 683| pq_beginmessage(&buf, PqMsg_AuthenticationRequest);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:688:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
# 686| pq_sendbytes(&buf, extradata, extralen);
# 687|
# 688|-> pq_endmessage(&buf);
# 689|
# 690| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:696:17: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
# 694| */
# 695| if (areq != AUTH_REQ_OK && areq != AUTH_REQ_SASL_FIN)
# 696|-> pq_flush();
# 697|
# 698| CHECK_FOR_INTERRUPTS();
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:698:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
# 696| pq_flush();
# 697|
# 698|-> CHECK_FOR_INTERRUPTS();
# 699| }
# 700|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:712:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1975:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18.1/src/backend/libpq/auth.c:1976:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
# 710| int mtype;
# 711|
# 712|-> pq_startmsgread();
# 713|
# 714| /* Expect 'p' message type */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:715:17: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1975:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18.1/src/backend/libpq/auth.c:1976:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
# 713|
# 714| /* Expect 'p' message type */
# 715|-> mtype = pq_getbyte();
# 716| if (mtype != PqMsg_PasswordMessage)
# 717| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:724:25: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1975:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18.1/src/backend/libpq/auth.c:1976:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
# 722| */
# 723| if (mtype != EOF)
# 724|-> ereport(ERROR,
# 725| (errcode(ERRCODE_PROTOCOL_VIOLATION),
# 726| errmsg("expected password response, got message type %d",
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:731:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1975:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18.1/src/backend/libpq/auth.c:1976:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
# 729| }
# 730|
# 731|-> initStringInfo(&buf);
# 732| if (pq_getmessage(&buf, PG_MAX_AUTH_TOKEN_LENGTH)) /* receive password */
# 733| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:732:13: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975:41: call_function: calling ‘sendAuthRequest’ from ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1975:41: return_function: returning to ‘pam_passwd_conv_proc’ from ‘sendAuthRequest’
postgresql-18.1/src/backend/libpq/auth.c:1976:50: call_function: calling ‘recv_password_packet’ from ‘pam_passwd_conv_proc’
# 730|
# 731| initStringInfo(&buf);
# 732|-> if (pq_getmessage(&buf, PG_MAX_AUTH_TOKEN_LENGTH)) /* receive password */
# 733| {
# 734| /* EOF - pq_getmessage already logged a suitable message */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:1993:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1988:43: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1988:54: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1988:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1990:33: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1993:33: throw: if ‘errstart’ throws an exception...
postgresql-18.1/src/backend/libpq/auth.c:1993:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
# 1991| break;
# 1992| case PAM_ERROR_MSG:
# 1993|-> ereport(LOG,
# 1994| (errmsg("error from underlying PAM layer: %s",
# 1995| msg[i]->msg)));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:1993:33: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1993:33: throw: if ‘errstart’ throws an exception...
postgresql-18.1/src/backend/libpq/auth.c:1993:33: danger: ‘reply’ leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1991| break;
# 1992| case PAM_ERROR_MSG:
# 1993|-> ereport(LOG,
# 1994| (errmsg("error from underlying PAM layer: %s",
# 1995| msg[i]->msg)));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:2004:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1988:43: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1988:54: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1988:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1990:33: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:2004:33: throw: if ‘errstart’ throws an exception...
postgresql-18.1/src/backend/libpq/auth.c:2004:33: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/10)
# 2002| break;
# 2003| default:
# 2004|-> ereport(LOG,
# 2005| (errmsg("unsupported PAM conversation %d/\"%s\"",
# 2006| msg[i]->msg_style,
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/libpq/auth.c:2004:33: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:2004:33: throw: if ‘errstart’ throws an exception...
postgresql-18.1/src/backend/libpq/auth.c:2004:33: danger: ‘reply’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 2002| break;
# 2003| default:
# 2004|-> ereport(LOG,
# 2005| (errmsg("unsupported PAM conversation %d/\"%s\"",
# 2006| msg[i]->msg_style,
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/backend/libpq/auth.c:2840:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data’
postgresql-18.1/src/backend/libpq/auth.c:2940:1: enter_function: entry to ‘PerformRadiusTransaction’
postgresql-18.1/src/backend/libpq/auth.c:2980:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:2994:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:3001:22: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:3018:21: branch_false: following ‘false’ branch (when ‘i >= encryptedpasswordlen’)...
postgresql-18.1/src/backend/libpq/auth.c:3049:9: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:3051:9: call_function: calling ‘radius_add_attribute’ from ‘PerformRadiusTransaction’
# 2838| attr->attribute = type;
# 2839| attr->length = len + 2; /* total size includes type and length */
# 2840|-> memcpy(attr->data, data, len);
# 2841| packet->length += attr->length;
# 2842| }
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/src/backend/libpq/auth.c:3051: warning[uninitvar]: Uninitialized variable: encryptedpassword
# 3049| pfree(cryptvector);
# 3050|
# 3051|-> radius_add_attribute(packet, RADIUS_PASSWORD, encryptedpassword, encryptedpasswordlen);
# 3052|
# 3053| /* Length needs to be in network order on the wire */
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/libpq/hba.c:1353:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/libpq/hba.c:1328:1: enter_function: entry to ‘parse_hba_line’
postgresql-18.1/src/backend/libpq/hba.c:1352:17: call_function: inlined call to ‘list_head’ from ‘parse_hba_line’
postgresql-18.1/src/backend/libpq/hba.c:1353:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/libpq/hba.c:2768:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/libpq/hba.c:2751:1: enter_function: entry to ‘parse_ident_line’
postgresql-18.1/src/backend/libpq/hba.c:2762:17: call_function: inlined call to ‘list_head’ from ‘parse_ident_line’
postgresql-18.1/src/backend/libpq/hba.c:2764:22: branch_false: ...to here
postgresql-18.1/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: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/plan/analyzejoins.c:1234:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18.1/src/backend/optimizer/plan/analyzejoins.c:980:1: enter_function: entry to ‘rel_is_distinct_for’
postgresql-18.1/src/backend/optimizer/plan/analyzejoins.c:1060:21: call_function: calling ‘query_is_distinct_for’ from ‘rel_is_distinct_for’
# 1232| /* non-resjunk columns should have grouping clauses */
# 1233| Assert(lg != NULL);
# 1234|-> sgc = (SortGroupClause *) lfirst(lg);
# 1235| lg = lnext(topop->groupClauses, lg);
# 1236|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/plan/initsplan.c:2900:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sjinfo’
postgresql-18.1/src/backend/optimizer/plan/initsplan.c:1616:1: enter_function: entry to ‘process_security_barrier_quals’
postgresql-18.1/src/backend/optimizer/plan/initsplan.c:1629:9: branch_true: following ‘true’ branch...
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/plan/planner.c:4113:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partially_grouped_rel’
postgresql-18.1/src/backend/optimizer/plan/planner.c:4079:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:4100:9: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:4100:9: release_memory: ‘partially_grouped_rel’ is NULL
postgresql-18.1/src/backend/optimizer/plan/planner.c:4103:12: branch_false: following ‘false’ branch (when ‘patype == 0’)...
postgresql-18.1/src/backend/optimizer/plan/planner.c:4109:13: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:4109:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:4113:21: branch_true: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:4113:21: danger: dereference of NULL ‘partially_grouped_rel’
# 4111| Assert(partially_grouped_rel);
# 4112|
# 4113|-> if (partially_grouped_rel->pathlist)
# 4114| set_cheapest(partially_grouped_rel);
# 4115|
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/optimizer/plan/planner.c:5792:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘orig_tlist_item’
postgresql-18.1/src/backend/optimizer/plan/planner.c:5777:1: enter_function: entry to ‘postprocess_setop_tlist’
postgresql-18.1/src/backend/optimizer/plan/planner.c:5780:39: call_function: inlined call to ‘list_head’ from ‘postprocess_setop_tlist’
postgresql-18.1/src/backend/optimizer/plan/planner.c:5782:9: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:5782:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:5788:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:5792:17: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:5792:17: danger: dereference of NULL ‘orig_tlist_item’
# 5790|
# 5791| Assert(orig_tlist_item != NULL);
# 5792|-> orig_tle = lfirst_node(TargetEntry, orig_tlist_item);
# 5793| orig_tlist_item = lnext(orig_tlist, orig_tlist_item);
# 5794| if (orig_tle->resjunk) /* should not happen */
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/optimizer/plan/planner.c:8285:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ct’
postgresql-18.1/src/backend/optimizer/plan/planner.c:8259:1: enter_function: entry to ‘generate_setop_child_grouplist’
postgresql-18.1/src/backend/optimizer/plan/planner.c:8266:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18.1/src/backend/optimizer/plan/planner.c:8267:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_child_grouplist’
postgresql-18.1/src/backend/optimizer/plan/planner.c:8268:9: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:8268:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:8275:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:8284:17: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:8285:17: danger: dereference of NULL ‘ct’
# 8283| Assert(ct != NULL);
# 8284| sgc = (SortGroupClause *) lfirst(lg);
# 8285|-> coltype = lfirst_oid(ct);
# 8286|
# 8287| /* reject if target type isn't the same as the setop target type */
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:2092:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*root.grouping_map’
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3635:1: enter_function: entry to ‘extract_query_dependencies’
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3655:16: call_function: calling ‘extract_query_dependencies_walker’ from ‘extract_query_dependencies’
# 2090| {
# 2091| GroupingFunc *g = (GroupingFunc *) node;
# 2092|-> AttrNumber *grouping_map = root->grouping_map;
# 2093|
# 2094| /* If there are no grouping sets, we don't need this. */
Error: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:2188: warning[nullPointer]: Possible null pointer dereference: bestplan
# 2186|
# 2187| /* Mark the subplan we selected */
# 2188|-> root->isUsedSubplan[bestplan->plan_id - 1] = true;
# 2189|
# 2190| return (Node *) bestplan;
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:2188:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bestplan’
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3126:1: enter_function: entry to ‘fix_join_expr_mutator’
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3130:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3132:13: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3132:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3188:12: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3234:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3236:12: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3236:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3237:24: branch_true: ...to here
postgresql-18.1/src/backend/optimizer/plan/setrefs.c:3237:24: call_function: calling ‘fix_alternative_subplan’ from ‘fix_join_expr_mutator’
# 2186|
# 2187| /* Mark the subplan we selected */
# 2188|-> root->isUsedSubplan[bestplan->plan_id - 1] = true;
# 2189|
# 2190| return (Node *) bestplan;
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:121:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘target_rte’
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:80:12: branch_false: following ‘false’ branch (when ‘result_relation == 0’)...
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:105:9: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:106:12: branch_false: following ‘false’ branch (when ‘command_type != 3’)...
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:108:17: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:108:17: branch_false: following ‘false’ branch (when ‘command_type != 2’)...
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:119:14: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:398:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:64:1: enter_function: entry to ‘preprocess_targetlist’
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:80:12: branch_false: following ‘false’ branch (when ‘result_relation == 0’)...
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:105:9: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:106:12: branch_true: following ‘true’ branch (when ‘command_type == 3’)...
postgresql-18.1/src/backend/optimizer/prep/preptlist.c:107:25: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1521:64: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘curColType’
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1508:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1515:17: branch_true: following ‘true’ branch (when ‘subtlist’ is non-NULL)...
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1515:17: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1613:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lg’
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1594:1: enter_function: entry to ‘generate_setop_grouplist’
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1600:14: call_function: inlined call to ‘list_head’ from ‘generate_setop_grouplist’
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1601:9: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/prep/prepunion.c:1601:9: branch_true: following ‘true’ branch...
postgresql-18.1/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):
postgresql-18.1/src/backend/optimizer/util/clauses.c: scope_hint: In function ‘recheck_cast_function_args.isra.0’
postgresql-18.1/src/backend/optimizer/util/clauses.c:4406:19: warning[-Wmaybe-uninitialized]: ‘actual_arg_types’ may be used uninitialized
# 4406 | rettype = enforce_generic_type_consistency(actual_arg_types,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4407 | declared_arg_types,
# | ~~~~~~~~~~~~~~~~~~~
# 4408 | nargs,
# | ~~~~~~
# 4409 | funcform->prorettype,
# | ~~~~~~~~~~~~~~~~~~~~~
# 4410 | false);
# | ~~~~~~
postgresql-18.1/src/backend/optimizer/util/clauses.c:42: included_from: Included from here.
postgresql-18.1/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-18.1/src/backend/optimizer/util/clauses.c:4392:33: note: ‘actual_arg_types’ declared here
# 4392 | Oid actual_arg_types[FUNC_MAX_ARGS];
# | ^~~~~~~~~~~~~~~~
# 4404| Assert(nargs == pronargs);
# 4405| memcpy(declared_arg_types, proargtypes, pronargs * sizeof(Oid));
# 4406|-> rettype = enforce_generic_type_consistency(actual_arg_types,
# 4407| declared_arg_types,
# 4408| nargs,
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/parser/analyze.c:284:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘stmt’
postgresql-18.1/src/backend/parser/analyze.c:3162:1: enter_function: entry to ‘transformCreateTableAsStmt’
postgresql-18.1/src/backend/parser/analyze.c:3168:17: call_function: calling ‘transformStmt’ from ‘transformCreateTableAsStmt’
# 282| Assert(stmt && IsA(stmt, SelectStmt) && stmt->larg == NULL);
# 283|
# 284|-> if (stmt->intoClause)
# 285| {
# 286| CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt);
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/parser/analyze.c:1785:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leftmostSelect’
postgresql-18.1/src/backend/parser/analyze.c:3162:1: enter_function: entry to ‘transformCreateTableAsStmt’
postgresql-18.1/src/backend/parser/analyze.c:3168:17: call_function: calling ‘transformStmt’ from ‘transformCreateTableAsStmt’
# 1783| Assert(leftmostSelect && IsA(leftmostSelect, SelectStmt) &&
# 1784| leftmostSelect->larg == NULL);
# 1785|-> if (leftmostSelect->intoClause)
# 1786| ereport(ERROR,
# 1787| (errcode(ERRCODE_SYNTAX_ERROR),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/analyze.c:2250: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2248| /* select common type, same as CASE et al */
# 2249| rescoltype = select_common_type(pstate,
# 2250|-> list_make2(lcolnode, rcolnode),
# 2251| context,
# 2252| &bestexpr);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/analyze.c:2305: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2303|
# 2304| rescoltypmod = select_common_typmod(pstate,
# 2305|-> list_make2(lcolnode, rcolnode),
# 2306| rescoltype);
# 2307|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/analyze.c:2318: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lcolnode)},(union ListCell){.ptr_value=(rcolnode)}' depends on order of evaluation of side effects
# 2316| */
# 2317| rescolcoll = select_common_collation(pstate,
# 2318|-> list_make2(lcolnode, rcolnode),
# 2319| (op->op == SETOP_UNION && op->all));
# 2320|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:1878: 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
# 1876| TypeName *t = $1;
# 1877|
# 1878|-> t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
# 1879| makeIntConst($3, @3));
# 1880| $$ = makeStringConstCast($5, @5, t);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:4476: 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
# 4474| ExclusionConstraintElem: index_elem WITH any_operator
# 4475| {
# 4476|-> $$ = list_make2($1, $3);
# 4477| }
# 4478| /* allow OPERATOR() decoration for the benefit of ruleutils.c */
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:4481: 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
# 4479| | index_elem WITH OPERATOR '(' any_operator ')'
# 4480| {
# 4481|-> $$ = list_make2($1, $5);
# 4482| }
# 4483| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:5348: 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
# 5346| n->action = $4;
# 5347| n->objtype = OBJECT_CAST;
# 5348|-> n->object = (Node *) list_make2($7, $9);
# 5349| $$ = (Node *) n;
# 5350| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:5428: 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
# 5426| n->action = $4;
# 5427| n->objtype = OBJECT_TRANSFORM;
# 5428|-> n->object = (Node *) list_make2($7, makeString($9));
# 5429| $$ = (Node *) n;
# 5430| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:6095: 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
# 6093| * should just ignore the columns for non-UPDATE events.
# 6094| */
# 6095|-> $$ = list_make2(makeInteger(events1 | events2),
# 6096| list_concat(columns1, columns2));
# 6097| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:6102: 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
# 6100| TriggerOneEvent:
# 6101| INSERT
# 6102|-> { $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
# 6103| | DELETE_P
# 6104| { $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:6104: 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
# 6102| { $$ = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); }
# 6103| | DELETE_P
# 6104|-> { $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
# 6105| | UPDATE
# 6106| { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:6106: 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
# 6104| { $$ = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); }
# 6105| | UPDATE
# 6106|-> { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
# 6107| | UPDATE OF columnList
# 6108| { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:6108: 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
# 6106| { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); }
# 6107| | UPDATE OF columnList
# 6108|-> { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
# 6109| | TRUNCATE
# 6110| { $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:6110: 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
# 6108| { $$ = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), $3); }
# 6109| | TRUNCATE
# 6110|-> { $$ = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); }
# 6111| ;
# 6112|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:7242: 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
# 7240| * up here.
# 7241| */
# 7242|-> n->object = (Node *) list_make2(makeTypeNameFromNameList($7), makeString($4));
# 7243| n->comment = $9;
# 7244| $$ = (Node *) n;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:7278: 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
# 7276|
# 7277| n->objtype = OBJECT_TRANSFORM;
# 7278|-> n->object = (Node *) list_make2($5, makeString($7));
# 7279| n->comment = $9;
# 7280| $$ = (Node *) n;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:7314: 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
# 7312|
# 7313| n->objtype = OBJECT_CAST;
# 7314|-> n->object = (Node *) list_make2($5, $7);
# 7315| n->comment = $10;
# 7316| $$ = (Node *) n;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:8673: 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
# 8671| aggr_args: '(' '*' ')'
# 8672| {
# 8673|-> $$ = list_make2(NIL, makeInteger(-1));
# 8674| }
# 8675| | '(' aggr_args_list ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:8677: 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
# 8675| | '(' aggr_args_list ')'
# 8676| {
# 8677|-> $$ = list_make2($2, makeInteger(-1));
# 8678| }
# 8679| | '(' ORDER BY aggr_args_list ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:8681: 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
# 8679| | '(' ORDER BY aggr_args_list ')'
# 8680| {
# 8681|-> $$ = list_make2($4, makeInteger(0));
# 8682| }
# 8683| | '(' aggr_args_list ORDER BY aggr_args_list ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:8825: 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
# 8823| | Sconst ',' Sconst
# 8824| {
# 8825|-> $$ = list_make2(makeString($1), makeString($3));
# 8826| }
# 8827| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9105: 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
# 9103| }
# 9104| | '(' Typename ',' Typename ')'
# 9105|-> { $$ = list_make2($2, $4); }
# 9106| | '(' NONE ',' Typename ')' /* left unary */
# 9107| { $$ = list_make2(NULL, $4); }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9107: 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
# 9105| { $$ = list_make2($2, $4); }
# 9106| | '(' NONE ',' Typename ')' /* left unary */
# 9107|-> { $$ = list_make2(NULL, $4); }
# 9108| | '(' Typename ',' NONE ')' /* right unary */
# 9109| { $$ = list_make2($2, NULL); }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9109: 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
# 9107| { $$ = list_make2(NULL, $4); }
# 9108| | '(' Typename ',' NONE ')' /* right unary */
# 9109|-> { $$ = list_make2($2, NULL); }
# 9110| ;
# 9111|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9225: 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
# 9223|
# 9224| n->removeType = OBJECT_CAST;
# 9225|-> n->objects = list_make1(list_make2($5, $7));
# 9226| n->behavior = $9;
# 9227| n->missing_ok = $3;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9259: 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
# 9257| transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes
# 9258| {
# 9259|-> $$ = list_make2($5, $11);
# 9260| }
# 9261| | TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9263: 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
# 9261| | TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes
# 9262| {
# 9263|-> $$ = list_make2($11, $5);
# 9264| }
# 9265| | FROM SQL_P WITH FUNCTION function_with_argtypes
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9267: 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
# 9265| | FROM SQL_P WITH FUNCTION function_with_argtypes
# 9266| {
# 9267|-> $$ = list_make2($5, NULL);
# 9268| }
# 9269| | TO SQL_P WITH FUNCTION function_with_argtypes
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9271: 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
# 9269| | TO SQL_P WITH FUNCTION function_with_argtypes
# 9270| {
# 9271|-> $$ = list_make2(NULL, $5);
# 9272| }
# 9273| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:9281: 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
# 9279|
# 9280| n->removeType = OBJECT_TRANSFORM;
# 9281|-> n->objects = list_make1(list_make2($5, makeString($7)));
# 9282| n->behavior = $8;
# 9283| n->missing_ok = $3;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:11759: 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
#11757| n->cfgname = $5;
#11758| n->tokentype = NIL;
#11759|-> n->dicts = list_make2($9,$11);
#11760| n->override = false;
#11761| n->replace = true;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:11771: 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
#11769| n->cfgname = $5;
#11770| n->tokentype = $9;
#11771|-> n->dicts = list_make2($11,$13);
#11772| n->override = false;
#11773| n->replace = true;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:13862: 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
#13860| alias_clause
#13861| {
#13862|-> $$ = list_make2($1, NIL);
#13863| }
#13864| | AS '(' TableFuncElementList ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:13866: 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
#13864| | AS '(' TableFuncElementList ')'
#13865| {
#13866|-> $$ = list_make2(NULL, $3);
#13867| }
#13868| | AS ColId '(' TableFuncElementList ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:13873: 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
#13871|
#13872| a->aliasname = $2;
#13873|-> $$ = list_make2(a, $4);
#13874| }
#13875| | ColId '(' TableFuncElementList ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:13880: 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
#13878|
#13879| a->aliasname = $1;
#13880|-> $$ = list_make2(a, $3);
#13881| }
#13882| | /*EMPTY*/
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:13884: 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
#13882| | /*EMPTY*/
#13883| {
#13884|-> $$ = list_make2(NULL, NIL);
#13885| }
#13886| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:13913: 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
#13911| join_qual: USING '(' name_list ')' opt_alias_clause_for_join_using
#13912| {
#13913|-> $$ = (Node *) list_make2($3, $5);
#13914| }
#13915| | ON a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:14039: 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
#14037| n->ordinality = $2;
#14038| n->is_rowsfrom = false;
#14039|-> n->functions = list_make1(list_make2($1, NIL));
#14040| /* alias and coldeflist are set by table_ref production */
#14041| $$ = (Node *) n;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:14057: 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
#14055|
#14056| rowsfrom_item: func_expr_windowless opt_col_def_list
#14057|-> { $$ = list_make2($1, $2); }
#14058| ;
#14059|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:14518: 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
#14516| {
#14517| $$ = $1;
#14518|-> $$->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
#14519| makeIntConst($3, @3));
#14520| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:14904: 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
#14902| | SECOND_P '(' Iconst ')'
#14903| {
#14904|-> $$ = list_make2(makeIntConst(INTERVAL_MASK(SECOND), @1),
#14905| makeIntConst($3, @3));
#14906| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:14960: 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
#14958| {
#14959| $$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
#14960|-> list_make2($5, $1),
#14961| COERCE_SQL_SYNTAX,
#14962| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15031: 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
#15029| {
#15030| FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
#15031|-> list_make2($3, $5),
#15032| COERCE_EXPLICIT_CALL,
#15033| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15045: 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
#15043| {
#15044| FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
#15045|-> list_make2($4, $6),
#15046| COERCE_EXPLICIT_CALL,
#15047| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15059: 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
#15057| {
#15058| FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
#15059|-> list_make2($3, $5),
#15060| COERCE_EXPLICIT_CALL,
#15061| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15073: 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
#15071| {
#15072| FuncCall *n = makeFuncCall(SystemFuncName("like_escape"),
#15073|-> list_make2($4, $6),
#15074| COERCE_EXPLICIT_CALL,
#15075| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15092: 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
#15090| {
#15091| FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"),
#15092|-> list_make2($4, $6),
#15093| COERCE_EXPLICIT_CALL,
#15094| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15110: 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
#15108| {
#15109| FuncCall *n = makeFuncCall(SystemFuncName("similar_to_escape"),
#15110|-> list_make2($5, $7),
#15111| COERCE_EXPLICIT_CALL,
#15112| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15246: 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
#15244| "BETWEEN",
#15245| $1,
#15246|-> (Node *) list_make2($4, $6),
#15247| @2);
#15248| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15254: 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
#15252| "NOT BETWEEN",
#15253| $1,
#15254|-> (Node *) list_make2($5, $7),
#15255| @2);
#15256| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15262: 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
#15260| "BETWEEN SYMMETRIC",
#15261| $1,
#15262|-> (Node *) list_make2($4, $6),
#15263| @2);
#15264| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15270: 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
#15268| "NOT BETWEEN SYMMETRIC",
#15269| $1,
#15270|-> (Node *) list_make2($5, $7),
#15271| @2);
#15272| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15374: 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
#15372| {
#15373| $$ = (Node *) makeFuncCall(SystemFuncName("is_normalized"),
#15374|-> list_make2($1, makeStringConst($3, @3)),
#15375| COERCE_SQL_SYNTAX,
#15376| @2);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15389: 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
#15387| {
#15388| $$ = makeNotExpr((Node *) makeFuncCall(SystemFuncName("is_normalized"),
#15389|-> list_make2($1, makeStringConst($4, @4)),
#15390| COERCE_SQL_SYNTAX,
#15391| @2),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:15906: 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
#15904| {
#15905| $$ = (Node *) makeFuncCall(SystemFuncName("normalize"),
#15906|-> list_make2($3, makeStringConst($5, @5)),
#15907| COERCE_SQL_SYNTAX,
#15908| @1);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16065: 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
#16063| * converted to xmlexists(A, B)*/
#16064| $$ = (Node *) makeFuncCall(SystemFuncName("xmlexists"),
#16065|-> list_make2($3, $4),
#16066| COERCE_SQL_SYNTAX,
#16067| @1);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16077: 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
#16075| XmlExpr *x = (XmlExpr *)
#16076| makeXmlExpr(IS_XMLPARSE, NULL, NIL,
#16077|-> list_make2($4, makeBoolAConst($5, -1)),
#16078| @1);
#16079|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16094: 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
#16092| {
#16093| $$ = makeXmlExpr(IS_XMLROOT, NULL, NIL,
#16094|-> list_make3($3, $5, $6), @1);
#16095| }
#16096| | XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16094: 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
#16092| {
#16093| $$ = makeXmlExpr(IS_XMLROOT, NULL, NIL,
#16094|-> list_make3($3, $5, $6), @1);
#16095| }
#16096| | XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16771: 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
#16769| extract_arg FROM a_expr
#16770| {
#16771|-> $$ = list_make2(makeStringConst($1, @1), $3);
#16772| }
#16773| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16801: 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
#16799| {
#16800| /* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16801|-> $$ = list_make4($1, $3, $5, $7);
#16802| }
#16803| | a_expr PLACING a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16801: 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
#16799| {
#16800| /* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16801|-> $$ = list_make4($1, $3, $5, $7);
#16802| }
#16803| | a_expr PLACING a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16801: 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
#16799| {
#16800| /* overlay(A PLACING B FROM C FOR D) is converted to overlay(A, B, C, D) */
#16801|-> $$ = list_make4($1, $3, $5, $7);
#16802| }
#16803| | a_expr PLACING a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16806: 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
#16804| {
#16805| /* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */
#16806|-> $$ = list_make3($1, $3, $5);
#16807| }
#16808| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16806: 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
#16804| {
#16805| /* overlay(A PLACING B FROM C) is converted to overlay(A, B, C) */
#16806|-> $$ = list_make3($1, $3, $5);
#16807| }
#16808| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16812: 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
#16810| /* position_list uses b_expr not a_expr to avoid conflict with general IN */
#16811| position_list:
#16812|-> b_expr IN_P b_expr { $$ = list_make2($3, $1); }
#16813| ;
#16814|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16835: 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
#16833| a_expr FROM a_expr FOR a_expr
#16834| {
#16835|-> $$ = list_make3($1, $3, $5);
#16836| }
#16837| | a_expr FOR a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16835: 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
#16833| a_expr FROM a_expr FOR a_expr
#16834| {
#16835|-> $$ = list_make3($1, $3, $5);
#16836| }
#16837| | a_expr FOR a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16840: 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
#16838| {
#16839| /* not legal per SQL, but might as well allow it */
#16840|-> $$ = list_make3($1, $5, $3);
#16841| }
#16842| | a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16840: 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
#16838| {
#16839| /* not legal per SQL, but might as well allow it */
#16840|-> $$ = list_make3($1, $5, $3);
#16841| }
#16842| | a_expr FROM a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16851: 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
#16849| * such a call in regular function call syntax.
#16850| */
#16851|-> $$ = list_make2($1, $3);
#16852| }
#16853| | a_expr FOR a_expr
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16866: 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
#16864| * is unknown or doesn't have an implicit cast to int4.
#16865| */
#16866|-> $$ = list_make3($1, makeIntConst(1, -1),
#16867| makeTypeCast($3,
#16868| SystemTypeName("int4"), -1));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16866: 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
#16864| * is unknown or doesn't have an implicit cast to int4.
#16865| */
#16866|-> $$ = list_make3($1, makeIntConst(1, -1),
#16867| makeTypeCast($3,
#16868| SystemTypeName("int4"), -1));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16872: 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
#16870| | a_expr SIMILAR a_expr ESCAPE a_expr
#16871| {
#16872|-> $$ = list_make3($1, $3, $5);
#16873| }
#16874| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:16872: 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
#16870| | a_expr SIMILAR a_expr ESCAPE a_expr
#16871| {
#16872|-> $$ = list_make3($1, $3, $5);
#16873| }
#16874| ;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:17434: 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
#17432| TypeName *t = $1;
#17433|
#17434|-> t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
#17435| makeIntConst($3, @3));
#17436| $$ = makeStringConstCast($5, @5, t);
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/src/backend/parser/gram.y:17528: error[legacyUninitvar]: Uninitialized variable: n
#17526| n->rolename = pstrdup($1);
#17527| }
#17528|-> $$ = n;
#17529| }
#17530| | CURRENT_ROLE
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:19016: 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
#19014| ndirectargs = makeInteger(list_length(directargs));
#19015|
#19016|-> return list_make2(list_concat(directargs, orderedargs),
#19017| ndirectargs);
#19018| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:19123: 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
#19121| SystemFuncName(char *name)
#19122| {
#19123|-> return list_make2(makeString("pg_catalog"), makeString(name));
#19124| }
#19125|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:19135: 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
#19133| SystemTypeName(char *name)
#19134| {
#19135|-> return makeTypeNameFromNameList(list_make2(makeString("pg_catalog"),
#19136| makeString(name)));
#19137| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:19204: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lexpr)},(union ListCell){.ptr_value=(rexpr)}' depends on order of evaluation of side effects
#19202| }
#19203| }
#19204|-> return (Node *) makeBoolExpr(AND_EXPR, list_make2(lexpr, rexpr), location);
#19205| }
#19206|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/gram.y:19221: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(lexpr)},(union ListCell){.ptr_value=(rexpr)}' depends on order of evaluation of side effects
#19219| }
#19220| }
#19221|-> return (Node *) makeBoolExpr(OR_EXPR, list_make2(lexpr, rexpr), location);
#19222| }
#19223|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_agg.c:2243: 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
# 2241|
# 2242| /* deserialfn always takes BYTEA, INTERNAL and returns INTERNAL */
# 2243|-> args = list_make2(make_agg_arg(BYTEAOID, InvalidOid),
# 2244| make_agg_arg(INTERNALOID, InvalidOid));
# 2245|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/parser/parse_collate.c:972:58: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘h_cell’
postgresql-18.1/src/backend/parser/parse_collate.c:955:1: enter_function: entry to ‘assign_hypothetical_collations’
postgresql-18.1/src/backend/parser/parse_collate.c:958:30: call_function: inlined call to ‘list_head’ from ‘assign_hypothetical_collations’
postgresql-18.1/src/backend/parser/parse_collate.c:959:40: branch_false: ...to here
postgresql-18.1/src/backend/parser/parse_collate.c:959:30: call_function: inlined call to ‘list_head’ from ‘assign_hypothetical_collations’
postgresql-18.1/src/backend/parser/parse_collate.c:964:34: call_function: inlined call to ‘list_length’ from ‘assign_hypothetical_collations’
postgresql-18.1/src/backend/parser/parse_collate.c:970:16: branch_true: following ‘true’ branch (when ‘extra_args > 0’)...
postgresql-18.1/src/backend/parser/parse_collate.c:972:58: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/parser/parse_expr.c:1277: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(result)},(union ListCell){.ptr_value=(cmp)}' depends on order of evaluation of side effects
# 1275| else
# 1276| result = (Node *) makeBoolExpr(useOr ? OR_EXPR : AND_EXPR,
# 1277|-> list_make2(result, cmp),
# 1278| a->location);
# 1279| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1316: 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
# 1314| {
# 1315| case AEXPR_BETWEEN:
# 1316|-> args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1317| aexpr, bexpr,
# 1318| a->location),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1325: 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
# 1323| break;
# 1324| case AEXPR_NOT_BETWEEN:
# 1325|-> args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1326| aexpr, bexpr,
# 1327| a->location),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1334: 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
# 1332| break;
# 1333| case AEXPR_BETWEEN_SYM:
# 1334|-> args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1335| aexpr, bexpr,
# 1336| a->location),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1341: 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
# 1339| a->location));
# 1340| sub1 = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1341|-> args = list_make2(makeSimpleA_Expr(AEXPR_OP, ">=",
# 1342| copyObject(aexpr), copyObject(cexpr),
# 1343| a->location),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1348: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sub1)},(union ListCell){.ptr_value=(sub2)}' depends on order of evaluation of side effects
# 1346| a->location));
# 1347| sub2 = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1348|-> args = list_make2(sub1, sub2);
# 1349| result = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1350| break;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1352: 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
# 1350| break;
# 1351| case AEXPR_NOT_BETWEEN_SYM:
# 1352|-> args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1353| aexpr, bexpr,
# 1354| a->location),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1359: 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
# 1357| a->location));
# 1358| sub1 = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1359|-> args = list_make2(makeSimpleA_Expr(AEXPR_OP, "<",
# 1360| copyObject(aexpr), copyObject(cexpr),
# 1361| a->location),
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:1366: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(sub1)},(union ListCell){.ptr_value=(sub2)}' depends on order of evaluation of side effects
# 1364| a->location));
# 1365| sub2 = (Node *) makeBoolExpr(OR_EXPR, args, a->location);
# 1366|-> args = list_make2(sub1, sub2);
# 1367| result = (Node *) makeBoolExpr(AND_EXPR, args, a->location);
# 1368| break;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:3058: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(result)},(union ListCell){.ptr_value=(cmp)}' depends on order of evaluation of side effects
# 3056| else
# 3057| result = (Node *) makeBoolExpr(OR_EXPR,
# 3058|-> list_make2(result, cmp),
# 3059| location);
# 3060| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:3283: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(expr)},(union ListCell){.ptr_value=(encoding)}' depends on order of evaluation of side effects
# 3281| Const *encoding = getJsonEncodingConst(format);
# 3282| FuncExpr *fexpr = makeFuncExpr(F_CONVERT_FROM, TEXTOID,
# 3283|-> list_make2(expr, encoding),
# 3284| InvalidOid, InvalidOid,
# 3285| COERCE_EXPLICIT_CALL);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:3628: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(texpr)},(union ListCell){.ptr_value=(enc)}' depends on order of evaluation of side effects
# 3626| Const *enc = getJsonEncodingConst(returning->format);
# 3627| FuncExpr *fexpr = makeFuncExpr(F_CONVERT_TO, BYTEAOID,
# 3628|-> list_make2(texpr, enc),
# 3629| InvalidOid, InvalidOid,
# 3630| COERCE_EXPLICIT_CALL);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:3790: 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
# 3788| free_parsestate(qpstate);
# 3789|
# 3790|-> colref->fields = list_make2(makeString(pstrdup("q")),
# 3791| makeString(pstrdup("a")));
# 3792| colref->location = ctor->location;
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_expr.c:3935: error[unknownEvaluationOrder]: Expression 'T_List,(union ListCell){.ptr_value=(key)},(union ListCell){.ptr_value=(val)}' depends on order of evaluation of side effects
# 3933| JS_FORMAT_DEFAULT,
# 3934| InvalidOid, false);
# 3935|-> args = list_make2(key, val);
# 3936|
# 3937| returning = transformJsonConstructorOutput(pstate, agg->constructor->output,
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/parser/parse_func.c:2014:70: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lc’
postgresql-18.1/src/backend/parser/parse_func.c:2008:21: branch_true: following ‘true’ branch (when ‘i < nargs’)...
postgresql-18.1/src/backend/parser/parse_func.c:2010:20: branch_true: ...to here
postgresql-18.1/src/backend/parser/parse_func.c:2010:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
postgresql-18.1/src/backend/parser/parse_func.c:2012:20: branch_false: ...to here
postgresql-18.1/src/backend/parser/parse_func.c:2012:20: branch_true: following ‘true’ branch (when ‘i >= numposargs’)...
postgresql-18.1/src/backend/parser/parse_func.c:2014:70: branch_true: ...to here
postgresql-18.1/src/backend/parser/parse_func.c:2008:21: branch_true: following ‘true’ branch (when ‘i < nargs’)...
postgresql-18.1/src/backend/parser/parse_func.c:2010:20: branch_true: ...to here
postgresql-18.1/src/backend/parser/parse_func.c:2012:20: branch_true: following ‘true’ branch (when ‘i >= numposargs’)...
postgresql-18.1/src/backend/parser/parse_func.c:2014:70: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/parser/parse_relation.c:3065:77: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘aliasp_item’
postgresql-18.1/src/backend/parser/parse_relation.c:2751:1: enter_function: entry to ‘expandRTE’
postgresql-18.1/src/backend/parser/parse_relation.c:2758:12: branch_true: following ‘true’ branch (when ‘colnames’ is non-NULL)...
postgresql-18.1/src/backend/parser/parse_relation.c:2759:17: branch_true: ...to here
postgresql-18.1/src/backend/parser/parse_relation.c:2760:12: branch_false: following ‘false’ branch (when ‘colvars’ is NULL)...
postgresql-18.1/src/backend/parser/parse_relation.c:2763:17: branch_false: ...to here
postgresql-18.1/src/backend/parser/parse_relation.c:3044:59: call_function: inlined call to ‘list_head’ from ‘expandRTE’
postgresql-18.1/src/backend/parser/parse_relation.c:3050:33: branch_false: ...to here
postgresql-18.1/src/backend/parser/parse_relation.c:3050:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/parser/parse_relation.c:3060:44: branch_true: following ‘true’ branch (when ‘colnames’ is non-NULL)...
postgresql-18.1/src/backend/parser/parse_relation.c:3063:52: branch_true: ...to here
postgresql-18.1/src/backend/parser/parse_relation.c:3063:52: branch_true: following ‘true’ branch (when ‘coltype != 0’)...
postgresql-18.1/src/backend/parser/parse_relation.c:3065:77: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:1296: 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
# 1294|
# 1295| stmt->objtype = OBJECT_TABCONSTRAINT;
# 1296|-> stmt->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
# 1297| makeString(cxt->relation->relname),
# 1298| makeString(nnconstr->conname));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:1296: 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(nnconstr->conname))}' depends on order of evaluation of side effects
# 1294|
# 1295| stmt->objtype = OBJECT_TABCONSTRAINT;
# 1296|-> stmt->object = (Node *) list_make3(makeString(cxt->relation->schemaname),
# 1297| makeString(cxt->relation->relname),
# 1298| makeString(nnconstr->conname));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:1517: 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
# 1515|
# 1516| stmt->objtype = OBJECT_TABCONSTRAINT;
# 1517|-> stmt->object = (Node *) list_make3(makeString(heapRel->schemaname),
# 1518| makeString(heapRel->relname),
# 1519| makeString(n->conname));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:1517: 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
# 1515|
# 1516| stmt->objtype = OBJECT_TABCONSTRAINT;
# 1517|-> stmt->object = (Node *) list_make3(makeString(heapRel->schemaname),
# 1518| makeString(heapRel->relname),
# 1519| makeString(n->conname));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:1840: 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
# 1838| /* For simplicity we always schema-qualify the op name */
# 1839| nspname = get_namespace_name(operform->oprnamespace);
# 1840|-> namelist = list_make2(makeString(nspname),
# 1841| makeString(oprname));
# 1842| index->excludeOpNames = lappend(index->excludeOpNames,
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:2194: 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
# 2192| nsp_name = get_namespace_name(coll_rec->collnamespace);
# 2193| coll_name = pstrdup(NameStr(coll_rec->collname));
# 2194|-> result = list_make2(makeString(nsp_name), makeString(coll_name));
# 2195|
# 2196| ReleaseSysCache(ht_coll);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/backend/parser/parse_utilcmd.c:2224: 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
# 2222| char *opc_name = pstrdup(NameStr(opc_rec->opcname));
# 2223|
# 2224|-> result = list_make2(makeString(nsp_name), makeString(opc_name));
# 2225| }
# 2226|
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/parser/scan.c:10850:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18.1/src/backend/parser/scan.c:9298:1: enter_function: entry to ‘core_yylex’
postgresql-18.1/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):
postgresql-18.1/src/backend/partitioning/partbounds.c:4039:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘partexprs_item’
postgresql-18.1/src/backend/partitioning/partbounds.c:3983:1: enter_function: entry to ‘get_qual_for_hash’
postgresql-18.1/src/backend/partitioning/partbounds.c:4020:26: call_function: inlined call to ‘list_head’ from ‘get_qual_for_hash’
postgresql-18.1/src/backend/partitioning/partbounds.c:4023:9: branch_false: ...to here
postgresql-18.1/src/backend/partitioning/partbounds.c:4023:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/partitioning/partbounds.c:4028:21: branch_true: ...to here
postgresql-18.1/src/backend/partitioning/partbounds.c:4028:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/partitioning/partbounds.c:4039:43: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/partitioning/partprune.c:2545:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘start’
postgresql-18.1/src/backend/partitioning/partprune.c:2525:1: enter_function: entry to ‘get_steps_using_prefix_recurse’
postgresql-18.1/src/backend/partitioning/partprune.c:2549:12: branch_true: following ‘true’ branch (when ‘cur_keyno < final_keyno’)...
postgresql-18.1/src/backend/partitioning/partprune.c:2559:17: call_function: inlined call to ‘for_each_cell_setup’ from ‘get_steps_using_prefix_recurse’
postgresql-18.1/src/backend/partitioning/partprune.c:2563:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/partitioning/partprune.c:2559:17: branch_false: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:2575:17: call_function: inlined call to ‘for_each_cell_setup’ from ‘get_steps_using_prefix_recurse’
postgresql-18.1/src/backend/partitioning/partprune.c:2575:17: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/partitioning/partprune.c:2575:17: branch_true: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:2582:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/partitioning/partprune.c:2585:47: branch_true: ...to here
postgresql-18.1/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: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/partitioning/partprune.c:3516:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘lc2’
postgresql-18.1/src/backend/partitioning/partprune.c:3444:1: enter_function: entry to ‘perform_pruning_base_step’
postgresql-18.1/src/backend/partitioning/partprune.c:3461:15: call_function: inlined call to ‘list_head’ from ‘perform_pruning_base_step’
postgresql-18.1/src/backend/partitioning/partprune.c:3462:15: call_function: inlined call to ‘list_head’ from ‘perform_pruning_base_step’
postgresql-18.1/src/backend/partitioning/partprune.c:3468:9: branch_false: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:3468:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/partitioning/partprune.c:3475:42: branch_true: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:3475:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/partitioning/partprune.c:3482:20: branch_false: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:3482:20: branch_false: following ‘false’ branch (when ‘keyno <= nvalues’)...
postgresql-18.1/src/backend/partitioning/partprune.c:3485:20: branch_false: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:3485:20: branch_true: following ‘true’ branch (when ‘lc1’ is non-NULL)...
postgresql-18.1/src/backend/partitioning/partprune.c:3492:25: branch_true: ...to here
postgresql-18.1/src/backend/partitioning/partprune.c:3503:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/partitioning/partprune.c:3516:25: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("postmaster.opts", "w")’
postgresql-18.1/src/backend/postmaster/postmaster.c:4088:19: acquire_resource: opened here
postgresql-18.1/src/backend/postmaster/postmaster.c:4088:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: danger: ‘fopen("postmaster.opts", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 4094| }
# 4095|
# 4096|-> fprintf(fp, "%s", fullprogname);
# 4097| for (i = 1; i < argc; i++)
# 4098| fprintf(fp, " \"%s\"", argv[i]);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("postmaster.opts", "w")’
postgresql-18.1/src/backend/postmaster/postmaster.c:4088:19: acquire_memory: allocated here
postgresql-18.1/src/backend/postmaster/postmaster.c:4088:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/backend/postmaster/postmaster.c:4096:9: danger: ‘fopen("postmaster.opts", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 4094| }
# 4095|
# 4096|-> fprintf(fp, "%s", fullprogname);
# 4097| for (i = 1; i < argc; i++)
# 4098| fprintf(fp, " \"%s\"", argv[i]);
Error: GCC_ANALYZER_WARNING:
postgresql-18.1/src/backend/postmaster/syslogger.c:238:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
postgresql-18.1/src/backend/postmaster/syslogger.c:219:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:221:46: branch_true: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:234:17: release_resource: closed here
postgresql-18.1/src/backend/postmaster/syslogger.c:236:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:238:32: branch_true: ...to here
postgresql-18.1/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:
postgresql-18.1/src/backend/postmaster/syslogger.c:239:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
postgresql-18.1/src/backend/postmaster/syslogger.c:219:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:221:46: branch_true: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:235:17: release_resource: closed here
postgresql-18.1/src/backend/postmaster/syslogger.c:236:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:238:32: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/postmaster/syslogger.c:736:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(syslogPipe[1], 1)’
postgresql-18.1/src/backend/postmaster/syslogger.c:593:1: enter_function: entry to ‘SysLogger_Start’
postgresql-18.1/src/backend/postmaster/syslogger.c:663:20: call_function: calling ‘logfile_getname’ from ‘SysLogger_Start’
postgresql-18.1/src/backend/postmaster/syslogger.c:663:20: return_function: returning to ‘SysLogger_Start’ from ‘logfile_getname’
postgresql-18.1/src/backend/postmaster/syslogger.c:708:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:718:13: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:718:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:729:17: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:736:21: acquire_resource: opened here
postgresql-18.1/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):
postgresql-18.1/src/backend/postmaster/syslogger.c:741:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(syslogPipe[1], 2)’
postgresql-18.1/src/backend/postmaster/syslogger.c:593:1: enter_function: entry to ‘SysLogger_Start’
postgresql-18.1/src/backend/postmaster/syslogger.c:663:20: call_function: calling ‘logfile_getname’ from ‘SysLogger_Start’
postgresql-18.1/src/backend/postmaster/syslogger.c:663:20: return_function: returning to ‘SysLogger_Start’ from ‘logfile_getname’
postgresql-18.1/src/backend/postmaster/syslogger.c:708:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:718:13: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:718:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:729:17: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:736:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:740:17: branch_false: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:741:21: acquire_resource: opened here
postgresql-18.1/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):
postgresql-18.1/src/backend/postmaster/syslogger.c:1517:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("current_logfiles.tmp", "w")’
postgresql-18.1/src/backend/postmaster/syslogger.c:1496:14: acquire_resource: opened here
postgresql-18.1/src/backend/postmaster/syslogger.c:1499:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:1501:17: branch_true: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:1517:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:1519:21: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/postmaster/syslogger.c:1517:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("current_logfiles.tmp", "w")’
postgresql-18.1/src/backend/postmaster/syslogger.c:1496:14: acquire_memory: allocated here
postgresql-18.1/src/backend/postmaster/syslogger.c:1499:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:1501:17: branch_true: ...to here
postgresql-18.1/src/backend/postmaster/syslogger.c:1517:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/postmaster/syslogger.c:1519:21: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/regex/rege_dfa.c:1021:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘<unknown>’
postgresql-18.1/src/backend/regex/rege_dfa.c:985:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/regex/rege_dfa.c:990:9: branch_false: ...to here
postgresql-18.1/src/backend/regex/rege_dfa.c:1002:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/regex/rege_dfa.c:1004:21: branch_true: ...to here
postgresql-18.1/src/backend/regex/rege_dfa.c:1006:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
postgresql-18.1/src/backend/regex/rege_dfa.c:1009:21: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/replication/logical/reorderbuffer.c:5017: error[legacyUninitvar]: Uninitialized variable: chunksize
# 5015| elog(ERROR, "unexpected type of toast chunk");
# 5016|
# 5017|-> ent->size += chunksize;
# 5018| ent->last_chunk_seq = chunk_seq;
# 5019| ent->num_chunks++;
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/backend/replication/repl_gram.c:1113:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/backend/replication/repl_gram.c:1071:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/replication/repl_gram.c:1077:28: branch_true: ...to here
postgresql-18.1/src/backend/replication/repl_gram.c:1100:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/backend/replication/repl_gram.c:1102:7: branch_false: ...to here
postgresql-18.1/src/backend/replication/repl_gram.c:1111:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/replication/repl_gram.c:1113:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/replication/syncrep_gram.c:988:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/backend/replication/syncrep_gram.c:946:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/replication/syncrep_gram.c:952:28: branch_true: ...to here
postgresql-18.1/src/backend/replication/syncrep_gram.c:975:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/backend/replication/syncrep_gram.c:977:7: branch_false: ...to here
postgresql-18.1/src/backend/replication/syncrep_gram.c:986:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/replication/syncrep_gram.c:988:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/statistics/dependencies.c:795:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18.1/src/backend/statistics/dependencies.c:741:1: enter_function: entry to ‘dependency_is_compatible_clause’
postgresql-18.1/src/backend/statistics/dependencies.c:746:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/statistics/dependencies.c:751:21: branch_true: ...to here
postgresql-18.1/src/backend/statistics/dependencies.c:751:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/statistics/dependencies.c:755:36: branch_false: ...to here
postgresql-18.1/src/backend/statistics/dependencies.c:755:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/statistics/dependencies.c:758:17: branch_false: ...to here
postgresql-18.1/src/backend/statistics/dependencies.c:761:13: call_function: inlined call to ‘is_opclause’ from ‘dependency_is_compatible_clause’
postgresql-18.1/src/backend/statistics/dependencies.c:795:18: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/statistics/dependencies.c:1223:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18.1/src/backend/statistics/dependencies.c:1168:1: enter_function: entry to ‘dependency_is_compatible_expression’
postgresql-18.1/src/backend/statistics/dependencies.c:1174:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/statistics/dependencies.c:1179:21: branch_true: ...to here
postgresql-18.1/src/backend/statistics/dependencies.c:1179:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/statistics/dependencies.c:1183:36: branch_false: ...to here
postgresql-18.1/src/backend/statistics/dependencies.c:1183:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/statistics/dependencies.c:1186:17: branch_false: ...to here
postgresql-18.1/src/backend/statistics/dependencies.c:1189:13: call_function: inlined call to ‘is_opclause’ from ‘dependency_is_compatible_expression’
postgresql-18.1/src/backend/statistics/dependencies.c:1223:18: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/statistics/mcv.c:1710:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘clause’
postgresql-18.1/src/backend/statistics/mcv.c:2126:1: enter_function: entry to ‘mcv_clause_selectivity_or’
postgresql-18.1/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):
postgresql-18.1/src/backend/storage/file/fd.c:2928:38: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18.1/src/backend/storage/file/fd.c:2912:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/storage/file/fd.c:2919:9: branch_true: ...to here
postgresql-18.1/src/backend/storage/file/fd.c:2922:20: acquire_memory: allocated here
postgresql-18.1/src/backend/storage/file/fd.c:2928:38: throw: if ‘GetCurrentSubTransactionId’ throws an exception...
postgresql-18.1/src/backend/storage/file/fd.c:2928:38: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 2926| desc->kind = AllocateDescDir;
# 2927| desc->desc.dir = dir;
# 2928|-> desc->create_subid = GetCurrentSubTransactionId();
# 2929| numAllocatedDescs++;
# 2930| return desc->desc.dir;
Error: CPPCHECK_WARNING (CWE-909):
postgresql-18.1/src/backend/storage/lmgr/lmgr.c:729: error[uninitStructMember]: Uninitialized struct member: callback.previous
# 727|
# 728| if (oper != XLTW_None)
# 729|-> error_context_stack = callback.previous;
# 730| }
# 731|
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/backend/storage/page/bufpage.c:523:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*itemidptr.itemoff’
postgresql-18.1/src/backend/storage/page/bufpage.c:698:1: enter_function: entry to ‘PageRepairFragmentation’
postgresql-18.1/src/backend/storage/page/bufpage.c:722:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/storage/page/bufpage.c:724:17: branch_false: ...to here
postgresql-18.1/src/backend/storage/page/bufpage.c:722:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/storage/page/bufpage.c:726:17: branch_false: ...to here
postgresql-18.1/src/backend/storage/page/bufpage.c:722:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/storage/page/bufpage.c:735:17: call_function: inlined call to ‘PageGetMaxOffsetNumber’ from ‘PageRepairFragmentation’
postgresql-18.1/src/backend/storage/page/bufpage.c:735:9: branch_true: ...to here
postgresql-18.1/src/backend/storage/page/bufpage.c:739:37: branch_false: following ‘false’ branch (when ‘i > nline’)...
postgresql-18.1/src/backend/storage/page/bufpage.c:776:30: branch_false: ...to here
postgresql-18.1/src/backend/storage/page/bufpage.c:777:12: branch_false: following ‘false’ branch (when ‘nstorage != 0’)...
postgresql-18.1/src/backend/storage/page/bufpage.c:785:39: branch_false: ...to here
postgresql-18.1/src/backend/storage/page/bufpage.c:785:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/storage/page/bufpage.c:791:17: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/tsearch/ts_parse.c:82:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘res’
postgresql-18.1/src/backend/tsearch/ts_parse.c:540:1: enter_function: entry to ‘hlparsetext’
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3784:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bitmap’
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3782:16: branch_true: following ‘true’ branch (when ‘nelems > 7’)...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3784:21: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3794:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bitmap’
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3779:18: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3782:16: branch_false: following ‘false’ branch (when ‘nelems <= 7’)...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3782:16: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3792:16: branch_true: following ‘true’ branch (when ‘nelems > 0’)...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:3794:22: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:4980:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘destbitmap’
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5703:1: enter_function: entry to ‘makeArrayResultArr’
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5713:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5724:54: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5750:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5751:25: branch_true: ...to here
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5751:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/arrayfuncs.c:5751:25: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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-768):
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1236:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1194:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1200:28: branch_true: ...to here
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1223:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1225:7: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1234:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/jsonpath_gram.c:1236:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/adt/lockfuncs.c:510:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘blocked_instance’
postgresql-18.1/src/backend/utils/adt/lockfuncs.c:483:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/adt/lockfuncs.c:485:43: branch_true: ...to here
postgresql-18.1/src/backend/utils/adt/lockfuncs.c:497:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/lockfuncs.c:509:58: branch_false: ...to here
postgresql-18.1/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: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.currency_symbol’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:568:37: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.currency_symbol’ leaks here; was allocated at [(8)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.decimal_point’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:35: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.decimal_point’ leaks here; was allocated at [(8)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.grouping’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:566:30: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.grouping’ leaks here; was allocated at [(8)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.int_curr_symbol’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:567:37: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.int_curr_symbol’ leaks here; was allocated at [(8)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_decimal_point’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:569:39: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.mon_decimal_point’ leaks here; was allocated at [(8)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_grouping’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:571:34: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.mon_grouping’ leaks here; was allocated at [(8)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.mon_thousands_sep’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:570:39: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.mon_thousands_sep’ leaks here; was allocated at [(8)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.negative_sign’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:573:35: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.negative_sign’ leaks here; was allocated at [(8)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.positive_sign’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:572:35: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.positive_sign’ leaks here; was allocated at [(8)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: warning[-Wanalyzer-malloc-leak]: leak of ‘worklconv.thousands_sep’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:532:1: enter_function: entry to ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:541:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:545:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:555:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:564:42: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:565:35: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: call_function: calling ‘struct_lconv_is_valid’ from ‘PGLC_localeconv’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:14: return_function: returning to ‘PGLC_localeconv’ from ‘struct_lconv_is_valid’
postgresql-18.1/src/backend/utils/adt/pg_locale.c:588:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: branch_false: ...to here
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: throw: if ‘errstart_cold’ throws an exception...
postgresql-18.1/src/backend/utils/adt/pg_locale.c:589:17: danger: ‘worklconv.thousands_sep’ leaks here; was allocated at [(8)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/7)
# 587| /* If any of the preceding strdup calls failed, complain now. */
# 588| if (!struct_lconv_is_valid(&worklconv))
# 589|-> ereport(ERROR,
# 590| (errcode(ERRCODE_OUT_OF_MEMORY),
# 591| errmsg("out of memory")));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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-190):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/adt/xid8funcs.c: scope_hint: In function ‘is_visible_fxid’
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/cache/ts_cache.c:503:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mapdicts’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:385:1: enter_function: entry to ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:424:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:427:43: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:432:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:435:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:487:80: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:497:36: branch_false: following ‘false’ branch (when ‘ndicts <= 0’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:507:47: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:487:80: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/cache/ts_cache.c:530:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mapdicts’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:385:1: enter_function: entry to ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:424:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:427:43: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:432:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:435:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:485:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:487:80: call_function: inlined call to ‘GETSTRUCT’ from ‘lookup_ts_config_cache’
postgresql-18.1/src/backend/utils/cache/ts_cache.c:490:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:492:28: branch_false: following ‘false’ branch (when ‘maxtokentype <= toktype’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:494:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:494:28: branch_true: following ‘true’ branch (when ‘maxtokentype < toktype’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:497:36: branch_true: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:497:36: branch_false: following ‘false’ branch (when ‘ndicts <= 0’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:507:47: branch_false: ...to here
postgresql-18.1/src/backend/utils/cache/ts_cache.c:523:20: branch_true: following ‘true’ branch (when ‘ndicts > 0’)...
postgresql-18.1/src/backend/utils/cache/ts_cache.c:526:25: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/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: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/backend/utils/error/elog.c:1168:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/utils/error/elog.c:752:1: enter_function: entry to ‘get_error_stack_entry’
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/error/elog.c:1681:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/utils/error/elog.c:2242:1: enter_function: entry to ‘check_log_destination’
postgresql-18.1/src/backend/utils/error/elog.c:2254:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/error/elog.c:2257:17: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/error/elog.c:3806:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/utils/error/elog.c:3782:1: enter_function: entry to ‘write_stderr’
postgresql-18.1/src/backend/utils/error/elog.c:3786:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/backend/utils/error/elog.c:3787:9: call_function: calling ‘vwrite_stderr’ from ‘write_stderr’
# 3804| #ifndef WIN32
# 3805| /* On Unix, we just fprintf to stderr */
# 3806|-> vfprintf(stderr, fmt, ap);
# 3807| fflush(stderr);
# 3808| #else
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/backend/utils/error/jsonlog.c:88:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/utils/error/jsonlog.c:87:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/backend/utils/error/jsonlog.c:88:26: throw: if ‘pvsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/init/postinit.c:1295:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/utils/init/postinit.c:1244:1: enter_function: entry to ‘process_startup_options’
postgresql-18.1/src/backend/utils/init/postinit.c:1286:19: call_function: inlined call to ‘list_head’ from ‘process_startup_options’
postgresql-18.1/src/backend/utils/init/postinit.c:1287:16: branch_true: following ‘true’ branch (when ‘gucopts’ is non-NULL)...
postgresql-18.1/src/backend/utils/init/postinit.c:1292:17: branch_true: ...to here
postgresql-18.1/src/backend/utils/init/postinit.c:1295:17: danger: dereference of NULL ‘<unknown>’
# 1293| gucopts = lnext(port->guc_options, gucopts);
# 1294|
# 1295|-> value = lfirst(gucopts);
# 1296| gucopts = lnext(port->guc_options, gucopts);
# 1297|
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/backend/utils/misc/guc.c:5994:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/backend/utils/misc/guc.c:5990:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/misc/guc.c:5993:9: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/guc.c:5993:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/backend/utils/misc/guc.c:5994:13: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/src/backend/utils/misc/guc.c:5994:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 5992|
# 5993| va_start(vargs, fmt);
# 5994|-> n = vsnprintf(*destptr, *maxbytes, fmt, vargs);
# 5995| va_end(vargs);
# 5996|
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/backend/utils/misc/guc.c:6677:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘eqsgn’
postgresql-18.1/src/backend/utils/misc/guc.c:6649:12: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/guc.c:6653:13: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/guc.c:6653:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/misc/guc.c:6657:9: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/guc.c:6659:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/guc.c:6666:21: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/guc.c:6677:17: danger: dereference of NULL ‘eqsgn’
# 6675|
# 6676| eqsgn = strchr(val, '=');
# 6677|-> *eqsgn = '\0';
# 6678|
# 6679| /* skip if we have permission to delete it */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/backend/utils/misc/ps_status.c:203:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18.1/src/backend/utils/misc/ps_status.c:138:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:140:28: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:140:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:141:51: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:144:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:144:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:193:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:193:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:198:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:200:36: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:200:42: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/misc/ps_status.c:201:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:198:49: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:198:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:200:36: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:201:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:203:33: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:203:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/misc/ps_status.c:203:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_environ’
postgresql-18.1/src/backend/utils/misc/ps_status.c:138:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:140:28: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:140:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:141:51: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:144:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:144:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:192:41: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/misc/ps_status.c:193:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:193:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:198:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:200:36: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:201:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:203:33: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:203:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/misc/ps_status.c:238:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_argv’
postgresql-18.1/src/backend/utils/misc/ps_status.c:138:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:140:28: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:140:28: branch_true: following ‘true’ branch (when ‘i == 0’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:141:51: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:144:20: branch_false: following ‘false’ branch (when ‘end_of_area’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:144:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:193:20: branch_false: following ‘false’ branch (when ‘new_environ’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:193:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:198:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:207:28: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:227:38: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/misc/ps_status.c:228:20: branch_false: following ‘false’ branch (when ‘new_argv’ is non-NULL)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:228:20: branch_false: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:233:29: branch_true: following ‘true’ branch (when ‘i < argc’)...
postgresql-18.1/src/backend/utils/misc/ps_status.c:235:50: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:236:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/misc/ps_status.c:238:33: branch_true: ...to here
postgresql-18.1/src/backend/utils/misc/ps_status.c:238:33: throw: if ‘write_stderr’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/mmgr/aset.c:513:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18.1/src/backend/utils/mmgr/aset.c:444:26: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/mmgr/aset.c:445:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18.1/src/backend/utils/mmgr/aset.c:462:9: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/aset.c:513:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/mmgr/aset.c:919:38: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
postgresql-18.1/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18.1/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18.1/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/aset.c:919:38: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/mmgr/aset.c:914:16: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/mmgr/aset.c:916:17: branch_true: ...to here
postgresql-18.1/src/backend/utils/mmgr/aset.c:917:20: branch_false: following ‘false’ branch (when ‘required_size <= blksize’)...
postgresql-18.1/src/backend/utils/mmgr/aset.c:919:38: branch_false: ...to here
postgresql-18.1/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-457):
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1441:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘result.index’
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1476:1: enter_function: entry to ‘FreePageManagerPutInternal’
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1489:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1491:21: branch_true: ...to here
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1491:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1499:26: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1499:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1509:26: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1509:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1525:30: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1527:33: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1527:33: branch_false: following ‘false’ branch (when ‘soft == 0’)...
postgresql-18.1/src/backend/utils/mmgr/freepage.c:1529:34: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/mmgr/generation.c:262:9: warning[-Wanalyzer-malloc-leak]: leak of ‘set’
postgresql-18.1/src/backend/utils/mmgr/generation.c:160:1: enter_function: entry to ‘GenerationContextCreate’
postgresql-18.1/src/backend/utils/mmgr/generation.c:209:37: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/mmgr/generation.c:210:12: branch_false: following ‘false’ branch (when ‘set’ is non-NULL)...
postgresql-18.1/src/backend/utils/mmgr/generation.c:224:9: call_function: inlined call to ‘dlist_init’ from ‘GenerationContextCreate’
postgresql-18.1/src/backend/utils/mmgr/generation.c:257:16: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/utils/mmgr/generation.c:262:9: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/generation.c:262:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/backend/utils/mmgr/slab.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘slab’
postgresql-18.1/src/backend/utils/mmgr/slab.c:322:1: enter_function: entry to ‘SlabContextCreate’
postgresql-18.1/src/backend/utils/mmgr/slab.c:358:12: branch_false: following ‘false’ branch (when ‘chunksPerBlock != 0’)...
postgresql-18.1/src/backend/utils/mmgr/slab.c:364:32: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/slab.c:364:32: acquire_memory: allocated here
postgresql-18.1/src/backend/utils/mmgr/slab.c:365:12: branch_false: following ‘false’ branch (when ‘slab’ is non-NULL)...
postgresql-18.1/src/backend/utils/mmgr/slab.c:381:27: branch_false: ...to here
postgresql-18.1/src/backend/utils/mmgr/slab.c:405:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
postgresql-18.1/src/backend/utils/mmgr/slab.c:406:17: call_function: inlined call to ‘dlist_init’ from ‘SlabContextCreate’
postgresql-18.1/src/backend/utils/mmgr/slab.c:414:9: throw: if ‘MemoryContextCreate’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/initdb/initdb.c:687:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18.1/src/bin/initdb/initdb.c:684:23: acquire_resource: opened here
postgresql-18.1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:687:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/initdb/initdb.c:690:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18.1/src/bin/initdb/initdb.c:684:23: acquire_resource: opened here
postgresql-18.1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:690:28: throw: if ‘pg_malloc’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/initdb/initdb.c:693:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
postgresql-18.1/src/bin/initdb/initdb.c:684:23: acquire_resource: opened here
postgresql-18.1/src/bin/initdb/initdb.c:684:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:687:9: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:693:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/initdb/initdb.c:730:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
postgresql-18.1/src/bin/initdb/initdb.c:728:25: acquire_resource: opened here
postgresql-18.1/src/bin/initdb/initdb.c:728:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:728:12: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:730:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:732:21: branch_true: ...to here
postgresql-18.1/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-775):
postgresql-18.1/src/bin/initdb/initdb.c:1036:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
postgresql-18.1/src/bin/initdb/initdb.c:1034:29: acquire_resource: opened here
postgresql-18.1/src/bin/initdb/initdb.c:1034:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:1036:13: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:1036:13: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/initdb/initdb.c:1694:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(pwfilename, "r")’
postgresql-18.1/src/bin/initdb/initdb.c:1661:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:1689:35: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:1689:35: acquire_resource: opened here
postgresql-18.1/src/bin/initdb/initdb.c:1691:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/initdb/initdb.c:1694:24: branch_false: ...to here
postgresql-18.1/src/bin/initdb/initdb.c:1694:24: throw: if ‘pg_get_line’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_basebackup/pg_basebackup.c:1021:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘state.file’
postgresql-18.1/src/bin/pg_basebackup/pg_basebackup.c:1699:1: enter_function: entry to ‘ReceiveBackupManifest’
postgresql-18.1/src/bin/pg_basebackup/pg_basebackup.c:1705:22: acquire_resource: opened here
postgresql-18.1/src/bin/pg_basebackup/pg_basebackup.c:1706:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_basebackup/pg_basebackup.c:1709:9: branch_false: ...to here
postgresql-18.1/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-404):
postgresql-18.1/src/bin/pg_ctl/pg_ctl.c:209:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_ctl/pg_ctl.c:1965:1: enter_function: entry to ‘do_advice’
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_dump/compress_gzip.c:389:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(fd)’
postgresql-18.1/src/bin/pg_dump/compress_gzip.c:388:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18.1/src/bin/pg_dump/compress_gzip.c:389:24: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/compress_gzip.c:389:24: acquire_resource: opened here
postgresql-18.1/src/bin/pg_dump/compress_gzip.c:389:24: danger: ‘dup(fd)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 387|
# 388| if (fd >= 0)
# 389|-> gzfp = gzdopen(dup(fd), mode_compression);
# 390| else
# 391| gzfp = gzopen(path, mode_compression);
Error: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/src/bin/pg_dump/parallel.c:506: warning[nullPointer]: Possible null pointer dereference: slot
# 504| /* On all platforms, update workerStatus and te[] as well */
# 505| Assert(j < pstate->numWorkers);
# 506|-> slot->workerStatus = WRKR_TERMINATED;
# 507| pstate->te[j] = NULL;
# 508| }
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/bin/pg_dump/parallel.c:506:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘slot’
postgresql-18.1/src/bin/pg_dump/parallel.c:1061:1: enter_function: entry to ‘ParallelBackupEnd’
postgresql-18.1/src/bin/pg_dump/parallel.c:1066:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:1066:12: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:1073:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:1075:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:1073:21: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:1080:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:1080:9: call_function: calling ‘WaitForTerminatingWorkers’ from ‘ParallelBackupEnd’
# 504| /* On all platforms, update workerStatus and te[] as well */
# 505| Assert(j < pstate->numWorkers);
# 506|-> slot->workerStatus = WRKR_TERMINATED;
# 507| pstate->te[j] = NULL;
# 508| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipeMW[0]’
postgresql-18.1/src/bin/pg_dump/parallel.c:899:1: enter_function: entry to ‘ParallelBackupStart’
postgresql-18.1/src/bin/pg_dump/parallel.c:912:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:917:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:941:9: call_function: calling ‘set_archive_cancel_info’ from ‘ParallelBackupStart’
postgresql-18.1/src/bin/pg_dump/parallel.c:941:9: return_function: returning to ‘ParallelBackupStart’ from ‘set_archive_cancel_info’
postgresql-18.1/src/bin/pg_dump/parallel.c:947:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:955:40: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:960:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:960:43: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:960:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: danger: ‘pipeMW[0]’ leaks here
# 959| /* Create communication pipes for this worker */
# 960| if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0)
# 961|-> pg_fatal("could not create communication channels: %m");
# 962|
# 963| /* leader's ends of the pipes */
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipeMW[1]’
postgresql-18.1/src/bin/pg_dump/parallel.c:899:1: enter_function: entry to ‘ParallelBackupStart’
postgresql-18.1/src/bin/pg_dump/parallel.c:912:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:917:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:941:9: call_function: calling ‘set_archive_cancel_info’ from ‘ParallelBackupStart’
postgresql-18.1/src/bin/pg_dump/parallel.c:941:9: return_function: returning to ‘ParallelBackupStart’ from ‘set_archive_cancel_info’
postgresql-18.1/src/bin/pg_dump/parallel.c:947:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:955:40: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:960:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:960:43: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:960:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18.1/src/bin/pg_dump/parallel.c:961:25: danger: ‘pipeMW[1]’ leaks here
# 959| /* Create communication pipes for this worker */
# 960| if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0)
# 961|-> pg_fatal("could not create communication channels: %m");
# 962|
# 963| /* leader's ends of the pipes */
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:1773:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:4292:1: enter_function: entry to ‘dumpTimestamp’
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:4296:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:4297:17: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:4297:17: call_function: calling ‘ahprintf’ from ‘dumpTimestamp’
# 1771| errno = save_errno;
# 1772| va_start(args, fmt);
# 1773|-> cnt = pvsnprintf(p, len, fmt, args);
# 1774| va_end(args);
# 1775|
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:1934:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:3579:1: enter_function: entry to ‘_selectOutputSchema’
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:3610:25: call_function: calling ‘warn_or_exit_horribly’ from ‘_selectOutputSchema’
# 1932|
# 1933| va_start(ap, fmt);
# 1934|-> pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, fmt, ap);
# 1935| va_end(ap);
# 1936|
Error: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/src/bin/pg_dump/pg_backup_archiver.c:2303: warning[nullPointer]: Possible null pointer dereference: fh
# 2301| }
# 2302|
# 2303|-> if ((cnt = fread(sig, 1, 5, fh)) != 5)
# 2304| {
# 2305| if (ferror(fh))
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/bin/pg_dump/pg_backup_tar.c:971:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_dump/pg_backup_tar.c:970:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_dump/pg_backup_tar.c:971:23: throw: if ‘pvsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_dump/pg_dump.c:1586: error[legacyUninitvar]: Uninitialized variable: archiveFormat
# 1584| else
# 1585| pg_fatal("invalid output format \"%s\" specified", format);
# 1586|-> return archiveFormat;
# 1587| }
# 1588|
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13420:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘probin’
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13301:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13304:17: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13309:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13379:43: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13384:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13394:30: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13416:12: branch_false: following ‘false’ branch (when ‘prosqlbody’ is NULL)...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13420:18: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:13420:18: danger: dereference of NULL ‘probin’
#13418| appendPQExpBufferStr(asPart, prosqlbody);
#13419| }
#13420|-> else if (probin[0] != '\0')
#13421| {
#13422| appendPQExpBufferStr(asPart, "AS ");
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14897:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘collcollate’
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14818:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14821:17: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14881:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14886:14: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14886:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14895:13: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14895:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14897:21: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14897:21: danger: dereference of NULL ‘collcollate’
#14895| if (fout->remoteVersion < 150000)
#14896| {
#14897|-> if (collcollate[0] == '\0')
#14898| collcollate = NULL;
#14899| if (collctype[0] == '\0')
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14899:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘collctype’
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14818:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14821:17: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14881:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14882:31: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14886:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14895:13: branch_false: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14895:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14897:21: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14897:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14897:20: branch_true: ...to here
postgresql-18.1/src/bin/pg_dump/pg_dump.c:14899:21: danger: dereference of NULL ‘collctype’
#14897| if (collcollate[0] == '\0')
#14898| collcollate = NULL;
#14899|-> if (collctype[0] == '\0')
#14900| collctype = NULL;
#14901| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:553:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_resource: opened here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:553:22: branch_true: ...to here
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:560:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_resource: opened here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:560:16: branch_false: ...to here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:560:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:562:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("PG_VERSION", "r")’
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:546:23: acquire_resource: opened here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:546:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:551:14: branch_false: ...to here
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:551:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_resetwal/pg_resetwal.c:560:16: branch_false: ...to here
postgresql-18.1/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-404):
postgresql-18.1/src/bin/pg_rewind/xlogreader.c:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_rewind/xlogreader.c:78:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_rewind/xlogreader.c:79:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: danger: infinite loop here
postgresql-18.1/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-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:316:31: branch_true: ...to here
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:318:42: branch_false: when ‘writes >= writes_per_op’: always following ‘false’ branch...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: danger: infinite loop here
postgresql-18.1/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-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:419:31: branch_true: ...to here
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:421:42: branch_false: when ‘writes >= writes_per_op’: always following ‘false’ branch...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: warning[-Wanalyzer-infinite-loop]: infinite loop
postgresql-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: danger: infinite loop here
postgresql-18.1/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-18.1/src/bin/pg_test_fsync/pg_test_fsync.c:484:31: branch_true: ...to here
postgresql-18.1/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-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/check.c:1043:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*deletion_script_file_name, "w")’
postgresql-18.1/src/bin/pg_upgrade/check.c:998:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/check.c:998:12: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1037:23: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/check.c:1037:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/check.c:1043:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1043:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/bin/pg_upgrade/check.c:1043: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)
# 1041| #ifndef WIN32
# 1042| /* add shebang header */
# 1043|-> fprintf(script, "#!/bin/sh\n\n");
# 1044| #endif
# 1045|
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/pg_upgrade/check.c:1191:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/check.c:1166:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/check.c:1168:39: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1188:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/check.c:1188:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1188:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/check.c:1188:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/check.c:1191:33: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1191:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/bin/pg_upgrade/check.c:1191:33: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 1189| pg_fatal("could not open file \"%s\": %m", output_path);
# 1190|
# 1191|-> fprintf(script, "%s\n", datname);
# 1192| }
# 1193| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/pg_upgrade/check.c:1758:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/check.c:1754:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/check.c:1756:20: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1756:20: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/check.c:1756:49: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1756:49: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/check.c:1756:21: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/check.c:1758:17: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/check.c:1758:17: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18.1/src/bin/pg_upgrade/check.c:1758:17: danger: ‘script’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 1756| if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
# 1757| pg_fatal("could not open file \"%s\": %m", output_path);
# 1758|-> fprintf(script, "%s (oid=%s)\n",
# 1759| PQgetvalue(res, rowno, i_rolname),
# 1760| PQgetvalue(res, rowno, i_roloid));
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/bin/pg_upgrade/exec.c:109:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_upgrade/exec.c:108:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_upgrade/exec.c:109:20: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/exec.c:167:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&log_file, "a")’
postgresql-18.1/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18.1/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:138:15: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:167:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/exec.c:219:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&log_file, "a")’
postgresql-18.1/src/bin/pg_upgrade/exec.c:111:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/exec.c:113:44: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:115:12: branch_false: following ‘false’ branch (when ‘written <= 2047’)...
postgresql-18.1/src/bin/pg_upgrade/exec.c:118:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:159:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/exec.c:167:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:189:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/exec.c:217:20: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:217:20: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/exec.c:217:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/exec.c:219:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/exec.c:219:9: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/function.c:209:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/function.c:187:26: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/function.c:189:35: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/function.c:195:20: branch_true: following ‘true’ branch (when ‘libnum == 0’)...
postgresql-18.1/src/bin/pg_upgrade/function.c:197:25: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/function.c:203:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/function.c:207:36: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/function.c:207:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/function.c:207:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/function.c:207:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/function.c:207:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/function.c:209:33: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/function.c:209:33: throw: if ‘PQerrorMessage’ throws an exception...
postgresql-18.1/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-476):
postgresql-18.1/src/bin/pg_upgrade/info.c:216:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rel’
postgresql-18.1/src/bin/pg_upgrade/info.c:45:1: enter_function: entry to ‘gen_db_file_maps’
postgresql-18.1/src/bin/pg_upgrade/info.c:65:16: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/info.c:68:39: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/info.c:68:39: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/info.c:70:53: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/info.c:74:20: branch_true: following ‘true’ branch (when ‘new_rel’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/info.c:80:25: branch_true: ...to here
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18.1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:518:27: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/option.c:535:52: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18.1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:518:27: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:532:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:532:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:523:26: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:535:52: throw: if ‘pg_strdup’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/option.c:536:40: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "r")’
postgresql-18.1/src/bin/pg_upgrade/option.c:502:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:502:13: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:502:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:510:32: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:518:27: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/option.c:518:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:518:20: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: following ‘false’ branch (when ‘lineno != 4’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:532:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:532:28: branch_false: following ‘false’ branch (when ‘lineno != 5’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:523:26: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:522:26: branch_true: following ‘true’ branch (when ‘lineno != 6’)...
postgresql-18.1/src/bin/pg_upgrade/option.c:525:29: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:525:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/option.c:530:28: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/option.c:536:40: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18.1/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-404):
postgresql-18.1/src/bin/pg_upgrade/parallel.c:76:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_upgrade/parallel.c:75:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_upgrade/parallel.c:76:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:327:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename_path, "a")’
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:266:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:270:9: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:279:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:283:37: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:286:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:290:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:293:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:300:13: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:302:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:304:13: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:304:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:306:13: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:306:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:309:15: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:311:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:314:34: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:314:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:314:12: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:318:39: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:320:23: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:322:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:324:27: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:324:27: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:324:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:327:17: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/pg_upgrade.c:327:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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-404):
postgresql-18.1/src/bin/pg_upgrade/server.c:130:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_upgrade/server.c:129:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_upgrade/server.c:130:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/util.c:135:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_upgrade/util.c:134:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_upgrade/util.c:135:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/util.c:162:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_upgrade/util.c:161:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_upgrade/util.c:162:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/util.c:184:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_upgrade/util.c:270:1: enter_function: entry to ‘pg_fatal’
postgresql-18.1/src/bin/pg_upgrade/util.c:274:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: throw: if ‘initPQExpBuffer’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/version.c:85:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:85:41: throw: if ‘appendPsqlMetaConnect’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/version.c:87:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:87:41: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/version.c:90:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:90:33: throw: if ‘quote_identifier’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/version.c:91:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:91:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_upgrade/version.c:92:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘script’
postgresql-18.1/src/bin/pg_upgrade/version.c:46:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:54:42: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:73:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:76:28: branch_false: following ‘false’ branch (when ‘check_mode == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:36: branch_true: following ‘true’ branch (when ‘script’ is NULL)...
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: branch_true: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:65: acquire_resource: opened here
postgresql-18.1/src/bin/pg_upgrade/version.c:78:37: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:80:36: branch_false: following ‘false’ branch (when ‘db_used == 0’)...
postgresql-18.1/src/bin/pg_upgrade/version.c:84:41: branch_false: ...to here
postgresql-18.1/src/bin/pg_upgrade/version.c:92:66: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18.1/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-404):
postgresql-18.1/src/bin/pg_verifybackup/pg_verifybackup.c:1236:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_verifybackup/pg_verifybackup.c:1235:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_verifybackup/pg_verifybackup.c:1236:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/pg_verifybackup/pg_verifybackup.c:1253:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_verifybackup/pg_verifybackup.c:1252:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_verifybackup/pg_verifybackup.c:1253:9: throw: if ‘pg_log_generic_v’ throws an exception...
postgresql-18.1/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: COMPILER_WARNING (CWE-704):
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c: scope_hint: In function ‘split_path’
postgresql-18.1/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):
postgresql-18.1/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-775):
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:534:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, "w")’
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:494:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:505:22: branch_true: ...to here
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:508:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:514:22: branch_true: ...to here
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:514:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:517:24: branch_true: ...to here
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:520:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:521:50: branch_true: ...to here
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:530:24: acquire_resource: opened here
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:531:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/pg_waldump/pg_waldump.c:534:21: branch_false: ...to here
postgresql-18.1/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-404):
postgresql-18.1/src/bin/pg_waldump/xlogreader.c:79:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/pg_waldump/xlogreader.c:78:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/pg_waldump/xlogreader.c:79:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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-457):
postgresql-18.1/src/bin/pgbench/exprparse.c:1117:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/bin/pgbench/exprparse.c:1075:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/pgbench/exprparse.c:1081:28: branch_true: ...to here
postgresql-18.1/src/bin/pgbench/exprparse.c:1104:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/bin/pgbench/exprparse.c:1106:7: branch_false: ...to here
postgresql-18.1/src/bin/pgbench/exprparse.c:1115:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18.1/src/bin/pgbench/exprparse.c:1117:9: branch_false: ...to here
postgresql-18.1/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-476):
postgresql-18.1/src/bin/pgbench/exprscan.c:2033:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18.1/src/bin/pgbench/exprscan.l:319:1: enter_function: entry to ‘expr_lex_one_word’
postgresql-18.1/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: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/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: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:3321:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18.1/src/bin/psql/command.c:3268:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18.1/src/bin/psql/command.c:3270:37: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:3275:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18.1/src/bin/psql/command.c:3282:28: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3282:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:3289:33: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3290:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:3299:41: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3300:46: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:3302:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18.1/src/bin/psql/command.c:3320:42: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3320:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/command.c:3321:33: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:3321:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:3321:33: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 3319| */
# 3320| if (query_buf && query_buf->len > 0)
# 3321|-> fprintf(fd, "%s\n", query_buf->data);
# 3322| else if (previous_buf && previous_buf->len > 0)
# 3323| fprintf(fd, "%s\n", previous_buf->data);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:3323:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18.1/src/bin/psql/command.c:3268:12: branch_true: following ‘true’ branch (when ‘active_branch != 0’)...
postgresql-18.1/src/bin/psql/command.c:3270:37: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:3275:20: branch_false: following ‘false’ branch (when ‘query_buf’ is non-NULL)...
postgresql-18.1/src/bin/psql/command.c:3282:28: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3282:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:3289:33: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3290:36: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:3299:41: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3300:46: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:3302:36: branch_false: following ‘false’ branch (when ‘fd’ is non-NULL)...
postgresql-18.1/src/bin/psql/command.c:3320:42: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3320:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:3322:33: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:3322:33: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/command.c:3323:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:3323:33: danger: ‘fd’ leaks here; was opened at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 3321| fprintf(fd, "%s\n", query_buf->data);
# 3322| else if (previous_buf && previous_buf->len > 0)
# 3323|-> fprintf(fd, "%s\n", previous_buf->data);
# 3324|
# 3325| if (is_pipe)
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:4862:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18.1/src/bin/psql/command.c:4830:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4838:26: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4840:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4851:26: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:4852:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4862:25: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4862:25: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:4862:25: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 4860| char line[1024];
# 4861|
# 4862|-> resetPQExpBuffer(query_buf);
# 4863| while (fgets(line, sizeof(line), stream) != NULL)
# 4864| appendPQExpBufferStr(query_buf, line);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:4864:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18.1/src/bin/psql/command.c:4830:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4838:26: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4840:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4851:26: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:4852:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4862:25: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4863:32: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/command.c:4864:33: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:4864:33: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:4864:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 4862| resetPQExpBuffer(query_buf);
# 4863| while (fgets(line, sizeof(line), stream) != NULL)
# 4864|-> appendPQExpBufferStr(query_buf, line);
# 4865|
# 4866| if (ferror(stream))
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:4868:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18.1/src/bin/psql/command.c:4830:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4838:26: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4840:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4851:26: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:4852:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4862:25: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4866:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/command.c:4868:33: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:4868:33: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:4868:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 4866| if (ferror(stream))
# 4867| {
# 4868|-> pg_log_error("%s: %m", fname);
# 4869| error = true;
# 4870| resetPQExpBuffer(query_buf);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:4870:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
postgresql-18.1/src/bin/psql/command.c:4830:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4838:26: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4840:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4851:26: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:4852:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4862:25: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4866:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/command.c:4868:33: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:4870:33: throw: if ‘resetPQExpBuffer’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:4870:33: danger: ‘fopen(fname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 4868| pg_log_error("%s: %m", fname);
# 4869| error = true;
# 4870|-> resetPQExpBuffer(query_buf);
# 4871| }
# 4872| else if (edited)
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:4966:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18.1/src/bin/psql/command.c:4923:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18.1/src/bin/psql/command.c:4928:18: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4928:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18.1/src/bin/psql/command.c:4930:17: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:4949:22: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:4951:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4963:9: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4966:9: throw: if ‘pg_logging_config’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:4966:9: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 4964| pset.inputfile = filename;
# 4965|
# 4966|-> pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4967|
# 4968| result = MainLoop(fd);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18.1/src/bin/psql/command.c:4968:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fd’
postgresql-18.1/src/bin/psql/command.c:4923:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
postgresql-18.1/src/bin/psql/command.c:4928:18: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4928:17: branch_true: following ‘true’ branch (when the strings are non-equal)...
postgresql-18.1/src/bin/psql/command.c:4930:17: branch_true: ...to here
postgresql-18.1/src/bin/psql/command.c:4949:22: acquire_resource: opened here
postgresql-18.1/src/bin/psql/command.c:4951:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/command.c:4963:9: branch_false: ...to here
postgresql-18.1/src/bin/psql/command.c:4968:18: throw: if ‘MainLoop’ throws an exception...
postgresql-18.1/src/bin/psql/command.c:4968:18: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
# 4966| pg_logging_config(pset.inputfile ? 0 : PG_LOG_FLAG_TERSE);
# 4967|
# 4968|-> result = MainLoop(fd);
# 4969|
# 4970| if (fd != stdin)
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/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):
postgresql-18.1/src/bin/psql/crosstabview.c:369:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/bin/psql/crosstabview.c:350:22: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/crosstabview.c:359:22: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/bin/psql/input.c:520:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘output’
postgresql-18.1/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18.1/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18.1/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18.1/src/bin/psql/input.c:511:26: acquire_resource: opened here
postgresql-18.1/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18.1/src/bin/psql/input.c:520:9: throw: if ‘history_set_pos’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/bin/psql/input.c:522:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘output’
postgresql-18.1/src/bin/psql/input.c:500:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/input.c:503:12: branch_true: ...to here
postgresql-18.1/src/bin/psql/input.c:503:12: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
postgresql-18.1/src/bin/psql/input.c:511:26: branch_false: ...to here
postgresql-18.1/src/bin/psql/input.c:511:26: acquire_resource: opened here
postgresql-18.1/src/bin/psql/input.c:512:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/input.c:520:9: branch_false: ...to here
postgresql-18.1/src/bin/psql/input.c:520:9: branch_true: following ‘true’ branch (when ‘cur_hist’ is non-NULL)...
postgresql-18.1/src/bin/psql/input.c:522:17: branch_true: ...to here
postgresql-18.1/src/bin/psql/input.c:522:17: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/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-404):
postgresql-18.1/src/bin/psql/large_obj.c:29:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/psql/large_obj.c:23:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/bin/psql/large_obj.c:25:21: branch_false: ...to here
postgresql-18.1/src/bin/psql/large_obj.c:28:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/psql/large_obj.c:29:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/bin/psql/large_obj.c:41:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/bin/psql/large_obj.c:38:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/bin/psql/large_obj.c:40:17: branch_true: ...to here
postgresql-18.1/src/bin/psql/large_obj.c:40:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/bin/psql/large_obj.c:41:17: throw: if ‘pg_vfprintf’ throws an exception...
postgresql-18.1/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-476):
postgresql-18.1/src/bin/psql/psqlscanslash.c:2516:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18.1/src/bin/psql/psqlscanslash.l:679:1: enter_function: entry to ‘psql_scan_slash_command_end’
postgresql-18.1/src/bin/psql/psqlscanslash.l:689:10: call_function: calling ‘slash_yy_switch_to_buffer’ from ‘psql_scan_slash_command_end’
postgresql-18.1/src/bin/psql/psqlscanslash.l:689:10: return_function: returning to ‘psql_scan_slash_command_end’ from ‘slash_yy_switch_to_buffer’
postgresql-18.1/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: CPPCHECK_WARNING (CWE-562):
postgresql-18.1/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):
postgresql-18.1/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: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/src/bin/psql/tab-complete.in.c:2624: warning[uninitvar]: Uninitialized variable: argarray
# 2622| /* ALTER VIEW xxx ALTER [ COLUMN ] yyy */
# 2623| else if (Matches("ALTER", "VIEW", MatchAny, "ALTER", MatchAny) ||
# 2624|-> Matches("ALTER", "VIEW", MatchAny, "ALTER", "COLUMN", MatchAny))
# 2625| COMPLETE_WITH("SET DEFAULT", "DROP DEFAULT");
# 2626| /* ALTER VIEW xxx RENAME yyy */
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18.1/src/bin/psql/tab-complete.in.c:2712: warning[uninitvar]: Uninitialized variable: argarray
# 2710| COMPLETE_WITH("RENAME TO");
# 2711|
# 2712|-> /* ALTER STATISTICS <name> */
# 2713| else if (Matches("ALTER", "STATISTICS", MatchAny))
# 2714| COMPLETE_WITH("OWNER TO", "RENAME TO", "SET SCHEMA", "SET STATISTICS");
Error: COMPILER_WARNING (CWE-704):
postgresql-18.1/src/common/compression.c: scope_hint: In function ‘parse_compress_options’
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/common/cryptohash_openssl.c:148:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18.1/src/common/cryptohash_openssl.c:135:15: acquire_memory: allocated here
postgresql-18.1/src/common/cryptohash_openssl.c:136:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18.1/src/common/cryptohash_openssl.c:136:12: branch_false: ...to here
postgresql-18.1/src/common/cryptohash_openssl.c:148:9: throw: if ‘ERR_clear_error’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/common/file_utils.c:308:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18.1/src/common/file_utils.c:301:15: acquire_memory: allocated here
postgresql-18.1/src/common/file_utils.c:302:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/file_utils.c:302:12: branch_false: ...to here
postgresql-18.1/src/common/file_utils.c:308:33: throw: if ‘readdir’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/hmac_openssl.c:136:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18.1/src/common/hmac_openssl.c:121:15: acquire_memory: allocated here
postgresql-18.1/src/common/hmac_openssl.c:122:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18.1/src/common/hmac_openssl.c:124:9: branch_false: ...to here
postgresql-18.1/src/common/hmac_openssl.c:136:9: throw: if ‘ERR_clear_error’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/hmac_openssl.c:142:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18.1/src/common/hmac_openssl.c:121:15: acquire_memory: allocated here
postgresql-18.1/src/common/hmac_openssl.c:122:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18.1/src/common/hmac_openssl.c:124:9: branch_false: ...to here
postgresql-18.1/src/common/hmac_openssl.c:142:24: throw: if ‘HMAC_CTX_new’ throws an exception...
postgresql-18.1/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-404):
postgresql-18.1/src/common/logging.c:242:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18.1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/logging.c:245:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18.1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/logging.c:248:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18.1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/logging.c:255:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18.1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/logging.c:257:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18.1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/logging.c:260:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:208:1: enter_function: entry to ‘pg_log_generic’
postgresql-18.1/src/common/logging.c:213:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/logging.c:314:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/logging.c:235:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/logging.c:242:9: branch_false: ...to here
postgresql-18.1/src/common/logging.c:247:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/logging.c:250:15: branch_false: ...to here
postgresql-18.1/src/common/logging.c:252:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/logging.c:269:14: branch_false: ...to here
postgresql-18.1/src/common/logging.c:313:9: acquire_resource: ‘va_copy’ called here
postgresql-18.1/src/common/logging.c:314:24: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:80:15: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:83:27: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:87:13: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:88:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:89:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:91:27: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:92:17: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/md5_common.c:97:9: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_buf’
postgresql-18.1/src/common/md5_common.c:145:1: enter_function: entry to ‘pg_md5_encrypt’
postgresql-18.1/src/common/md5_common.c:151:33: acquire_memory: allocated here
postgresql-18.1/src/common/md5_common.c:154:12: branch_false: following ‘false’ branch (when ‘crypt_buf’ is non-NULL)...
postgresql-18.1/src/common/md5_common.c:164:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/percentrepl.c:106:57: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/percentrepl.c:65:38: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/percentrepl.c:67:20: branch_true: ...to here
postgresql-18.1/src/common/percentrepl.c:75:33: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/percentrepl.c:95:33: branch_false: ...to here
postgresql-18.1/src/common/percentrepl.c:97:33: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/common/percentrepl.c:98:64: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/percentrepl.c:100:53: branch_true: ...to here
postgresql-18.1/src/common/percentrepl.c:104:52: branch_true: following ‘true’ branch (when ‘val’ is non-NULL)...
postgresql-18.1/src/common/percentrepl.c:106:57: branch_true: ...to here
postgresql-18.1/src/common/percentrepl.c:106:57: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/pgfnames.c:52:31: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18.1/src/common/pgfnames.c:45:15: acquire_memory: allocated here
postgresql-18.1/src/common/pgfnames.c:46:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/pgfnames.c:52:31: branch_false: ...to here
postgresql-18.1/src/common/pgfnames.c:52:31: throw: if ‘palloc’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/pgfnames.c:54:35: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18.1/src/common/pgfnames.c:45:15: acquire_memory: allocated here
postgresql-18.1/src/common/pgfnames.c:46:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/pgfnames.c:52:31: branch_false: ...to here
postgresql-18.1/src/common/pgfnames.c:54:35: throw: if ‘readdir’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/psprintf.c:107:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/psprintf.c:43:1: enter_function: entry to ‘psprintf’
postgresql-18.1/src/common/psprintf.c:62:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/common/rmtree.c:69:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
postgresql-18.1/src/common/rmtree.c:60:15: acquire_memory: allocated here
postgresql-18.1/src/common/rmtree.c:61:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/rmtree.c:67:30: branch_false: ...to here
postgresql-18.1/src/common/rmtree.c:69:33: throw: if ‘readdir’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/saslprep.c:1094:22: warning[-Wanalyzer-malloc-leak]: leak of ‘input_chars’
postgresql-18.1/src/common/saslprep.c:1067:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/saslprep.c:1080:22: branch_false: ...to here
postgresql-18.1/src/common/saslprep.c:1081:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/saslprep.c:1083:13: branch_false: ...to here
postgresql-18.1/src/common/saslprep.c:1083:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/saslprep.c:1086:23: branch_false: ...to here
postgresql-18.1/src/common/saslprep.c:1086:23: acquire_memory: allocated here
postgresql-18.1/src/common/saslprep.c:1087:12: branch_false: following ‘false’ branch (when ‘input_chars’ is non-NULL)...
postgresql-18.1/src/common/saslprep.c:1087:12: branch_false: ...to here
postgresql-18.1/src/common/saslprep.c:1091:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/saslprep.c:1093:28: branch_true: ...to here
postgresql-18.1/src/common/saslprep.c:1094:22: throw: if ‘pg_utf_mblen_private’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:142:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termin’
postgresql-18.1/src/common/sprompt.c:95:18: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18.1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:142:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18.1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:142:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termin’
postgresql-18.1/src/common/sprompt.c:95:18: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18.1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:142:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:139:12: branch_true: following ‘true’ branch (when ‘prompt’ is non-NULL)...
postgresql-18.1/src/common/sprompt.c:141:23: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:142:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:145:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘termin’
postgresql-18.1/src/common/sprompt.c:95:18: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:145:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termin’
postgresql-18.1/src/common/sprompt.c:95:18: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:145:18: throw: if ‘pg_get_line’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:149:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:148:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/sprompt.c:149:26: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:149:26: throw: if ‘pg_strdup’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:149:26: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:148:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/sprompt.c:149:26: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:149:26: throw: if ‘pg_strdup’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:152:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:152:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:152:16: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:152:16: throw: if ‘pg_strip_crlf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:160:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:154:12: branch_false: following ‘false’ branch (when ‘echo == 0’)...
postgresql-18.1/src/common/sprompt.c:158:17: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:160:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:160:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:154:12: branch_false: following ‘false’ branch (when ‘echo == 0’)...
postgresql-18.1/src/common/sprompt.c:158:17: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:160:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:171:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:154:12: branch_true: following ‘true’ branch (when ‘echo != 0’)...
postgresql-18.1/src/common/sprompt.c:167:17: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:167:17: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/sprompt.c:171:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:171:17: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:154:12: branch_true: following ‘true’ branch (when ‘echo != 0’)...
postgresql-18.1/src/common/sprompt.c:167:17: branch_true: ...to here
postgresql-18.1/src/common/sprompt.c:167:17: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/sprompt.c:171:17: throw: if ‘fflush’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:180:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_resource: opened here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:174:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:180:16: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/sprompt.c:180:16: warning[-Wanalyzer-malloc-leak]: leak of ‘termout’
postgresql-18.1/src/common/sprompt.c:96:19: acquire_memory: allocated here
postgresql-18.1/src/common/sprompt.c:98:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:119:12: branch_false: ...to here
postgresql-18.1/src/common/sprompt.c:174:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/common/sprompt.c:180:16: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/common/string.c:111:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
postgresql-18.1/src/common/string.c:96:15: acquire_memory: allocated here
postgresql-18.1/src/common/string.c:101:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
postgresql-18.1/src/common/string.c:101:12: branch_false: ...to here
postgresql-18.1/src/common/string.c:104:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/string.c:108:21: branch_true: ...to here
postgresql-18.1/src/common/string.c:108:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/common/string.c:111:25: branch_true: ...to here
postgresql-18.1/src/common/string.c:111:25: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/common/stringinfo.c:203:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/common/stringinfo.c:145:1: enter_function: entry to ‘appendStringInfo’
postgresql-18.1/src/common/stringinfo.c:156:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/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-476):
postgresql-18.1/src/fe_utils/print.c:909:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘width_header’
postgresql-18.1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18.1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18.1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18.1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18.1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18.1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18.1/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-688):
postgresql-18.1/src/fe_utils/print.c:1040:17: warning[-Wanalyzer-null-argument]: use of NULL ‘bytes_output’ where non-null expected
postgresql-18.1/src/fe_utils/print.c:3549:1: enter_function: entry to ‘printQuery’
postgresql-18.1/src/fe_utils/print.c:3557:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/print.c:3561:55: branch_false: ...to here
postgresql-18.1/src/fe_utils/print.c:3560:9: call_function: calling ‘printTableInit’ from ‘printQuery’
postgresql-18.1/src/fe_utils/print.c:3560:9: return_function: returning to ‘printQuery’ from ‘printTableInit’
postgresql-18.1/src/fe_utils/print.c:3567:21: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/print.c:3567:21: branch_false: ...to here
postgresql-18.1/src/fe_utils/print.c:3601:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/print.c:3609:9: branch_false: ...to here
postgresql-18.1/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-476):
postgresql-18.1/src/fe_utils/psqlscan.c:4614:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
postgresql-18.1/src/fe_utils/psqlscan.l:1122:8: enter_function: entry to ‘psql_scan’
postgresql-18.1/src/fe_utils/psqlscan.l:1137:10: call_function: calling ‘psql_yy_switch_to_buffer’ from ‘psql_scan’
postgresql-18.1/src/fe_utils/psqlscan.l:1137:10: return_function: returning to ‘psql_scan’ from ‘psql_yy_switch_to_buffer’
postgresql-18.1/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-775):
postgresql-18.1/src/fe_utils/recovery_gen.c:143:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&filename, <unknown>)’
postgresql-18.1/src/fe_utils/recovery_gen.c:139:14: acquire_resource: opened here
postgresql-18.1/src/fe_utils/recovery_gen.c:140:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/fe_utils/recovery_gen.c:143:13: branch_false: ...to here
postgresql-18.1/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-476):
postgresql-18.1/src/include/access/tableam.h:1022:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sscan’
postgresql-18.1/src/backend/access/heap/heapam_handler.c:685:1: enter_function: entry to ‘heapam_relation_copy_for_cluster’
postgresql-18.1/src/backend/access/heap/heapam_handler.c:729:12: branch_false: following ‘false’ branch (when ‘use_sort == 0’)...
postgresql-18.1/src/backend/access/heap/heapam_handler.c:741:13: branch_false: ...to here
postgresql-18.1/src/backend/access/heap/heapam_handler.c:741:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/heap/heapam_handler.c:743:33: branch_true: ...to here
postgresql-18.1/src/backend/access/heap/heapam_handler.c:802:30: call_function: calling ‘table_scan_getnextslot’ from ‘heapam_relation_copy_for_cluster’
# 1020| table_scan_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
# 1021| {
# 1022|-> slot->tts_tableOid = RelationGetRelid(sscan->rs_rd);
# 1023|
# 1024| /* We don't expect actual scans using NoMovementScanDirection */
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/include/access/tupmacs.h:28:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/access/common/indextuple.c:241:1: enter_function: entry to ‘nocache_index_getattr’
postgresql-18.1/src/backend/access/common/indextuple.c:264:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/common/indextuple.c:302:14: branch_false: ...to here
postgresql-18.1/src/backend/access/common/indextuple.c:313:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/common/indextuple.c:313:20: branch_false: ...to here
postgresql-18.1/src/backend/access/common/indextuple.c:336:12: branch_true: following ‘true’ branch (when ‘slow != 0’)...
postgresql-18.1/src/backend/access/common/indextuple.c:336:12: branch_true: ...to here
postgresql-18.1/src/backend/access/common/indextuple.c:397:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/common/indextuple.c:397:56: call_function: inlined call to ‘att_isnull’ from ‘nocache_index_getattr’
# 26| att_isnull(int ATT, const bits8 *BITS)
# 27| {
# 28|-> return !(BITS[ATT >> 3] & (1 << (ATT & 0x07)));
# 29| }
# 30|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/include/libpq/pqformat.h:146:9: warning[-Wanalyzer-malloc-leak]: leak of ‘reply’
postgresql-18.1/src/backend/libpq/auth.c:1928:1: enter_function: entry to ‘pam_passwd_conv_proc’
postgresql-18.1/src/backend/libpq/auth.c:1948:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1955:22: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1955:22: acquire_memory: allocated here
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: following ‘false’ branch (when ‘reply’ is non-NULL)...
postgresql-18.1/src/backend/libpq/auth.c:1955:12: branch_false: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1963:21: branch_true: following ‘true’ branch (when ‘i < num_msg’)...
postgresql-18.1/src/backend/libpq/auth.c:1965:28: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1968:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/libpq/auth.c:1975:41: branch_true: ...to here
postgresql-18.1/src/backend/libpq/auth.c:1975: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):
postgresql-18.1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘elemops’
postgresql-18.1/src/backend/partitioning/partbounds.c:3868:1: enter_function: entry to ‘make_partition_op_expr’
postgresql-18.1/src/backend/partitioning/partbounds.c:3876:19: call_function: calling ‘get_partition_operator’ from ‘make_partition_op_expr’
postgresql-18.1/src/backend/partitioning/partbounds.c:3876:19: return_function: returning to ‘make_partition_op_expr’ from ‘get_partition_operator’
postgresql-18.1/src/backend/partitioning/partbounds.c:3951:50: branch_false: following ‘false’ branch...
postgresql-18.1/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):
postgresql-18.1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘expanded_groups’
postgresql-18.1/src/backend/parser/parse_agg.c:1920:1: enter_function: entry to ‘expand_grouping_sets’
postgresql-18.1/src/backend/parser/parse_agg.c:1927:12: branch_false: following ‘false’ branch (when ‘groupingSets’ is non-NULL)...
postgresql-18.1/src/backend/parser/parse_agg.c:1927:12: branch_false: ...to here
postgresql-18.1/src/backend/parser/parse_agg.c:1930:9: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/parser/parse_agg.c:1953: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):
postgresql-18.1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_ops’
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3644:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3649:26: branch_true: ...to here
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3649:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3661:28: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3668:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3668:25: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3686:20: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3686:20: branch_false: following ‘false’ branch (when ‘matching_cols <= 1’)...
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3706:25: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/path/indxpath.c:3706:25: release_memory: ‘new_ops’ is NULL
postgresql-18.1/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):
postgresql-18.1/src/include/nodes/pg_list.h:281:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sortclause’
postgresql-18.1/src/backend/optimizer/plan/planner.c:3135:1: enter_function: entry to ‘reorder_grouping_sets’
postgresql-18.1/src/backend/optimizer/plan/planner.c:3141:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:3147:50: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18.1/src/backend/optimizer/plan/planner.c:3147:24: branch_false: ...to here
postgresql-18.1/src/backend/optimizer/plan/planner.c:3147:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:3141:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/optimizer/plan/planner.c:3147:24: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18.1/src/backend/optimizer/plan/planner.c:3147:50: call_function: inlined call to ‘list_length’ from ‘reorder_grouping_sets’
postgresql-18.1/src/backend/optimizer/plan/planner.c:3147: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):
postgresql-18.1/src/include/storage/block.h:105:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:648:1: enter_function: entry to ‘_bt_bottomupdel_finish_pending’
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:657:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:659:39: branch_true: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:665:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:690:57: call_function: inlined call to ‘BTreeTupleGetNPosting’ from ‘_bt_bottomupdel_finish_pending’
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:696:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:709:42: branch_true: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:709:42: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘_bt_bottomupdel_finish_pending’
postgresql-18.1/src/backend/access/nbtree/nbtdedup.c:709:42: return_function: returning to ‘_bt_bottomupdel_finish_pending’ from ‘BTreeTupleGetHeapTID’
postgresql-18.1/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):
postgresql-18.1/src/include/storage/itemptr.h:116:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4202:1: enter_function: entry to ‘_bt_check_third_page’
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4211:12: branch_false: following ‘false’ branch (when ‘itemsz > 2704’)...
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4219:13: branch_false: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4219:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4226:18: branch_false: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4227:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4231:9: branch_false: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4231:9: branch_true: following ‘true’ branch...
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4231:9: branch_true: ...to here
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4231:9: call_function: calling ‘BTreeTupleGetHeapTID’ from ‘_bt_check_third_page’
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4231:9: return_function: returning to ‘_bt_check_third_page’ from ‘BTreeTupleGetHeapTID’
postgresql-18.1/src/backend/access/nbtree/nbtutils.c:4231: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):
postgresql-18.1/src/include/utils/expandedrecord.h:220:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘newerh’
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7591:1: enter_function: entry to ‘exec_move_row_from_datum’
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7596:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7604:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7707:21: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7707:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7718:17: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7719: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):
postgresql-18.1/src/include/utils/expandedrecord.h:220:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘srcerh’
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7591:1: enter_function: entry to ‘exec_move_row_from_datum’
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7596:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7604:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7707:21: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7707:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7718:17: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_exec.c:7719: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):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:126:22: warning[-Wanalyzer-malloc-leak]: leak of ‘state’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:107:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:108:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:110:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:117:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_true: following ‘true’ branch (when ‘password’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:126:22: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:126:22: throw: if ‘pg_saslprep’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:126:22: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(sasl_mechanism)’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:108:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:110:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:116:33: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:117:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:123:12: branch_true: following ‘true’ branch (when ‘password’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:126:22: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:126:22: throw: if ‘pg_saslprep’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:442:9: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:363:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:369:23: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:372:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:377:23: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:379:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:384:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:421:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:424:28: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:427:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:434:51: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:435:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:438:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:438:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:439:12: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:442:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:442:9: throw: if ‘termPQExpBuffer’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:509:37: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:474:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:478:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:488:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:495:17: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:500:31: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:501:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:506:17: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:509:37: throw: if ‘pg_b64_enc_len’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:510:22: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:474:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:478:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:488:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:495:17: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:500:31: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:501:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:506:17: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:510:22: throw: if ‘enlargePQExpBuffer’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:516:37: warning[-Wanalyzer-malloc-leak]: leak of ‘cbind_input’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:474:12: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:478:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:488:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:495:17: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:500:31: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:501:20: branch_false: following ‘false’ branch (when ‘cbind_input’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:506:17: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:510:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:517:83: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:516:37: throw: if ‘pg_b64_encode’ throws an exception...
postgresql-18.1/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((uint8 *) cbind_input, cbind_input_len,
# 517| buf.data + buf.len,
# 518| encoded_cbind_len);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:743:32: warning[-Wanalyzer-malloc-leak]: leak of ‘decoded_server_signature’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:693:1: enter_function: entry to ‘read_server_final_message’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:701:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:708:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:708:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:725:92: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:724:36: call_function: calling ‘read_attr_value’ from ‘read_server_final_message’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:724:36: return_function: returning to ‘read_server_final_message’ from ‘read_attr_value’
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:726:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:732:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:736:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:737:12: branch_false: following ‘false’ branch (when ‘decoded_server_signature’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:744:82: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth-scram.c:743:32: throw: if ‘pg_b64_decode’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-auth.c:832:38: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18.1/src/interfaces/libpq/fe-auth.c:806:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:811:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:824:45: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:825:36: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:831:33: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:832:38: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18.1/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, (uint8 *) conn->pguser,
# 833| strlen(conn->pguser), crypt_pwd2,
# 834| &errstr))
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1372:14: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1368:21: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1369:12: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1372:14: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1372:14: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18.1/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, (uint8 *) user, strlen(user), crypt_pwd, &errstr))
# 1373| {
# 1374| free(crypt_pwd);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1485:30: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1413:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1416:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1419:12: branch_false: following ‘false’ branch (when ‘algorithm’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1461:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1468:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1478:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1478:17: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1480:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1480:29: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1481:20: branch_true: following ‘true’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1483:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-auth.c:1485:30: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18.1/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, (uint8 *) user, strlen(user), crypt_pwd, &errstr))
# 1486| {
# 1487| libpq_append_conn_error(conn, "could not encrypt password: %s", errstr);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-exec.c:192:43: warning[-Wanalyzer-malloc-leak]: leak of ‘PQmakeEmptyPGresult(conn, 0)’
postgresql-18.1/src/interfaces/libpq/fe-exec.c:2360:1: enter_function: entry to ‘PQexecStart’
postgresql-18.1/src/interfaces/libpq/fe-exec.c:2385: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):
postgresql-18.1/src/interfaces/libpq/fe-exec.c:718:31: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
postgresql-18.1/src/interfaces/libpq/fe-exec.c:2360:1: enter_function: entry to ‘PQexecStart’
postgresql-18.1/src/interfaces/libpq/fe-exec.c:2385:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
# 716| res->errMsg = msg;
# 717| else
# 718|-> res->errMsg = libpq_gettext("out of memory\n");
# 719| }
# 720|
Error: GCC_ANALYZER_WARNING (CWE-476):
postgresql-18.1/src/interfaces/libpq/fe-exec.c:742:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
postgresql-18.1/src/interfaces/libpq/fe-exec.c:2360:1: enter_function: entry to ‘PQexecStart’
postgresql-18.1/src/interfaces/libpq/fe-exec.c:2385:26: call_function: calling ‘PQgetResult’ from ‘PQexecStart’
# 740| {
# 741| /* only send DESTROY to successfully-initialized event procs */
# 742|-> if (res->events[i].resultInitialized)
# 743| {
# 744| PGEventResultDestroy evt;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:897:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:897:15: throw: if ‘PQexec’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:25: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:917:25: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:917:25: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:918:35: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:918:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:947:9: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:21: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:947:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:947:9: throw: if ‘PQclear’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:956:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:21: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:947:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:954:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:956:17: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:956:17: throw: if ‘libpq_append_conn_error’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:963:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lobjfuncs’
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:867:37: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:868:12: branch_false: following ‘false’ branch (when ‘lobjfuncs’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:873:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:898:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:904:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:915:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:917:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:919:20: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:920:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:954:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:961:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:961:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:963:17: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-lobj.c:963:17: throw: if ‘libpq_append_conn_error’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1391:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1383:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1390:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1391:24: throw: if ‘appendPQExpBufferVA’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1391:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1389| errno = save_errno;
# 1390| va_start(args, fmt);
# 1391|-> done = appendPQExpBufferVA(errorMessage, libpq_gettext(fmt), args);
# 1392| va_end(args);
# 1393| } while (!done);
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1420:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1412:13: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1412:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1419:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1420:24: throw: if ‘appendPQExpBufferVA’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-misc.c:1420:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1418| errno = save_errno;
# 1419| va_start(args, fmt);
# 1420|-> done = appendPQExpBufferVA(&conn->errorMessage, libpq_gettext(fmt), args);
# 1421| va_end(args);
# 1422| } while (!done);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: throw: if ‘PQfname’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: danger: ‘fieldMax’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 132| int len;
# 133| const char *s = (j < numFieldName && po->fieldName[j][0]) ?
# 134|-> po->fieldName[j] : PQfname(res, j);
# 135|
# 136| fieldNames[j] = s;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: throw: if ‘PQfname’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: danger: ‘fieldNames’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 132| int len;
# 133| const char *s = (j < numFieldName && po->fieldName[j][0]) ?
# 134|-> po->fieldName[j] : PQfname(res, j);
# 135|
# 136| fieldNames[j] = s;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: throw: if ‘PQfname’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:134:52: danger: ‘fieldNotNum’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 132| int len;
# 133| const char *s = (j < numFieldName && po->fieldName[j][0]) ?
# 134|-> po->fieldName[j] : PQfname(res, j);
# 135|
# 136| fieldNames[j] = s;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: throw: if ‘fflush’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: danger: ‘fieldMax’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 188| )))
# 189| {
# 190|-> fflush(NULL);
# 191| fout = popen(pagerenv, "w");
# 192| if (fout)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: throw: if ‘fflush’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: danger: ‘fieldNames’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 188| )))
# 189| {
# 190|-> fflush(NULL);
# 191| fout = popen(pagerenv, "w");
# 192| if (fout)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: throw: if ‘fflush’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:190:33: danger: ‘fieldNotNum’ leaks here; was allocated at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 188| )))
# 189| {
# 190|-> fflush(NULL);
# 191| fout = popen(pagerenv, "w");
# 192| if (fout)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: throw: if ‘popen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: danger: ‘fieldMax’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 189| {
# 190| fflush(NULL);
# 191|-> fout = popen(pagerenv, "w");
# 192| if (fout)
# 193| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: throw: if ‘popen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: danger: ‘fieldNames’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
# 189| {
# 190| fflush(NULL);
# 191|-> fout = popen(pagerenv, "w");
# 192| if (fout)
# 193| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: throw: if ‘popen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: danger: ‘fieldNotNum’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 189| {
# 190| fflush(NULL);
# 191|-> fout = popen(pagerenv, "w");
# 192| if (fout)
# 193| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: danger: ‘fieldMax’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
# 194| usePipe = true;
# 195| #ifndef WIN32
# 196|-> if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
# 197| sigpipe_masked = true;
# 198| #endif /* WIN32 */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: danger: ‘fieldNames’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
# 194| usePipe = true;
# 195| #ifndef WIN32
# 196|-> if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
# 197| sigpipe_masked = true;
# 198| #endif /* WIN32 */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: danger: ‘fieldNotNum’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
# 194| usePipe = true;
# 195| #ifndef WIN32
# 196|-> if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
# 197| sigpipe_masked = true;
# 198| #endif /* WIN32 */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(pagerenv, "w")’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: throw: if ‘pq_block_sigpipe’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: danger: ‘popen(pagerenv, "w")’ leaks here; was allocated at [(29)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/28)
# 194| usePipe = true;
# 195| #ifndef WIN32
# 196|-> if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
# 197| sigpipe_masked = true;
# 198| #endif /* WIN32 */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:33: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:33: danger: ‘fout’ leaks here; was allocated at [(29)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/28)
# 209| if (!fields)
# 210| {
# 211|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 212| goto exit;
# 213| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: danger: ‘fieldMax’ leaks here; was allocated at [(5)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/4)
# 209| if (!fields)
# 210| {
# 211|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 212| goto exit;
# 213| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: danger: ‘fieldNames’ leaks here; was allocated at [(5)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/4)
# 209| if (!fields)
# 210| {
# 211|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 212| goto exit;
# 213| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: danger: ‘fieldNotNum’ leaks here; was allocated at [(5)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/4)
# 209| if (!fields)
# 210| {
# 211|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 212| goto exit;
# 213| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_true: following ‘true’ branch (when ‘fields’ is NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:211:49: danger: ‘fout’ leaks here; was allocated at [(29)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/28)
# 209| if (!fields)
# 210| {
# 211|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 212| goto exit;
# 213| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:215:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:217:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:221:103: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: danger: ‘fieldMax’ leaks here; was allocated at [(5)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/4)
# 218| {
# 219| if (po->align)
# 220|-> fprintf(fout, libpq_gettext("%-*s%s Value\n"),
# 221| fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
# 222| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:215:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:217:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:221:103: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: danger: ‘fieldNames’ leaks here; was allocated at [(5)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/4)
# 218| {
# 219| if (po->align)
# 220|-> fprintf(fout, libpq_gettext("%-*s%s Value\n"),
# 221| fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
# 222| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:215:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:217:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:221:103: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: danger: ‘fieldNotNum’ leaks here; was allocated at [(5)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/4)
# 218| {
# 219| if (po->align)
# 220|-> fprintf(fout, libpq_gettext("%-*s%s Value\n"),
# 221| fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
# 222| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fout’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:150:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:149:21: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:157:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:28: branch_true: following ‘true’ branch (when ‘pagerenv’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:178:33: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:179:34: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:177:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:180:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:191:40: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:192:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:196:45: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:215:25: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:217:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:219:36: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:221:103: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-print.c:220:55: danger: ‘fout’ leaks here; was allocated at [(29)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/28)
# 218| {
# 219| if (po->align)
# 220|-> fprintf(fout, libpq_gettext("%-*s%s Value\n"),
# 221| fieldMaxLen - fs_len, libpq_gettext("Field"), po->fieldSep);
# 222| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:406:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:256:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:265:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:267:38: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:267:38: call_function: calling ‘do_field’ from ‘PQprint’
# 404| if (!(fields[i * nFields + j] = (char *) malloc((size_t) plen + 1)))
# 405| {
# 406|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 407| return false;
# 408| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:406:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:256:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:265:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:267:38: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:267:38: call_function: calling ‘do_field’ from ‘PQprint’
# 404| if (!(fields[i * nFields + j] = (char *) malloc((size_t) plen + 1)))
# 405| {
# 406|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 407| return false;
# 408| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:406:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:256:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:265:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:267:38: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:267:38: call_function: calling ‘do_field’ from ‘PQprint’
# 404| if (!(fields[i * nFields + j] = (char *) malloc((size_t) plen + 1)))
# 405| {
# 406|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 407| return false;
# 408| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:514:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 512| if (!border)
# 513| {
# 514|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 515| return NULL;
# 516| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:514:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 512| if (!border)
# 513| {
# 514|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 515| return NULL;
# 516| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:514:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 512| if (!border)
# 513| {
# 514|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 515| return NULL;
# 516| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:514:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 512| if (!border)
# 513| {
# 514|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 515| return NULL;
# 516| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:514:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 512| if (!border)
# 513| {
# 514|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 515| return NULL;
# 516| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:514:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 512| if (!border)
# 513| {
# 514|-> fprintf(stderr, libpq_gettext("out of memory\n"));
# 515| return NULL;
# 516| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:207:44: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldMax’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:120:36: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: following ‘false’ branch (when ‘fieldMax’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNames’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:118:46: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fieldNotNum’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:119:49: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-print.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fields’
postgresql-18.1/src/interfaces/libpq/fe-print.c:68:1: enter_function: entry to ‘PQprint’
postgresql-18.1/src/interfaces/libpq/fe-print.c:74:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:86:57: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:111:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:117:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:121:20: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:133:37: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:25: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:137:35: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:130:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:145:55: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:205:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:207:44: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-print.c:209:28: branch_false: following ‘false’ branch (when ‘fields’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-print.c:243:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:254:29: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:22: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:275:39: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:277:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:29: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:296:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-print.c:297:42: call_function: calling ‘do_header’ from ‘PQprint’
# 574|
# 575| overflow:
# 576|-> fprintf(stderr, libpq_gettext("header size exceeds the maximum allowed\n"));
# 577| return NULL;
# 578| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: throw: if ‘pg_encoding_max_length’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1267|
# 1268| /* We can optimize a bit if it's a single-byte encoding */
# 1269|-> mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1270|
# 1271| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: throw: if ‘pg_encoding_max_length’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
# 1267|
# 1268| /* We can optimize a bit if it's a single-byte encoding */
# 1269|-> mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1270|
# 1271| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: throw: if ‘pg_encoding_max_length’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1267|
# 1268| /* We can optimize a bit if it's a single-byte encoding */
# 1269|-> mb_encoding = (pg_encoding_max_length(encoding) != 1);
# 1270|
# 1271| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1286:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1290:21: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1298:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1299:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1326:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
# 1328| int w;
# 1329|
# 1330|-> w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1331| /* treat any non-tab control chars as width 1 */
# 1332| if (w <= 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1286:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1290:21: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1298:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1299:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1326:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 1328| int w;
# 1329|
# 1330|-> w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1331| /* treat any non-tab control chars as width 1 */
# 1332| if (w <= 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1286:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1290:21: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1298:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1299:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1326:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1328| int w;
# 1329|
# 1330|-> w = pg_encoding_dsplen(encoding, &wquery[qoffset]);
# 1331| /* treat any non-tab control chars as width 1 */
# 1332| if (w <= 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1286:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1290:21: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1298:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1299:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1326:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1333| w = 1;
# 1334| scroffset += w;
# 1335|-> qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1336| }
# 1337| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1286:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1290:21: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1298:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1299:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1326:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 1333| w = 1;
# 1334| scroffset += w;
# 1335|-> qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1336| }
# 1337| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1286:23: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1290:21: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1298:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1299:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1326:20: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1330:29: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1335:36: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1333| w = 1;
# 1334| scroffset += w;
# 1335|-> qoffset += PQmblenBounded(&wquery[qoffset], encoding);
# 1336| }
# 1337| else
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: throw: if ‘appendPQExpBuffer’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
# 1392| /* Begin building the finished message. */
# 1393| i = msg->len;
# 1394|-> appendPQExpBuffer(msg, libpq_gettext("LINE %d: "), loc_line);
# 1395| if (beg_trunc)
# 1396| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: throw: if ‘appendPQExpBuffer’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 1392| /* Begin building the finished message. */
# 1393| i = msg->len;
# 1394|-> appendPQExpBuffer(msg, libpq_gettext("LINE %d: "), loc_line);
# 1395| if (beg_trunc)
# 1396| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: throw: if ‘appendPQExpBuffer’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:17: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 1392| /* Begin building the finished message. */
# 1393| i = msg->len;
# 1394|-> appendPQExpBuffer(msg, libpq_gettext("LINE %d: "), loc_line);
# 1395| if (beg_trunc)
# 1396| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 1392| /* Begin building the finished message. */
# 1393| i = msg->len;
# 1394|-> appendPQExpBuffer(msg, libpq_gettext("LINE %d: "), loc_line);
# 1395| if (beg_trunc)
# 1396| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
# 1392| /* Begin building the finished message. */
# 1393| i = msg->len;
# 1394|-> appendPQExpBuffer(msg, libpq_gettext("LINE %d: "), loc_line);
# 1395| if (beg_trunc)
# 1396| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1394:40: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 1392| /* Begin building the finished message. */
# 1393| i = msg->len;
# 1394|-> appendPQExpBuffer(msg, libpq_gettext("LINE %d: "), loc_line);
# 1395| if (beg_trunc)
# 1396| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:83: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
# 1401| */
# 1402| scroffset = 0;
# 1403|-> for (; i < msg->len; i += PQmblenBounded(&msg->data[i], encoding))
# 1404| {
# 1405| int w = pg_encoding_dsplen(encoding, &msg->data[i]);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:83: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
# 1401| */
# 1402| scroffset = 0;
# 1403|-> for (; i < msg->len; i += PQmblenBounded(&msg->data[i], encoding))
# 1404| {
# 1405| int w = pg_encoding_dsplen(encoding, &msg->data[i]);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:83: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: throw: if ‘PQmblenBounded’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:43: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1401| */
# 1402| scroffset = 0;
# 1403|-> for (; i < msg->len; i += PQmblenBounded(&msg->data[i], encoding))
# 1404| {
# 1405| int w = pg_encoding_dsplen(encoding, &msg->data[i]);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:83: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/6)
# 1403| for (; i < msg->len; i += PQmblenBounded(&msg->data[i], encoding))
# 1404| {
# 1405|-> int w = pg_encoding_dsplen(encoding, &msg->data[i]);
# 1406|
# 1407| if (w <= 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:83: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/8)
# 1403| for (; i < msg->len; i += PQmblenBounded(&msg->data[i], encoding))
# 1404| {
# 1405|-> int w = pg_encoding_dsplen(encoding, &msg->data[i]);
# 1406|
# 1407| if (w <= 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1403:24: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:83: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: throw: if ‘pg_encoding_dsplen’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1405:53: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1403| for (; i < msg->len; i += PQmblenBounded(&msg->data[i], encoding))
# 1404| {
# 1405|-> int w = pg_encoding_dsplen(encoding, &msg->data[i]);
# 1406|
# 1407| if (w <= 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
# 1411|
# 1412| /* Finish up the LINE message line. */
# 1413|-> appendPQExpBufferStr(msg, &wquery[qidx[ibeg]]);
# 1414| if (end_trunc)
# 1415| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/8)
# 1411|
# 1412| /* Finish up the LINE message line. */
# 1413|-> appendPQExpBufferStr(msg, &wquery[qidx[ibeg]]);
# 1414| if (end_trunc)
# 1415| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: throw: if ‘appendPQExpBufferStr’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1413:17: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
# 1411|
# 1412| /* Finish up the LINE message line. */
# 1413|-> appendPQExpBufferStr(msg, &wquery[qidx[ibeg]]);
# 1414| if (end_trunc)
# 1415| appendPQExpBufferStr(msg, "...");
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/6)
# 1414| if (end_trunc)
# 1415| appendPQExpBufferStr(msg, "...");
# 1416|-> appendPQExpBufferChar(msg, '\n');
# 1417|
# 1418| /* Now emit the cursor marker line. */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/8)
# 1414| if (end_trunc)
# 1415| appendPQExpBufferStr(msg, "...");
# 1416|-> appendPQExpBufferChar(msg, '\n');
# 1417|
# 1418| /* Now emit the cursor marker line. */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1416:17: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
# 1414| if (end_trunc)
# 1415| appendPQExpBufferStr(msg, "...");
# 1416|-> appendPQExpBufferChar(msg, '\n');
# 1417|
# 1418| /* Now emit the cursor marker line. */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1420:29: branch_true: following ‘true’ branch (when ‘i < scroffset’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/6)
# 1419| scroffset += scridx[loc] - scridx[ibeg];
# 1420| for (i = 0; i < scroffset; i++)
# 1421|-> appendPQExpBufferChar(msg, ' ');
# 1422| appendPQExpBufferChar(msg, '^');
# 1423| appendPQExpBufferChar(msg, '\n');
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1420:29: branch_true: following ‘true’ branch (when ‘i < scroffset’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/8)
# 1419| scroffset += scridx[loc] - scridx[ibeg];
# 1420| for (i = 0; i < scroffset; i++)
# 1421|-> appendPQExpBufferChar(msg, ' ');
# 1422| appendPQExpBufferChar(msg, '^');
# 1423| appendPQExpBufferChar(msg, '\n');
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1420:29: branch_true: following ‘true’ branch (when ‘i < scroffset’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1421:25: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
# 1419| scroffset += scridx[loc] - scridx[ibeg];
# 1420| for (i = 0; i < scroffset; i++)
# 1421|-> appendPQExpBufferChar(msg, ' ');
# 1422| appendPQExpBufferChar(msg, '^');
# 1423| appendPQExpBufferChar(msg, '\n');
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/6)
# 1420| for (i = 0; i < scroffset; i++)
# 1421| appendPQExpBufferChar(msg, ' ');
# 1422|-> appendPQExpBufferChar(msg, '^');
# 1423| appendPQExpBufferChar(msg, '\n');
# 1424| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/8)
# 1420| for (i = 0; i < scroffset; i++)
# 1421| appendPQExpBufferChar(msg, ' ');
# 1422|-> appendPQExpBufferChar(msg, '^');
# 1423| appendPQExpBufferChar(msg, '\n');
# 1424| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1422:17: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/2)
# 1420| for (i = 0; i < scroffset; i++)
# 1421| appendPQExpBufferChar(msg, ' ');
# 1422|-> appendPQExpBufferChar(msg, '^');
# 1423| appendPQExpBufferChar(msg, '\n');
# 1424| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qidx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: danger: ‘qidx’ leaks here; was allocated at [(7)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/6)
# 1421| appendPQExpBufferChar(msg, ' ');
# 1422| appendPQExpBufferChar(msg, '^');
# 1423|-> appendPQExpBufferChar(msg, '\n');
# 1424| }
# 1425|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scridx’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: danger: ‘scridx’ leaks here; was allocated at [(9)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/8)
# 1421| appendPQExpBufferChar(msg, ' ');
# 1422| appendPQExpBufferChar(msg, '^');
# 1423|-> appendPQExpBufferChar(msg, '\n');
# 1424| }
# 1425|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: warning[-Wanalyzer-malloc-leak]: leak of ‘wquery’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1222:12: branch_false: following ‘false’ branch (when ‘loc >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1226:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1227:12: branch_false: following ‘false’ branch (when ‘wquery’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1247:16: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1248:12: branch_false: following ‘false’ branch (when ‘slen >= 0’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1254:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1255:12: branch_false: following ‘false’ branch (when ‘qidx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1260:26: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1261:12: branch_false: following ‘false’ branch (when ‘scridx’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1269:24: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1353:12: branch_true: following ‘true’ branch (when ‘cno >= loc’)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1358:27: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: throw: if ‘appendPQExpBufferChar’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1423:17: danger: ‘wquery’ leaks here; was allocated at [(3)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/2)
# 1421| appendPQExpBufferChar(msg, ' ');
# 1422| appendPQExpBufferChar(msg, '^');
# 1423|-> appendPQExpBufferChar(msg, '\n');
# 1424| }
# 1425|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1660:13: warning[-Wanalyzer-malloc-leak]: leak of ‘svname’
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1642:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1644:20: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1644:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1647:25: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1647:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1648:12: branch_false: following ‘false’ branch (when ‘svname’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1660:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1660:13: throw: if ‘pqGets’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-protocol3.c:1660:13: danger: ‘svname’ leaks here; was allocated at [(5)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/4)
# 1658| return 0;
# 1659| }
# 1660|-> if (pqGets(&conn->workBuffer, conn))
# 1661| {
# 1662| free(svname);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:63:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:87:1: enter_function: entry to ‘pq_verify_peer_name_matches_certificate_name’
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:97:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:107:16: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:108:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:113:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:120:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:127:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:127:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:132:18: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:127:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:97:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:107:16: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:108:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:113:9: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:120:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:127:13: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-common.c:127:13: throw: if ‘pg_strcasecmp’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:17: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:47: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:17: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:17: danger: ‘errbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1562| if (ecode == 0)
# 1563| {
# 1564|-> snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("no SSL error reported"));
# 1565| return errbuf;
# 1566| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:47: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_true: following ‘true’ branch (when ‘ecode == 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:47: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:47: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1564:47: danger: ‘errbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1562| if (ecode == 0)
# 1563| {
# 1564|-> snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("no SSL error reported"));
# 1565| return errbuf;
# 1566| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: throw: if ‘ERR_reason_error_string’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: danger: ‘errbuf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1565| return errbuf;
# 1566| }
# 1567|-> errreason = ERR_reason_error_string(ecode);
# 1568| if (errreason != NULL)
# 1569| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1586:17: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1554:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1568:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1583:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1583:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1584:17: call_function: inlined call to ‘ERR_GET_REASON’ from ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1583:13: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1586:17: branch_true: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1586:17: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1586:17: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
# 1584| ERR_GET_REASON(ecode) == SSL_AD_REASON_OFFSET + SSL_AD_NO_APPLICATION_PROTOCOL)
# 1585| {
# 1586|-> snprintf(errbuf, SSL_ERR_LEN, "no application protocol");
# 1587| return errbuf;
# 1588| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1601:17: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1554:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1568:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1583:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1599:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1601:17: call_function: inlined call to ‘ERR_GET_REASON’ from ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1601:17: throw: if ‘pg_strerror_r’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1601:17: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/1)
# 1599| if (ERR_SYSTEM_ERROR(ecode))
# 1600| {
# 1601|-> strerror_r(ERR_GET_REASON(ecode), errbuf, SSL_ERR_LEN);
# 1602| return errbuf;
# 1603| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1554:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1568:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1583:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1599:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:39: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:9: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:9: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/1)
# 1605|
# 1606| /* No choice but to report the numeric ecode */
# 1607|-> snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("SSL error code %lu"), ecode);
# 1608| return errbuf;
# 1609| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:39: warning[-Wanalyzer-malloc-leak]: leak of ‘errbuf’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1554:1: enter_function: entry to ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1559:18: acquire_memory: allocated here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1560:12: branch_false: following ‘false’ branch (when ‘errbuf’ is non-NULL)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1562:12: branch_false: following ‘false’ branch (when ‘ecode != 0’)...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1567:21: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1568:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1583:13: call_function: inlined call to ‘ERR_GET_LIB’ from ‘SSLerrmessage’
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1599:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:39: branch_false: ...to here
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:39: throw: if ‘libpq_gettext’ throws an exception...
postgresql-18.1/src/interfaces/libpq/fe-secure-openssl.c:1607:39: danger: ‘errbuf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
# 1605|
# 1606| /* No choice but to report the numeric ecode */
# 1607|-> snprintf(errbuf, SSL_ERR_LEN, libpq_gettext("SSL error code %lu"), ecode);
# 1608| return errbuf;
# 1609| }
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/interfaces/libpq/pqexpbuffer.c:308:28: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/interfaces/libpq/pqexpbuffer.c:265:1: enter_function: entry to ‘appendPQExpBuffer’
postgresql-18.1/src/interfaces/libpq/pqexpbuffer.c:271:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/interfaces/libpq/pqexpbuffer.c:278:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/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):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1206:45: warning[-Wanalyzer-null-argument]: use of NULL ‘colname’ where non-null expected
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1083:1: enter_function: entry to ‘resolve_column_ref’
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1114:17: call_function: inlined call to ‘list_length’ from ‘resolve_column_ref’
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1180:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1183:17: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1190:28: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1192:28: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1192:28: branch_true: following ‘true’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1195:68: branch_true: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1200:40: branch_true: following ‘true’ branch (when ‘i >= 0’)...
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1202:100: branch_true: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1206:45: danger: argument 2 (‘colname’) NULL where non-null expected
# 1204| Assert(fld->dtype == PLPGSQL_DTYPE_RECFIELD &&
# 1205| fld->recparentno == nse->itemno);
# 1206|-> if (strcmp(fld->fieldname, colname) == 0)
# 1207| {
# 1208| return make_datum_param(expr, i, cref->location);
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1356: 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
# 1354| int nnames;
# 1355|
# 1356|-> idents = list_make2(makeString(word1),
# 1357| makeString(word2));
# 1358|
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1473: 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
# 1471| */
# 1472| new = plpgsql_build_recfield(rec, word2);
# 1473|-> idents = list_make2(makeString(word1),
# 1474| makeString(word2));
# 1475| }
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1480: 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
# 1478| /* Block-qualified reference to record variable. */
# 1479| new = plpgsql_build_recfield(rec, word3);
# 1480|-> idents = list_make3(makeString(word1),
# 1481| makeString(word2),
# 1482| makeString(word3));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1480: 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
# 1478| /* Block-qualified reference to record variable. */
# 1479| new = plpgsql_build_recfield(rec, word3);
# 1480|-> idents = list_make3(makeString(word1),
# 1481| makeString(word2),
# 1482| makeString(word3));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1498: 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
# 1496|
# 1497| /* Nothing found */
# 1498|-> idents = list_make3(makeString(word1),
# 1499| makeString(word2),
# 1500| makeString(word3));
Error: CPPCHECK_WARNING (CWE-768):
postgresql-18.1/src/pl/plpgsql/src/pl_comp.c:1498: 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
# 1496|
# 1497| /* Nothing found */
# 1498|-> idents = list_make3(makeString(word1),
# 1499| makeString(word2),
# 1500| makeString(word3));
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1885:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1840:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1846:34: branch_true: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1872:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1874:7: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1883:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1883:12: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:2016:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1840:6: branch_false: following ‘false’ branch...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1909:6: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1909:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1912:3: branch_false: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1924:6: branch_true: following ‘true’ branch (when ‘yyn == -249’)...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1925:5: branch_true: ...to here
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1996:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18.1/src/pl/plpgsql/src/pl_gram.c:1998:3: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/pl/plpython/plpy_elog.c:496:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/pl/plpython/plpy_elog.c:495:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/pl/plpython/plpy_elog.c:496:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/src/pl/plpython/plpy_elog.c:496:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 494|
# 495| va_start(ap, fmt);
# 496|-> vsnprintf(buf, sizeof(buf), dgettext(TEXTDOMAIN, fmt), ap);
# 497| va_end(ap);
# 498|
Error: GCC_ANALYZER_WARNING (CWE-404):
postgresql-18.1/src/pl/plpython/plpy_elog.c:512:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/pl/plpython/plpy_elog.c:511:9: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/pl/plpython/plpy_elog.c:512:9: throw: if ‘pg_vsnprintf’ throws an exception...
postgresql-18.1/src/pl/plpython/plpy_elog.c:512:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 510|
# 511| va_start(ap, n);
# 512|-> vsnprintf(buf, sizeof(buf),
# 513| dngettext(TEXTDOMAIN, fmt_singular, fmt_plural, n),
# 514| ap);
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18.1/src/test/isolation/specparse.c:1006:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
postgresql-18.1/src/test/isolation/specparse.c:964:6: branch_true: following ‘true’ branch...
postgresql-18.1/src/test/isolation/specparse.c:970:28: branch_true: ...to here
postgresql-18.1/src/test/isolation/specparse.c:993:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
postgresql-18.1/src/test/isolation/specparse.c:995:7: branch_false: ...to here
postgresql-18.1/src/test/isolation/specparse.c:1004:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
postgresql-18.1/src/test/isolation/specparse.c:1006:9: branch_false: ...to here
postgresql-18.1/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):
postgresql-18.1/src/test/isolation/specparse.c:1133:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
postgresql-18.1/src/test/isolation/specparse.c:964:6: branch_false: following ‘false’ branch...
postgresql-18.1/src/test/isolation/specparse.c:1028:6: branch_false: ...to here
postgresql-18.1/src/test/isolation/specparse.c:1028:6: branch_false: following ‘false’ branch (when ‘yystate != 3’)...
postgresql-18.1/src/test/isolation/specparse.c:1031:3: branch_false: ...to here
postgresql-18.1/src/test/isolation/specparse.c:1043:6: branch_true: following ‘true’ branch (when ‘yyn == -14’)...
postgresql-18.1/src/test/isolation/specparse.c:1044:5: branch_true: ...to here
postgresql-18.1/src/test/isolation/specparse.c:1113:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
postgresql-18.1/src/test/isolation/specparse.c:1115:3: branch_false: ...to here
postgresql-18.1/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: CPPCHECK_WARNING (CWE-476):
postgresql-18.1/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):
postgresql-18.1/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-404):
postgresql-18.1/src/test/regress/pg_regress.c:387:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:389:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:392:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:396:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1286:1: enter_function: entry to ‘file_line_count’
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:413:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1331:1: enter_function: entry to ‘make_directory’
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:415:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1916:1: enter_function: entry to ‘open_result_files’
postgresql-18.1/src/test/regress/pg_regress.c:1922:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1926:9: branch_true: ...to here
postgresql-18.1/src/test/regress/pg_regress.c:1929:12: branch_true: following ‘true’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1930:17: branch_true: ...to here
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c: scope_hint: In function ‘get_expectfile’
postgresql-18.1/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):
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:1148:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
postgresql-18.1/src/test/regress/pg_regress.c:1147:17: acquire_resource: ‘va_start’ called here
postgresql-18.1/src/test/regress/pg_regress.c:1148:26: throw: if ‘appendStringInfoVA’ throws an exception...
postgresql-18.1/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):
postgresql-18.1/src/test/regress/pg_regress.c:1276:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18.1/src/test/regress/pg_regress.c:1269:25: acquire_resource: opened here
postgresql-18.1/src/test/regress/pg_regress.c:1271:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1276:9: branch_false: ...to here
postgresql-18.1/src/test/regress/pg_regress.c:1276:9: throw: if ‘fseek’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/test/regress/pg_regress.c:1277:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18.1/src/test/regress/pg_regress.c:1269:25: acquire_resource: opened here
postgresql-18.1/src/test/regress/pg_regress.c:1271:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1276:9: branch_false: ...to here
postgresql-18.1/src/test/regress/pg_regress.c:1277:13: throw: if ‘ftell’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/test/regress/pg_regress.c:1297:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
postgresql-18.1/src/test/regress/pg_regress.c:1290:25: acquire_resource: opened here
postgresql-18.1/src/test/regress/pg_regress.c:1292:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1292:12: branch_false: ...to here
postgresql-18.1/src/test/regress/pg_regress.c:1297:21: throw: if ‘fgetc’ throws an exception...
postgresql-18.1/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-775):
postgresql-18.1/src/test/regress/pg_regress.c:1683:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(schedule, "r")’
postgresql-18.1/src/test/regress/pg_regress.c:1664:15: acquire_resource: opened here
postgresql-18.1/src/test/regress/pg_regress.c:1665:12: branch_false: following ‘false’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1665:12: branch_false: ...to here
postgresql-18.1/src/test/regress/pg_regress.c:1668:16: branch_true: following ‘true’ branch...
postgresql-18.1/src/test/regress/pg_regress.c:1676:17: branch_true: ...to here
postgresql-18.1/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)