On Thu, 11 Oct 2012 12:37:23 +0200 Pedro Antonio Vico Solano <pvsol...@amper.es> wrote:
> Hello everyone, > > We are developing a solution based on the SQLite module for Kamailio > and we've found some bugs/errors regarding it. We use kamailio 3.2.4 > and SQLite 3.7.14.1. The errors are about this: > > - Memory leaks on querys via sqlops. Kamailio main process leaks 4kB > each 3 queries (aprox.) and that memory is never freed. [Attached > basic example] > - Segmentation fault when doing a SELECT COUNT(*) via sqlops. > [Attached basic example 2] > > Can you help us? Does this help for the memory leak? diff --git a/modules_k/db_sqlite/dbase.c b/modules_k/db_sqlite/dbase.c index 0b32e07..c1d3b71 100644 --- a/modules_k/db_sqlite/dbase.c +++ b/modules_k/db_sqlite/dbase.c @@ -543,7 +543,12 @@ int db_sqlite_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o, int db_sqlite_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r) { - return db_do_raw_query(_h, _s, _r, + int rc; + + rc = db_do_raw_query(_h, _s, _r, db_sqlite_submit_query, db_sqlite_store_result); + db_sqlite_cleanup_query(_h); + + return rc; } Seems that all other database driver postpone the resource release to free_results - but there's no reason why we couldn't do this right away in sqlite. Since in sqlite free_results we just free cached result set. Will take a look at the other bug later when I get the time to reproduce it. -Timo _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users