diff options
author | Neil Conway <neilc@samurai.com> | 2005-06-12 00:00:21 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2005-06-12 00:00:21 +0000 |
commit | 72a5db15d190121e63126055824f38dd062428be (patch) | |
tree | 82e9ec66aca79f9e213da819b3231664a6363b63 /src/interfaces/libpq/fe-misc.c | |
parent | 2f1210629cf357fd0b6035e47ef10f240c82f6d5 (diff) |
libpq was not consistently checking for memory allocation failures. This
patch adds missing checks to the call sites of malloc(), strdup(),
PQmakeEmptyPGresult(), pqResultAlloc(), and pqResultStrdup(), and updates
the documentation. Per original report from Volkan Yazici about
PQmakeEmptyPGresult() not checking for malloc() failure.
Diffstat (limited to 'src/interfaces/libpq/fe-misc.c')
-rw-r--r-- | src/interfaces/libpq/fe-misc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index f3ed41423ec..66ad325c528 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -23,7 +23,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.113 2005/02/22 04:42:20 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.114 2005/06/12 00:00:21 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -175,7 +175,8 @@ pqGetnchar(char *s, size_t len, PGconn *conn) conn->inCursor += len; if (conn->Pfdebug) - fprintf(conn->Pfdebug, libpq_gettext("From backend (%lu)> %.*s\n"), (unsigned long) len, (int) len, s); + fprintf(conn->Pfdebug, libpq_gettext("From backend (%lu)> %.*s\n"), + (unsigned long) len, (int) len, s); return 0; } |