Skip to content

Commit df1b9b0

Browse files
slumbermehcode
authored andcommitted
sqlite: fix memory leak
1 parent 9f99a8f commit df1b9b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sqlx-core/src/sqlite/connection/collation.rs

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ where
6969
if r == SQLITE_OK {
7070
Ok(())
7171
} else {
72+
// The xDestroy callback is not called if the sqlite3_create_collation_v2() function fails.
73+
drop(unsafe { Box::from_raw(boxed_f) });
7274
Err(Error::Database(Box::new(SqliteError::new(handle.as_ptr()))))
7375
}
7476
}

0 commit comments

Comments
 (0)