<font size=2 face="sans-serif">Hello Timo,</font>
<br>
<br><font size=2 face="sans-serif">We've done a basic test and it seems
to solve the memory leak problem. We'll do exhaustive tests in a few days.</font>
<br>
<br><font size=2 face="sans-serif">We'll keep you informed.</font>
<br>
<br><font size=2 face="sans-serif">Thanks a lot,</font>
<br><font size=2 face="sans-serif">Pedro<br>
</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">De: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Timo Teras &lt;timo.teras@iki.fi&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Para: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">&quot;SIP Router -
Kamailio \(OpenSER\) and SIP Express Router \(SER\) - Users Mailing List&quot;
&lt;sr-users@lists.sip-router.org&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">cc: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">pvsolano@amper.es</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Fecha: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">15/10/2012 16:13</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Asunto: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [SR-Users]
db_sqlite bugs</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Enviado por: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Timo Teräs &lt;timo.teras@gmail.com&gt;</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>On Thu, 11 Oct 2012 12:37:23 +0200 Pedro Antonio Vico
Solano<br>
&lt;pvsolano@amper.es&gt; wrote:<br>
<br>
&gt; Hello everyone,<br>
&gt; <br>
&gt; We are developing a solution based on the SQLite module for Kamailio<br>
&gt; and we've found some bugs/errors regarding it. We use kamailio 3.2.4<br>
&gt; and SQLite 3.7.14.1. The errors are about this:<br>
&gt; <br>
&gt; - Memory leaks on querys via sqlops. Kamailio main process leaks 4kB<br>
&gt; each 3 queries (aprox.) and that memory is never freed. [Attached<br>
&gt; basic example]<br>
&gt; - Segmentation fault when doing a SELECT COUNT(*) via sqlops.<br>
&gt; [Attached basic example 2]<br>
&gt; <br>
&gt; Can you help us?<br>
<br>
Does this help for the memory leak?<br>
<br>
diff --git a/modules_k/db_sqlite/dbase.c b/modules_k/db_sqlite/dbase.c<br>
index 0b32e07..c1d3b71 100644<br>
--- a/modules_k/db_sqlite/dbase.c<br>
+++ b/modules_k/db_sqlite/dbase.c<br>
@@ -543,7 +543,12 @@ int db_sqlite_update(const db1_con_t* _h, const db_key_t*
_k, const db_op_t* _o,<br>
 <br>
 int db_sqlite_raw_query(const db1_con_t* _h, const str* _s, db1_res_t**
_r)<br>
 {<br>
- &nbsp; &nbsp; &nbsp; return db_do_raw_query(_h, _s, _r,<br>
+ &nbsp; &nbsp; &nbsp; int rc;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; rc = db_do_raw_query(_h, _s, _r,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_sqlite_submit_query,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_sqlite_store_result);<br>
+ &nbsp; &nbsp; &nbsp; db_sqlite_cleanup_query(_h);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; return rc;<br>
 }<br>
<br>
Seems that all other database driver postpone the resource release to<br>
free_results - but there's no reason why we couldn't do this right away<br>
in sqlite. Since in sqlite free_results we just free cached result set.<br>
<br>
Will take a look at the other bug later when I get the time to<br>
reproduce it.<br>
<br>
-Timo<br>
</font></tt>
<br><font size=1 color=#008000 face="sans-serif"><br>
ADVERTENCIA </font><font size=2 face="sans-serif"><br>
</font><font size=1 color=#008000 face="sans-serif"><br>
Este mensaje y/o sus anexos, pueden contener información personal y confidencial
cuyo uso, reproducción o distribución no autorizados están legalmente prohibidos.
Por lo tanto, si Vd. no fuera su destinatario y, erróneamente, lo hubiera
recibido, le rogamos que informe al remitente y lo borre de inmediato.<br>
<br>
En cumplimiento de la Ley Orgánica 15/1999, de Protección de Datos de Carácter
Personal le informamos de que su dirección de correo electrónico, así como
sus datos personales y de empresa pasarán a formar parte de nuestro fichero
de Gestión, y serán tratados con la única finalidad de mantenimiento de
la relación adquirida con usted. Los datos personales que existen en nuestro
poder están protegidos por nuestra Política de Seguridad, y no serán compartidos
con ninguna otra empresa. Usted puede ejercitar los derechos de acceso,
rectificación, cancelación y oposición dirigiéndose por escrito a la dirección
arriba indicada.<br>
<br>
This e-mail and its attachments may include confidential personal information
which may be protected by any legal rules and cannot be used, copied, distributed
or disclosed to any person without authorisation. If you are not the intended
recipient and have received this e-mail by mistake, please advise the sender
and erase it.<br>
<br>
In compliance with the Spanish Organic Act 15/1999 on Personal Data Protection,
we hereby inform you that your email address, as well as your personal
and business information, will be included in our Management files and
used solely for purposes corresponding to our commercial relationship.
All personal data in our possession is protected by our Data Safety Policy
and thus shall not be released to any other third party whatsoever. You
may exercise your right to access, rectify, cancel and contest by writing
to the address provided above. </font>