Any reason why PQclear() do not assign the pointer to NULL? - Mailing list pgsql-general

From Igor Korot
Subject Any reason why PQclear() do not assign the pointer to NULL?
Date
Msg-id CA+FnnTzJF=ebHMQQ7gw1X3Ax+99gnWbCQ00Sw0wTgGYTOyXeMQ@mail.gmail.com
Whole thread Raw
Responses Re: Any reason why PQclear() do not assign the pointer to NULL?
List 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.



pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: How to escape string in Postgres?
Next
From: Matthias Apitz
Date:
Subject: Re: malformated LSB header in postgres: missing LSB end marker, aborting