Skip to content

Commit

Permalink
sqlite: fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
slumber authored and mehcode committed Dec 17, 2020
1 parent 9f99a8f commit df1b9b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sqlx-core/src/sqlite/connection/collation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))))
}
}

0 comments on commit df1b9b0

Please sign in to comment.