Re: PQmakeEmptyPGresult() will return NULL if allocation

From: Neil Conway <neilc(at)samurai(dot)com>
To: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: PQmakeEmptyPGresult() will return NULL if allocation
Date: 2005-06-11 03:03:25
Message-ID: 42AA547D.3090305@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Volkan YAZICI wrote:
> PQmakeEmptyPGresult() will return NULL if malloc() fails for required
> PGresult struct.

Good catch. However, there's not much point having PQmakeEmptyPGresult()
return NULL on OOM if the various call sites of the function within
libpq don't check the return value and handle OOM themselves.

Some checking reveals that there are a few other bits of code in libpq
that don't handle malloc() failures correctly. I'll take a look at
fixing this today or tomorrow.

-Neil

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-06-11 03:40:01 Re: ON COMMIT and foreign keys
Previous Message Tom Lane 2005-06-10 22:33:29 Re: indxpath.c refactoring