By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,373 Members | 1,984 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,373 IT Pros & Developers. It's quick & easy.

PQnotifies and freeing memory.

P: n/a
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.
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Joshua Moore-Oliva <jo**@chatgris.com> writes:
After reading the below struct and free statement, I am rather confused..
Do I need to free the struct, the char *, or both?


The struct.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2

P: n/a
Joshua Moore-Oliva <jo**@chatgris.com> writes:
After reading the below struct and free statement, I am rather confused..
Do I need to free the struct, the char *, or both?


The struct.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.