aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-10-02 14:47:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-10-02 14:47:44 +0000
commitbf2f5d9463082d92835655aafa02f403763ebf40 (patch)
tree5c8732b7dfc2ff962cda5020d295f54d39bf0c63 /src
parentd938e8b0f4aea7bbc83e080afd68f2b00f2d7608 (diff)
downloadpostgresql-bf2f5d9463082d92835655aafa02f403763ebf40.tar.gz
postgresql-bf2f5d9463082d92835655aafa02f403763ebf40.zip
Don't use 0 as a spelling of NULL.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-exec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index aadfe0b5f82..6f23fde1e40 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.148 2003/09/22 00:23:35 petere Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.149 2003/10/02 14:47:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2331,12 +2331,15 @@ PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen)
}
buflen = j; /* buflen is the length of the unquoted
* data */
+
+ /* Shrink the buffer to be no larger than necessary */
tmpbuf = realloc(buffer, buflen);
+ /* It would only be a very brain-dead realloc that could fail, but... */
if (!tmpbuf)
{
free(buffer);
- return 0;
+ return NULL;
}
*retbuflen = buflen;