Module: kamailio
Branch: master
Commit: 92c8c66e5ba1e5036fdc7a6171e013e21964a03b
URL:
https://github.com/kamailio/kamailio/commit/92c8c66e5ba1e5036fdc7a6171e013e…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: 2017-04-21T11:59:42-04:00
sqlops: free the result only if there is a result
---
Modified: src/modules/sqlops/sql_api.c
---
Diff:
https://github.com/kamailio/kamailio/commit/92c8c66e5ba1e5036fdc7a6171e013e…
Patch:
https://github.com/kamailio/kamailio/commit/92c8c66e5ba1e5036fdc7a6171e013e…
---
diff --git a/src/modules/sqlops/sql_api.c b/src/modules/sqlops/sql_api.c
index 30264e5..ddf579c 100644
--- a/src/modules/sqlops/sql_api.c
+++ b/src/modules/sqlops/sql_api.c
@@ -269,7 +269,7 @@ int sql_do_query(sql_con_t *con, str *query, sql_result_t *res)
if(db_res==NULL || RES_ROW_N(db_res)<=0 || RES_COL_N(db_res)<=0)
{
LM_DBG("no result after query\n");
- con->dbf.free_result(con->dbh, db_res);
+ if (db_res) con->dbf.free_result(con->dbh, db_res);
return 2;
}
if(!res)