[postgis-devel] Question on memory management on C functions

Sandro Santilli strk at keybit.net
Sun Apr 24 08:46:21 PDT 2011

On Sun, Apr 24, 2011 at 02:29:13PM +0200, Jorge Arévalo wrote:

> I've seen in many functions (like shortestline2d) the memory is not
> released when errors happen.  You don't call any release function
> before calling PG_RETURN_NULL, for example. But when everything goes
> ok, the memory is free'd before returning the value (calls to lwfree,
> PG_FREE_IT_COPY, etc). Why?

No reason. Just happened to be coded like that. 
Always explicitly cleaning would be nice, for clarity.


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the postgis-devel mailing list