summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/pgsql/pgsql.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 0b75af16fa..f82e1be7af 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -2665,8 +2665,6 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *
buflen = strlen(strtext); /* will shrink, also we discover if
* strtext */
buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */
- if (buffer == NULL)
- return NULL;
for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++)
{
switch (state)
@@ -2731,9 +2729,7 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *
}
}
buffer = erealloc(buffer, buflen+1);
- buffer[buflen] = 0;
- if (buffer == NULL)
- return NULL;
+ buffer[buflen] = '\0';
*retbuflen = buflen;
return buffer;