[sr-dev] git:master:1051a1bb: htable: close db connection in some error cases for rpc command

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 28 09:10:48 CEST 2017


Module: kamailio
Branch: master
Commit: 1051a1bbc70cf84d6ebd7aa76a9b1ebd2e17e710
URL: https://github.com/kamailio/kamailio/commit/1051a1bbc70cf84d6ebd7aa76a9b1ebd2e17e710

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-04-28T09:10:04+02:00

htable: close db connection in some error cases for rpc command

---

Modified: src/modules/htable/htable.c

---

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

---

diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index 18a3ab8..f4c4e96 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -1064,12 +1064,14 @@ static void htable_rpc_reload(rpc_t* rpc, void* c)
 
 	if (rpc->scan(c, "S", &htname) < 1)
 	{
+		ht_db_close_con();
 		rpc->fault(c, 500, "No htable name given");
 		return;
 	}
 	ht = ht_get_table(&htname);
 	if(ht==NULL)
 	{
+		ht_db_close_con();
 		rpc->fault(c, 500, "No such htable");
 		return;
 	}




More information about the sr-dev mailing list