20 Jun
2006
20 Jun
'06
01:13
Hi, On Tuesday 20 June 2006 01:03, Phil Betts wrote:
There IS a very real leak that your example doesn't reveal:
} else if (is->i == (*isp)->i) { /* return FALSE; */ return 0; }
If you try to insert a node that is already in the list, "is" is not linked into the list, and the caller (i.e. insert) has already relinquished control so has no way of releasing the node.
Yes, I was aware of that, it occur in one of my programs that uses the above code. Of course, detected by valgrind and fixed right away. -- Regards, Verdi