mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
sqlite: fix memory leak
This commit is contained in:
parent
d7c447a9c6
commit
4c1cf86380
1 changed files with 2 additions and 0 deletions
|
@ -69,6 +69,8 @@ where
|
|||
if r == SQLITE_OK {
|
||||
Ok(())
|
||||
} else {
|
||||
// The xDestroy callback is not called if the sqlite3_create_collation_v2() function fails.
|
||||
drop(unsafe { Box::from_raw(boxed_f) });
|
||||
Err(Error::Database(Box::new(SqliteError::new(handle.as_ptr()))))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue