[Devel] [ openser-Bugs-1732329 ] dialog: memory leak on destroy_dlg

SourceForge.net noreply at sourceforge.net
Fri Jun 8 11:49:10 CEST 2007


Bugs item #1732329, was opened at 2007-06-06 22:39
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1732329&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver 1.2.x
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Ovidiu Sas (osas)
Assigned to: Bogdan (bogdan_iancu)
Summary: dialog: memory leak on destroy_dlg

Initial Comment:
When the dialog is destroyed, there is a memory leak for the registered callbacks.  The following patch should fix it:

# diff -Naurp dlg_hash.c dlg_hash.c.new
--- dlg_hash.c	2007-06-06 15:32:41.000000000 -0400
+++ dlg_hash.c.new	2007-06-06 15:32:35.000000000 -0400
@@ -100,9 +100,19 @@ error0:
 
 static inline void destroy_dlg(struct dlg_cell *dlg)
 {
+	struct dlg_callback *cb;
+	struct dlg_callback *cb_t;
+
 	DBG("DBUG:dialog:destroy_dlg: destroing dialog %p\n",dlg);
 	if (dlg->to_tag.s && dlg->to_tag.len)
 		shm_free(dlg->to_tag.s);
+	cb = dlg->cbs.first;
+	while(cb) {
+		cb_t = cb;
+		cb = cb->next;
+		/* FIXME - what about parameters ? */
+		shm_free(cb_t);
+	}
 	shm_free(dlg);
 }
 


----------------------------------------------------------------------

>Comment By: Bogdan (bogdan_iancu)
Date: 2007-06-08 12:49

Message:
Logged In: YES 
user_id=1275325
Originator: NO

OK - done - the fix was ported to 1.2 and 1.1

Thanks,
Bogdan

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2007-06-07 18:43

Message:
Logged In: YES 
user_id=1395524
Originator: YES

Hi Bogdan,

Tested ok.  Please backport the fix.

thanks and regards,
ovidiu

----------------------------------------------------------------------

Comment By: Bogdan (bogdan_iancu)
Date: 2007-06-07 12:01

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Hi Ovidiu,

I made the fix on trunk - please test it and if OK I will make the
backport to 1.2

thanks and regards,
bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1732329&group_id=139143



More information about the Devel mailing list