Add null checks to prevent double frees in vtab connections

This commit is contained in:
PThorpe92
2025-05-24 15:20:09 -04:00
parent 999205f896
commit 2e4343402e

View File

@@ -516,6 +516,9 @@ impl Statement {
/// Close the statement
pub fn close(&self) {
if self._ctx.is_null() {
return;
}
unsafe { (*self._ctx).close() }
}
}
@@ -566,6 +569,10 @@ impl Stmt {
/// Close the statement
pub fn close(&self) {
// null check to prevent double free
if self._ctx.is_null() {
return;
}
unsafe { (self._close)(self as *const Stmt as *mut Stmt) };
}