Closed lizhuohua closed 2 years ago
In function run_callbacks, string pointers are extracted from CString by using into_raw().
run_callbacks
CString
into_raw()
https://github.com/BrettMayson/arma-rs/blob/3b43d2100d64138f4fc8b5851799492bffce0e9a/arma-rs/src/lib.rs#L131
However, this also transfers ownership of the string to the C caller, which will lead to a memory leak. See the documents here: https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_raw
In function
run_callbacks
, string pointers are extracted fromCString
by usinginto_raw()
.https://github.com/BrettMayson/arma-rs/blob/3b43d2100d64138f4fc8b5851799492bffce0e9a/arma-rs/src/lib.rs#L131
However, this also transfers ownership of the string to the C caller, which will lead to a memory leak. See the documents here: https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_raw