pgsql: Handle PQresultErrorField(PG_DIAG_SQLSTATE) returning NULL in st

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Handle PQresultErrorField(PG_DIAG_SQLSTATE) returning NULL in st
Date: 2015-08-12 15:37:30
Message-ID: E1ZPY5q-0000Ng-Oy@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Handle PQresultErrorField(PG_DIAG_SQLSTATE) returning NULL in streamutil.c.

In ff27db5d I missed that PQresultErrorField() may return NULL if
there's no sqlstate associated with an error.

Spotted-By: Coverity
Reported-By: Michael Paquier
Discussion: CAB7nPqQ3o10SY6NVdU4pjq85GQTN5tbbkq2gnNUh2fBNU3rKyQ(at)mail(dot)gmail(dot)com
Backpatch: 9.5, like ff27db5d

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2e6f6f3abe6fd249cc8a4d5eb194295ac3988b19

Modified Files
--------------
src/bin/pg_basebackup/streamutil.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2015-08-12 15:38:25 Re: pgsql: Optionally don't error out due to preexisting slots in commandli
Previous Message Andres Freund 2015-08-12 15:37:28 pgsql: Remove duplicated assignment in pg_create_physical_replication_s