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

Andres Freund <andres@anarazel.de>

Commit: 2e6f6f3abe6fd249cc8a4d5eb194295ac3988b19
Author: Andres Freund <andres@anarazel.de>
Date: 2015-08-12T15:35:57Z
Releases: 9.5.0
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@mail.gmail.com
Backpatch: 9.5, like ff27db5d

Files

PathChange+/−
src/bin/pg_basebackup/streamutil.c modified +3 −1