forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc6605c1
committed
Don't test already-referenced pointer for nullness
Commitb8ba734 added in PQgetResult a derefence to a pointerreturned by pqPrepareAsyncResult(), before some other code that wasalready testing that pointer for nullness. But since commit618c167 (in Postgres 15), pqPrepareAsyncResult() doesn't everreturn NULL (a statically-allocated result is returned if OOM). So inbranches 15 and up, we can remove the redundant pointer check with noharm done.However, in branch 14, pqPrepareAsyncResult() can indeed return NULL ifit runs out of memory. Fix things there by adding a null pointer checkbefore dereferencing the pointer. This should hint Coverity that thepreexisting check is not redundant but necessary.Backpatch to 14, likeb8ba734.Per Coverity.1 parenta37bb7c commitc6605c1
1 file changed
+3
-1
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
842 | 842 |
| |
843 | 843 |
| |
844 | 844 |
| |
| 845 | + | |
| 846 | + | |
845 | 847 |
| |
846 | 848 |
| |
847 | 849 |
| |
| |||
2138 | 2140 |
| |
2139 | 2141 |
| |
2140 | 2142 |
| |
2141 |
| - | |
| 2143 | + | |
2142 | 2144 |
| |
2143 | 2145 |
| |
2144 | 2146 |
| |
|
0 commit comments
Comments
(0)