summaryrefslogtreecommitdiffstats
path: root/src/dal
diff options
context:
space:
mode:
authorHuynh Tran <nthuynh75@gmail.com>2005-06-21 21:27:00 +0000
committerHuynh Tran <nthuynh75@gmail.com>2005-06-21 21:27:00 +0000
commit270163b535f64f2fd6baa32d8a76ecc1c5526539 (patch)
tree3938cdc0a548cef9ecceeb223260719145fd36fe /src/dal
parentcff0c29d724e953c79f86f7b41cc49ebd0035806 (diff)
downloadmanaserv-270163b535f64f2fd6baa32d8a76ecc1c5526539.tar.gz
manaserv-270163b535f64f2fd6baa32d8a76ecc1c5526539.tar.xz
manaserv-270163b535f64f2fd6baa32d8a76ecc1c5526539.zip
Fixed memory leak.
Diffstat (limited to 'src/dal')
-rw-r--r--src/dal/sqlitedataprovider.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp
index 8018098..a9ed365 100644
--- a/src/dal/sqlitedataprovider.cpp
+++ b/src/dal/sqlitedataprovider.cpp
@@ -130,7 +130,13 @@ SqLiteDataProvider::execSql(const std::string& sql,
);
if (errCode != SQLITE_OK) {
- throw DbSqlQueryExecFailure(sqlite3_errmsg(mDb));
+ std::string msg(sqlite3_errmsg(mDb));
+
+ // free memory
+ sqlite3_free_table(result);
+ delete errMsg;
+
+ throw DbSqlQueryExecFailure(msg);
}
// the first row of result[] contains the field names.