Module: kamailio
Branch: master
Commit: 5f891d732443dc065b89b1895601ad429d696c33
URL: https://github.com/kamailio/kamailio/commit/5f891d732443dc065b89b1895601ad4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-15T08:56:04+02:00
db_sqlite: free con in case of error at open time
---
Modified: src/modules/db_sqlite/dbase.c
---
Diff: https://github.com/kamailio/kamailio/commit/5f891d732443dc065b89b1895601ad4…
Patch: https://github.com/kamailio/kamailio/commit/5f891d732443dc065b89b1895601ad4…
---
diff --git a/src/modules/db_sqlite/dbase.c b/src/modules/db_sqlite/dbase.c
index 3fba0e911b..bba8b01639 100644
--- a/src/modules/db_sqlite/dbase.c
+++ b/src/modules/db_sqlite/dbase.c
@@ -65,7 +65,8 @@ static struct sqlite_connection * db_sqlite_new_connection(const struct db_id* i
str db_name = str_init((char *) id->database);
db_param_list_t *db_param = db_param_list_search(db_name);
if (db_param && db_param->readonly) {
- // The database is opened in read-only mode. If the database does not already exist, an error is returned.
+ /* The database is opened in read-only mode. If the database does not
+ * already exist, an error is returned. */
flags |= SQLITE_OPEN_READONLY;
LM_DBG("[%s] opened with [SQLITE_OPEN_READONLY]\n", id->database);
} else {
@@ -93,9 +94,11 @@ static struct sqlite_connection * db_sqlite_new_connection(const struct db_id* i
break;
} else if (rc != SQLITE_ROW) {
LM_ERR("sqlite3_step[%s]\n", sqlite3_errmsg(con->conn));
+ pkg_free(con);
return NULL;
} else {
rc = sqlite3_column_count(stmt);
+ LM_DBG("columns in result: %d\n", rc);
}
}
if (stmt) {
Module: kamailio
Branch: master
Commit: dc0765c04c3cb5d8981551e3f28ee6871fc803ff
URL: https://github.com/kamailio/kamailio/commit/dc0765c04c3cb5d8981551e3f28ee68…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-14T14:11:14+02:00
core: set its own id for EVENT_ROUTE
- having it as alias to REQURST_ROUTE can hide execution of undexpected
script callbacks
---
Modified: src/core/route.h
---
Diff: https://github.com/kamailio/kamailio/commit/dc0765c04c3cb5d8981551e3f28ee68…
Patch: https://github.com/kamailio/kamailio/commit/dc0765c04c3cb5d8981551e3f28ee68…
---
diff --git a/src/core/route.h b/src/core/route.h
index b711c2a6d4..67663d307f 100644
--- a/src/core/route.h
+++ b/src/core/route.h
@@ -54,7 +54,7 @@
#define CORE_ONREPLY_ROUTE (1 << 7)
#define BRANCH_FAILURE_ROUTE (1 << 8)
#define ONREPLY_ROUTE (TM_ONREPLY_ROUTE|CORE_ONREPLY_ROUTE)
-#define EVENT_ROUTE REQUEST_ROUTE
+#define EVENT_ROUTE (1 << 9)
#define ANY_ROUTE (0xFFFFFFFF)
/* The value of this variable is one of the route types defined above and it
@@ -74,7 +74,7 @@ extern int route_type;
struct route_list{
struct action** rlist;
- int idx; /* first empty entry */
+ int idx; /* first empty entry */
int entries; /* total number of entries */
struct str_hash_table names; /* name to route index mappings */
};