Any reason why PQclear() do not assign the pointer to NULL?

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Any reason why PQclear() do not assign the pointer to NULL?
Date: 2026-04-01 06:49:21
Message-ID: CA+FnnTzJF=ebHMQQ7gw1X3Ax+99gnWbCQ00Sw0wTgGYTOyXeMQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
It only frees memory.

So the following code snippet will crash:

[code]
PQclear( res );
if( serverVersion > curremt_running_vrsion )
{
res = PQprepare();
//* error checking*/
}
PQclear( res );
[/code]

Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthias Apitz 2026-04-01 07:32:44 Re: malformated LSB header in postgres: missing LSB end marker, aborting
Previous Message hubert depesz lubaczewski 2026-03-29 11:54:52 Re: How to escape string in Postgres?