Module: sip-router
Branch: master
Commit: 2ea97b8a9a65aaceba8e19fbfc043924a4a82038
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2ea97b8…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Thu Sep 10 18:11:56 2009 +0200
tm: mem leak correction #2
- shm_free() needs to be used instead of shm_free_unsafe()
- The callback params may have a release function
---
modules/tm/h_table.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
index f72737e..06a643c 100644
--- a/modules/tm/h_table.c
+++ b/modules/tm/h_table.c
@@ -356,7 +356,10 @@ error:
for( cbs=(struct tm_callback*)new_cell->tmcb_hl.first ; cbs ; ) {
cbs_tmp = cbs;
cbs = cbs->next;
- shm_free_unsafe( cbs_tmp );
+ if (cbs_tmp->release) {
+ cbs_tmp->release(cbs_tmp->param);
+ }
+ shm_free( cbs_tmp );
}
destroy_avp_list(&new_cell->user_avps_from);