Re: fixing Kannel leaks

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
On Wednesday 26 November 2003 15:45, Aarno Syvänen wrote:
> A new try :(

try again ;) see bellow...
Please just skip dlr.c because dlr-core/dlr-mysql/dlr-internal were tested for 
memleaks with valgrind ...

RCS file: /home/cvs/gateway/gw/dlr.c,v
retrieving revision 1.43
diff -u -B -b -r1.43 dlr.c
--- gw/dlr.c	15 Nov 2003 13:14:23 -0000	1.43
+++ gw/dlr.c	26 Nov 2003 14:19:40 -0000
@@ -373,11 +373,13 @@
     }

     /* check if we have handler registered */
-    if (handles == NULL || handles->dlr_get == NULL)
+    if (handles == NULL || handles->dlr_get == NULL) {
         return NULL;
+    }

     debug("dlr.dlr", 0, "DLR[%s]: Looking for DLR smsc=%s, ts=%s, dst=%s, 
type=%d",
-                                 dlr_type(), octstr_get_cstr(smsc), 
octstr_get_cstr(ts), octstr_get_cstr(dst), typ);
+          dlr_type(), octstr_get_cstr(smsc), octstr_get_cstr(ts),
+          octstr_get_cstr(dst), typ);

     dlr = handles->dlr_get(smsc, ts, dst);
     if (dlr == NULL)  {
@@ -392,7 +394,7 @@
         msg->sms.sms_type = report;
         msg->sms.service = octstr_duplicate(dlr->service);
         msg->sms.dlr_mask = typ;
-        msg->sms.smsc_id = octstr_duplicate(dlr->smsc);
+        msg->sms.smsc_id = dlr->smsc;

that should not be cnahged; otherwise smsc Octstr will be freed twice...

         msg->sms.receiver = octstr_duplicate(dlr->destination);
         msg->sms.sender = octstr_duplicate(dlr->source);
         /* if dlr_url was present, recode it here again */

-- 
Best regards / Mit besten Grüßen aus Düsseldorf

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Vogelsanger Weg 80
40470 Düsseldorf

Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109

email: [email protected]
web: www.centrium.de
msn: [email protected]
icq: 98063111
___________________________________________

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.