PQnotifies and freeing memory.

From: Joshua Moore-Oliva <josh(at)chatgris(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PQnotifies and freeing memory.
Date: 2003-10-11 09:10:53
Message-ID: 200310110510.53507.josh@chatgris.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

After reading the below struct and free statement, I am rather confused..

Do I need to free the struct, the char *, or both?

Thanks.

PGnotify* PQnotifies(PGconn *conn);

typedef struct pgNotify {
char *relname; /* name of relation containing data */
int be_pid; /* process id of backend */
} PGnotify;

After processing a PGnotify object returned by PQnotifies, be sure to free it
with free() to avoid a memory leak.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Chittenden 2003-10-11 09:23:08 Re: go for a script! / ex: PostgreSQL vs. MySQL
Previous Message Christopher Kings-Lynne 2003-10-11 05:20:43 Re: go for a script! / ex: PostgreSQL vs. MySQL