Add Ensure to fix coverity defect (#7338)

Coverity detected a possible null pointer dereference. It doesn't seem
like this can be triggered, so added an `Ensure` clause.

Disable-check: force-changelog-file
This commit is contained in:
Keyur Panchal 2024-10-21 14:31:47 -06:00 committed by GitHub
parent 3c707bf28a
commit 3834d81b46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@
* the PostgreSQL License.
*/
#include <postgres.h>
#include "debug_assert.h"
#include <catalog/pg_type.h>
#include <executor/nodeModifyTable.h>
#include <executor/tuptable.h>
@ -743,6 +744,7 @@ lmerge_matched:;
* tuple, for the refetch we do at
* the top.
*/
Ensure(tupleid != NULL, "matched tupleid during merge cannot be null");
ItemPointerCopy(&context->tmfd.ctid, tupleid);
goto lmerge_matched;