Comment by kelnos
This article makes no sense. I don't know why you'd ever think you can allocate a Rust object, pass it to C code, and assume it's safe for that C code to call free() on it. This would be true for any other pair of languages when crossing an FFI boundary.
A possible "defer" keyword has nothing to do with any of this, and will not help you.
Rust doesn't need "defer".