Commit bd905a0d authored by Alvaro Herrera's avatar Alvaro Herrera

Fix possible NULL dereference in ExecAlterObjectDependsStmt

I used the wrong variable here.  Doesn't make a difference today because
the only plausible caller passes a non-NULL variable, but someday it
will be wrong, and even today's correctness is subtle: the caller that
does pass a NULL is never invoked because of object type constraints.
Surely not a condition to rely on.

Noted by Coverity
parent 660d5fb8
......@@ -422,7 +422,7 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
if (refAddress)
*refAddress = refAddr;
recordDependencyOn(&address, refAddress, DEPENDENCY_AUTO_EXTENSION);
recordDependencyOn(&address, &refAddr, DEPENDENCY_AUTO_EXTENSION);
return address;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment