mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 06:34:19 +00:00
FS-12048: [Core] Fix leak in SQLite (switch_cache_db_execute_sql2str) when queries return a NULL containing field which may result in high memory consumption.
This commit is contained in:
1 parent
fc61fcfe60
commit
4eca43bc62
7 files changed
+319
-35
No files matched your search
@@ -57,15 +57,7 @@ SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db)
|
||||
|
||||
SWITCH_DECLARE(const unsigned char *) switch_core_db_column_text(switch_core_db_stmt_t *stmt, int iCol)
|
||||
{
|
||||
const unsigned char *txt = sqlite3_column_text(stmt, iCol);
|
||||
|
||||
if (!strcasecmp((char *) stmt, "(null)")) {
|
||||
memset(stmt, 0, 1);
|
||||
txt = NULL;
|
||||
}
|
||||
|
||||
return txt;
|
||||
|
||||
return sqlite3_column_text(stmt, iCol);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_core_db_column_name(switch_core_db_stmt_t *stmt, int N)
|
||||
|
||||
Reference in new issue
Block a user