Re: PQmakeEmptyPGresult() will return NULL if allocation - Mailing list pgsql-patches

From Neil Conway
Subject Re: PQmakeEmptyPGresult() will return NULL if allocation
Date
Msg-id 42AA547D.3090305@samurai.com
Whole thread Raw
In response to PQmakeEmptyPGresult() will return NULL if allocation fails  (Volkan YAZICI <volkan.yazici@gmail.com>)
Responses Re: PQmakeEmptyPGresult() will return NULL if allocation
List 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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: indxpath.c refactoring
Next
From: Bruce Momjian
Date:
Subject: Re: ON COMMIT and foreign keys