[Devel] [ openser-Bugs-1732329 ] dialog: memory leak on destroy_dlg
SourceForge.net
noreply at sourceforge.net
Wed Jun 6 21:39:31 CEST 2007
Bugs item #1732329, was opened at 2007-06-06 15:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ovidiu Sas (osas)
Assigned to: Nobody/Anonymous (nobody)
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);
}
----------------------------------------------------------------------
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