sqlite: fix memory leak

This commit is contained in:
Chris Sosnin 2020-12-12 01:45:21 +03:00 committed by Ryan Leckey
parent 9f99a8f3d2
commit df1b9b06ed

View File

@ -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()))))
}
}