From 436df62f3bb198b57cb70fcf58d7cc9082e7c41b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 13 Sep 2011 00:00:35 +0000 Subject: [PATCH] proper order of api calls in sqlite - #refs 872 --- plugins/input/sqlite/sqlite_types.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/input/sqlite/sqlite_types.hpp b/plugins/input/sqlite/sqlite_types.hpp index 2e3f6be78..c2dc5238d 100644 --- a/plugins/input/sqlite/sqlite_types.hpp +++ b/plugins/input/sqlite/sqlite_types.hpp @@ -98,8 +98,9 @@ public: const char* column_text (int col, int& len) { + const char* text = (const char*) sqlite3_column_text (stmt_, col); len = sqlite3_column_bytes (stmt_, col); - return (const char*) sqlite3_column_text (stmt_, col); + return text; } const char* column_text (int col) @@ -109,8 +110,9 @@ public: const void* column_blob (int col, int& bytes) { + const char* blob = (const char*) sqlite3_column_blob (stmt_, col); bytes = sqlite3_column_bytes (stmt_, col); - return sqlite3_column_blob (stmt_, col); + return blob; } sqlite3_stmt* get_statement()