pgsql: Take a little more care in set_backtrace().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Take a little more care in set_backtrace().
Date: 2025-08-03 17:01:59
Message-ID: E1uic5u-000ZA6-2K@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Take a little more care in set_backtrace().

Coverity complained that the "errtrace" string is leaked if we return
early because backtrace_symbols fails. Another criticism that could
be leveled at this is that not providing any hint of what happened is
user-unfriendly. Fix that.

The odds of a leak here are small, and typically it wouldn't matter
anyway since the leak will be in ErrorContext which will soon get
reset. So I'm not feeling a need to back-patch.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c8eda1f72a2b0a8c48ada9b872eb5ef581f7c81

Modified Files
--------------
src/backend/utils/error/elog.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2025-08-04 04:23:24 pgsql: Detect and report update_deleted conflicts.
Previous Message Tom Lane 2025-08-03 02:00:50 pgsql: Reduce leakage during PL/pgSQL function compilation.