sqlite: fix memory leak

This commit is contained in:
Chris Sosnin 2020-12-12 01:45:21 +03:00 committed by Ryan Leckey
parent d7c447a9c6
commit 4c1cf86380
No known key found for this signature in database
GPG key ID: F8AA68C235AB08C9

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