[PATCH] DLRs crash smsbox using CIMD2

"Dariusz Markowicz" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <00da01c2cddc$6bd5ad20$1900000a@toster>
Hi list,

It looks like the lastest patch to urltrans.c solved problem of crash smsbox
using CIMD2. So it is now possible to enable DLR support in cimd2 module.
This patch enable DLR and fix possible memory leak problem. ts (timestamp)
was not always destroy because it was executed from "if" block, so I moved it
outside.

--- smsc_cimd2.c.cvs    Thu Feb  6 12:55:00 2003
+++ smsc_cimd2.c        Thu Feb  6 12:54:12 2003
@@ -1588,8 +1588,7 @@
         goto io_error;

 next_reply:
-    /*reply = cimd2_get_packet(smsc,ts);*/
-    reply = cimd2_get_packet(smsc, NULL);
+    reply = cimd2_get_packet(smsc,ts);
     if (!reply)
         goto io_error;

@@ -1880,9 +1879,9 @@
                 octstr_get_cstr(msg->sms.dlr_url),
                 msg->sms.dlr_mask,
                 octstr_get_cstr(msg->sms.boxc_id));
-            octstr_destroy(ts);
-            ts = NULL;
        }
+        octstr_destroy(ts);
+        ts = NULL;
        if (ret == 0 || ret == -1)
             break;
         if (cimd2_reopen(smsc) < 0) {

Please comment and vote.

Best regards,
Dariusz Markowicz
smsc_cimd2.diff (application/octet-stream, 682 B)
--- smsc_cimd2.c.cvs	Thu Feb  6 12:55:00 2003
+++ smsc_cimd2.c	Thu Feb  6 12:54:12 2003
@@ -1588,8 +1588,7 @@
         goto io_error;
 
 next_reply:
-    /*reply = cimd2_get_packet(smsc,ts);*/
-    reply = cimd2_get_packet(smsc, NULL);
+    reply = cimd2_get_packet(smsc,ts);
     if (!reply)
         goto io_error;
 
@@ -1880,9 +1879,9 @@
                 octstr_get_cstr(msg->sms.dlr_url),
                 msg->sms.dlr_mask,
                 octstr_get_cstr(msg->sms.boxc_id));
-            octstr_destroy(ts);
-            ts = NULL;		
 	}
+        octstr_destroy(ts);
+        ts = NULL;
 	if (ret == 0 || ret == -1)
             break;
         if (cimd2_reopen(smsc) < 0) {
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.