[OpenSIPS-Devel] Memory not released for DB_STR or DB_STRING types on db_mysql
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Mon Mar 23 09:28:58 CET 2009
Hi Chevio,
This is correct for the mysql module, as when filling in the result
structure, the mysql module does not allocate and copy the data, but
simply hooks the pointers to data from the mysql lib.
This is why there is no need for a free.
Regards,
Bogdan
Chevio wrote:
> I noticed that for db_mysql the VAL_FREE condition is never set to 1 for
> DB_STR or DB_STRING types on db_mysql/val.c, therefore when calling
> db_free_row in
> db/db_row.c the conditions
>
> case DB_STRING:
> if ( (!VAL_NULL(_val)) && VAL_FREE(_val)) {
>
>
> case DB_STR:
> if ( (!VAL_NULL(_val)) && VAL_FREE(_val)) {
>
> always evaluate to 0, therefore not releasing the memory.
>
> Am I missing something ?
>
> Chevio
>
More information about the Devel
mailing list