[sr-dev] git:master:48c942ac: db_text: free order by fields in case of early stage error in dbt_query()

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 31 20:24:48 CEST 2017


Module: kamailio
Branch: master
Commit: 48c942ac4d20e45f8fdf04aaab9779cab51d1813
URL: https://github.com/kamailio/kamailio/commit/48c942ac4d20e45f8fdf04aaab9779cab51d1813

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-31T20:24:32+02:00

db_text: free order by fields in case of early stage error in dbt_query()

---

Modified: src/modules/db_text/dbt_base.c

---

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

---

diff --git a/src/modules/db_text/dbt_base.c b/src/modules/db_text/dbt_base.c
index 860d16e358..e32f0d88ec 100644
--- a/src/modules/db_text/dbt_base.c
+++ b/src/modules/db_text/dbt_base.c
@@ -197,6 +197,7 @@ int dbt_query(db1_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t* _v,
 	if(!_tbc_temp)
 	{
 		LM_ERR("unable to allocate temp table\n");
+		if(_o_op) pkg_free(_o_op);
 		return -1;
 	}
 
@@ -206,6 +207,7 @@ int dbt_query(db1_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t* _v,
 	{
 		LM_ERR("table %.*s does not exist!\n", CON_TABLE(_h)->len, CON_TABLE(_h)->s);
 		dbt_db_del_table(DBT_CON_CONNECTION(_h), &_tbc_temp->name, 0);
+		if(_o_op) pkg_free(_o_op);
 		return -1;
 	}
 




More information about the sr-dev mailing list