aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-07-05 12:52:49 +0100
committerJoshua Lock <joshua.g.lock@intel.com>2016-07-05 21:55:32 +0100
commitedacfd75144185246b1ae35641d8ed766a8726df (patch)
tree42478f0154dff5109dc71a430e8ca0c3daa5efab
parent2f1fa148201a1d017bf256a5e3f374b6be5c4f43 (diff)
downloadpseudo-edacfd75144185246b1ae35641d8ed766a8726df.tar.gz
pseudo-edacfd75144185246b1ae35641d8ed766a8726df.tar.bz2
pseudo-edacfd75144185246b1ae35641d8ed766a8726df.zip
Fix segfault and data loss in pseudo_db
Don't call sqlite3_finalize() on the static sqlite3_stmt scan as we reuse it later. The sqlite3_reset() and sqlite4_clear_bindings() calls are sufficient to reset the prepared statement and reusing the sqlite3_stmt that has had sqlite3_finalize() on it results in segfaults and data loss. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
-rw-r--r--pseudo_db.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/pseudo_db.c b/pseudo_db.c
index d226cf7..289bb29 100644
--- a/pseudo_db.c
+++ b/pseudo_db.c
@@ -1595,10 +1595,6 @@ pdb_check_xattrs(pseudo_msg_t *msg) {
if (rc != SQLITE_DONE) {
dberr(file_db, "not done after the single row we expected?", rc);
}
- rc = sqlite3_finalize(scan);
- if (rc) {
- dberr(file_db, "couldn't finalize existing file");
- }
sqlite3_reset(scan);
sqlite3_clear_bindings(scan);