[OpenSER-Devel] RFC: memory management in database modules

Henning Westerholt henning.westerholt at 1und1.de
Fri Feb 8 13:44:10 UTC 2008


On Tuesday 05 February 2008, Daniel-Constantin Mierla wrote:
> > [..]
> > postgres, db_berkeley allocate new memory and copy all string values from
> > the database to the internal representation. Modules that uses this
> > driver don't need to copy there values, even after the freeing of the
> > result set.
>
> quite strange, if the copy is not freed with free_result(), when it
> happens? At first thought, seems exposed to memory leak.
>
> db_berkely seems constructed on dbtext structure. In dbtext, the result
> is duplicated in private memory, as the tables are stored in shared
> memory, and making direct references will be exposed to race.

Hi Daniel,

could you point me to the position in the db_text module where the result is 
duplicated? Are only the STR, STRING and BLOB values duplicated, and thus 
must be later freed, or all values that are definied in db_type_t?

Thank you,

Henning



More information about the Devel mailing list