postgresql/src/interfaces
Alvaro Herrera c6605c1bdf
Don't test already-referenced pointer for nullness
Commit b8ba7344e9 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
618c16707a (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 b8ba7344e9.

Per Coverity.
2024-01-16 12:27:52 +01:00
..
ecpg Update copyright for 2024 2024-01-03 20:49:05 -05:00
libpq Don't test already-referenced pointer for nullness 2024-01-16 12:27:52 +01:00
Makefile Fix parallel make when running make install before make all 2011-03-08 23:52:29 +02:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00