[HACKERS] Server Programming in C: palloc() and pfree()

2006-02-09 Thread Rodrigo Hjort
I'm having some problems when using pfree() on functions in C.Calling it on psql gives the exception below on both versions of function insert() [1,2] if pfree() is enabled: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing

Re: [HACKERS] Server Programming in C: palloc() and pfree()

2006-02-09 Thread Martijn van Oosterhout
On Thu, Feb 09, 2006 at 04:16:51PM -0200, Rodrigo Hjort wrote: I'm having some problems when using pfree() on functions in C. Calling it on psql gives the exception below on both versions of function insert() [1,2] if pfree() is enabled: server closed the connection unexpectedly

Re: [HACKERS] Server Programming in C: palloc() and pfree()

2006-02-09 Thread Tom Lane
Rodrigo Hjort [EMAIL PROTECTED] writes: I'm having some problems when using pfree() on functions in C. I think your pfree is just the bearer of bad news, ie, it's the victim of a memory clobber that you've already executed. Take another look at your string manipulation --- that strncpy followed