aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/json.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2024-01-16 12:27:52 +0100
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2024-01-16 12:27:52 +0100
commit39aab11085177e4026cec6065a78a425c44e23e3 (patch)
treed723ed7febf866dac43532f48378619c60fcd54e /src/backend/utils/adt/json.c
parent23e0ba59c777b810e42a03ebf36dd9b60031e77c (diff)
downloadpostgresql-39aab11085177e4026cec6065a78a425c44e23e3.tar.gz
postgresql-39aab11085177e4026cec6065a78a425c44e23e3.zip
Don't test already-referenced pointer for nullness
Commit b8ba7344e9eb added in PQgetResult a derefence to a pointer returned by pqPrepareAsyncResult(), before some other code that was already testing that pointer for nullness. But since commit 618c16707a6d (in Postgres 15), pqPrepareAsyncResult() doesn't ever return NULL (a statically-allocated result is returned if OOM). So in branches 15 and up, we can remove the redundant pointer check with no harm done. However, in branch 14, pqPrepareAsyncResult() can indeed return NULL if it runs out of memory. Fix things there by adding a null pointer check before dereferencing the pointer. This should hint Coverity that the preexisting check is not redundant but necessary. Backpatch to 14, like b8ba7344e9eb. Per Coverity.
Diffstat (limited to 'src/backend/utils/adt/json.c')
0 files changed, 0 insertions, 0 deletions