aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-02 14:48:14 -0400
committerFranklin Wei <me@fwei.tk>2018-07-02 14:48:14 -0400
commit7d4eddd7601c9841b1f973deaeb4ae8fab9511b1 (patch)
tree95217f1ea3046edd829a9946353f629f87db0404
parent0c51f1ee4f2fb9178cf3efc25f4b91c2e08b2c87 (diff)
downloadcsaa-7d4eddd7601c9841b1f973deaeb4ae8fab9511b1.zip
csaa-7d4eddd7601c9841b1f973deaeb4ae8fab9511b1.tar.gz
csaa-7d4eddd7601c9841b1f973deaeb4ae8fab9511b1.tar.bz2
csaa-7d4eddd7601c9841b1f973deaeb4ae8fab9511b1.tar.xz
Free SQL statements after use
-rw-r--r--iomt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/iomt.c b/iomt.c
index 8d131ce..c632faf 100644
--- a/iomt.c
+++ b/iomt.c
@@ -696,6 +696,18 @@ void iomt_free(struct iomt *tree)
free(tree->mem.mt_nodes);
free(tree->mem.mt_leaves);
}
+ else
+ {
+ sqlite3_finalize(tree->db.getnode);
+ sqlite3_finalize(tree->db.updatenode);
+ sqlite3_finalize(tree->db.insertnode);
+ sqlite3_finalize(tree->db.getleaf);
+ sqlite3_finalize(tree->db.updateleaf);
+ sqlite3_finalize(tree->db.insertleaf);
+ sqlite3_finalize(tree->db.findleaf);
+ sqlite3_finalize(tree->db.findencloser);
+ sqlite3_finalize(tree->db.findleaf_or_encloser);
+ }
free(tree);
}
}