Skip to content

Commit e70813f

Browse files
committed
set_deparse_plan: Reuse variable to appease Coverity
Coverity complains that dpns->outer_plan is deferenced (to obtain ->targetlist) when possibly NULL. We can avoid this by using dpns->outer_tlist instead, which was already obtained a few lines up. The fact that we end up with dpns->inner_tlist = dpns->outer_tlist is a bit suspicious-looking and maybe worthy of more investigation, but I'll leave that for another day. Reviewed-by: Michaël Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/202204191345.qerjy3kxi3eb@alvherre.pgsql
1 parent a87e759 commit e70813f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/ruleutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4996,7 +4996,7 @@ set_deparse_plan(deparse_namespace *dpns, Plan *plan)
49964996
if (IsA(plan, ModifyTable))
49974997
{
49984998
if (((ModifyTable *) plan)->operation == CMD_MERGE)
4999-
dpns->inner_tlist = dpns->outer_plan->targetlist;
4999+
dpns->inner_tlist = dpns->outer_tlist;
50005000
else
50015001
dpns->inner_tlist = ((ModifyTable *) plan)->exclRelTlist;
50025002
}

0 commit comments

Comments
 (0)