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:
Andrey Volk committed 2019-12-31 00:01:23 +04:00
1 parent fc61fcfe60
commit 4eca43bc62
7 files changed
+319 -35

No files matched your search

+1 -9
View File
@@ -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)