On Fri, 2006-01-27 at 16:32 +0100, Jakob Hirsch wrote:
Timo Sirainen wrote:
Probably this one: driver_mysql_query() calls sql_result_free(), which calls driver_mysql_result_free(), but that returns immediately (line 399 of driver-mysql.c), because result->callback was set to TRUE in driver_mysql_query(), so nothing is freed. Right, thanks. Pgsql didn't leak though. Fixed in CVS now.
you're welcome. The sqlite driver didn't need a fix, though, since its result_free does not check for result->callback. To be honest, I don't even know what this flag is used for, I could not find any code that uses it.
Hmm. The point was that it would allow sql_query()'s callback function to call sql_result_free() without sql_query() function itself calling it again and crashing.
But I'm not sure why I added that. I thought there was a good reason for it at some point, but looks like I've lost the code which used it :) Maybe it could be useful in future though, so I'll change sqlite code to do the same.
btw, just saw that driver-sqlite.c includes time.h and stdlib.h, but that's not necessary.
Removed.