projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae80343
)
Don't use 0 as a spelling of NULL.
author
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 2 Oct 2003 14:47:44 +0000
(14:47 +0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 2 Oct 2003 14:47:44 +0000
(14:47 +0000)
src/interfaces/libpq/fe-exec.c
patch
|
blob
|
blame
|
history
diff --git
a/src/interfaces/libpq/fe-exec.c
b/src/interfaces/libpq/fe-exec.c
index ce26e45397137934e01f8489563af69c82d1d438..26125a3ce5185a87cd4f41ac351a5ce6629c3ee3 100644
(file)
--- a/
src/interfaces/libpq/fe-exec.c
+++ b/
src/interfaces/libpq/fe-exec.c
@@
-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;