Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?

From: Christof Petig <christof(at)petig-baender(dot)de>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>,PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>,Mark Aves <maves(at)csl(dot)co(dot)uk>,PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Date: 2002-05-06 12:47:31
Message-ID: 3CD67B63.8090304@petig-baender.de (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
Lee Kindness wrote:
> Okay, lets see if i've got this right...
> 
> If I allocate the memory before the FETCH then I (naturally) free
> it. However If I NULL initialise the pointer then libecpg will
> allocate the memory and I must NOT free it - libecpg will free it
> automatically... Yeah?

No, I only said: Never mix free and ECPGfree_auto_mem because 
ECPGfree_auto_mem will double free it if you free'd it already.

And also: it might be a good idea to kill the undocumented function (and 
the list).

And: You need to free it (by one of the two methods above).

> 
> I think this highlights the need for some documentation on this
> aspect.

Yes it does.

   Christof


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2002-05-06 13:36:02
Subject: Re: Native Windows, Apache Portable Runtime
Previous:From: Marc G. FournierDate: 2002-05-06 12:01:36
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports

pgsql-interfaces by date

Next:From: Tom LaneDate: 2002-05-06 15:27:08
Subject: Re: Using C functions with triggers
Previous:From: Michael MeskesDate: 2002-05-06 11:00:51
Subject: Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group