[PATCH] Only free memory for three levels of taxonomy

Dirk Hohndel dirk at hohndel.org
Mon Jul 13 05:49:57 PDT 2015


On Mon, Jul 13, 2015 at 10:40:53PM +1000, Rick Walsh wrote:
> We only use three levels of taxonomy, but we were attempting to free memory
> for seven.  This led to some fun invalid point crashes.
> 
> Please check I'm not way off the mark, but it definitely appears to fix the
> crashes I was getting.

I'm surprised this fixes your crashes.
We actually store as many levels as we get back from the service - we just
SHOW only three levels. And the other pointers SHOULD be NULL and
therefore freeing them should be no problem.

So I think your patch is wrong in that it will leak memory. But since we
are already tracking how many entries we have, we might as well use that
to limit how many pointers we free. I'll make a similar commit in a moment
and would like you to test if that fixes your problem as well.

Thanks for working on tracking this down.

/D



More information about the subsurface mailing list