Skip to content

Commit cdaabee

Browse files
committed
Check close v2 error code
1 parent 8d8c9c7 commit cdaabee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

c_src/sqlite3_nif.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ exqlite_close(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
261261
// v1 is guaranteed to close or error, but will return error if any
262262
// unfinalized statements, which we likely have, as we rely on the destructors
263263
// to later run to clean those up
264-
sqlite3_close_v2(conn->db);
264+
rc = sqlite3_close_v2(conn->db);
265+
if (rc != SQLITE_OK) {
266+
return make_sqlite3_error_tuple(env, rc, conn->db);
267+
}
265268

266269
conn->db = NULL;
267270

0 commit comments

Comments
 (0)