model-writtenrun 3697 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jeff Davis reported that repeated CREATE SUBSCRIPTION attempts without a required password leaked malloc-allocated connection options, and submitted an explicit cleanup fix for PostgreSQL 16 and 17 in #1.
- Jeff also proposed exploring resource-owner tracking of malloc-allocated memory to cover other error paths, including allocation failures during error handling, in #1.
- Nathan Bossart supported exploring that idea and mentioned PG_TRY/PG_FINALLY as another option, while finding the submitted fix sufficient in #2.
- Tom Lane questioned resource-owner tracking because of overhead and incomplete coverage of external code, accepted the explicit cleanup, and deferred considering PG_TRY until the function became more complex in #3.
- After the final message approved the approach, Jeff committed the submitted patch unchanged as 45da69371e, with 41820e640a carrying the same fix on PostgreSQL 16; the broader memory-management ideas remained unimplemented.