Module: sip-router
Branch: master
Commit: 53689b55632c6208e6326f1a5f4b3c45da216f43
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=53689b5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Jan 2 13:22:28 2014 +0100
htable: use pkg for temporary hash table slots used for reload
- free the temporary slots after reload, reported in FS#385
---
modules/htable/htable.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/htable/htable.c b/modules/htable/htable.c
index 1900ec5..6345b9e 100644
--- a/modules/htable/htable.c
+++ b/modules/htable/htable.c
@@ -490,7 +490,7 @@ static struct mi_root* ht_mi_reload(struct mi_root* cmd_tree, void*
param)
return init_mi_tree( 500, "no such hash table", 18);
}
memcpy(&nht, ht, sizeof(ht_t));
- nht.entries = (ht_entry_t*)shm_malloc(nht.htsize*sizeof(ht_entry_t));
+ nht.entries = (ht_entry_t*)pkg_malloc(nht.htsize*sizeof(ht_entry_t));
if(nht.entries == NULL)
{
ht_db_close_con();
@@ -525,6 +525,7 @@ static struct mi_root* ht_mi_reload(struct mi_root* cmd_tree, void*
param)
ht_cell_free(it);
}
}
+ pkg_free(nht.entries);
ht_db_close_con();
return init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
}