Commit f93f0b5b authored by Michael Paquier's avatar Michael Paquier

Fix use-after-release issue with pg_identify_object_as_address()

Spotted by buildfarm member prion, with -DRELCACHE_FORCE_RELEASE.

Introduced in f7aab36d.

Discussion: https://postgr.es/m/2759018.1619577848@sss.pgh.pa.us
Backpatch-through: 9.6
parent f7aab36d
...@@ -5619,7 +5619,7 @@ getObjectIdentityParts(const ObjectAddress *object, ...@@ -5619,7 +5619,7 @@ getObjectIdentityParts(const ObjectAddress *object,
break; break;
} }
trigForm = (Form_pg_event_trigger) GETSTRUCT(tup); trigForm = (Form_pg_event_trigger) GETSTRUCT(tup);
evtname = NameStr(trigForm->evtname); evtname = pstrdup(NameStr(trigForm->evtname));
appendStringInfoString(&buffer, quote_identifier(evtname)); appendStringInfoString(&buffer, quote_identifier(evtname));
if (objname) if (objname)
*objname = list_make1(evtname); *objname = list_make1(evtname);
......
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