[Dovecot] out of memory error

Timo Sirainen tss at iki.fi
Fri Jan 27 17:44:51 EET 2006


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060127/e6cd5255/attachment.pgp


More information about the dovecot mailing list