[sr-dev] git:5.0:cfaca9f7: htable: Fix memory leak when reloading an empty htable from database

Daniel-Constantin Mierla miconda at gmail.com
Wed May 3 09:00:05 CEST 2017


Module: kamailio
Branch: 5.0
Commit: cfaca9f7b468b138280c288edfa830995f714ea1
URL: https://github.com/kamailio/kamailio/commit/cfaca9f7b468b138280c288edfa830995f714ea1

Author: Kristian Høgh <kfh at uni-tel.dk>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-05-03T08:58:27+02:00

htable: Fix memory leak when reloading an empty htable from database

(cherry picked from commit 07ce768fc6064867ed33d7ab6c9cbbb05db329db)

---

Modified: src/modules/htable/ht_db.c

---

Diff:  https://github.com/kamailio/kamailio/commit/cfaca9f7b468b138280c288edfa830995f714ea1.diff
Patch: https://github.com/kamailio/kamailio/commit/cfaca9f7b468b138280c288edfa830995f714ea1.patch

---

diff --git a/src/modules/htable/ht_db.c b/src/modules/htable/ht_db.c
index 83a9f01..fd5ec46 100644
--- a/src/modules/htable/ht_db.c
+++ b/src/modules/htable/ht_db.c
@@ -247,6 +247,7 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
 		} else {
 			if(RES_ROW_N(db_res)==0)
 			{
+				ht_dbf.free_result(ht_db_con, db_res);
 				LM_DBG("Nothing to be loaded in hash table\n");
 				return 0;
 			}




More information about the sr-dev mailing list