The ref-swap crate versions prior to 0.1.3 contain incorrect variance definitions for RefSwap and OptionRefSwap, which may lead to use-after-free vulnerabilities. Additionally, OptionRefSwap::into_inner did not properly check for null values. These issues were addressed by making RefSwap and OptionRefSwap invariant and modifying OptionRefSwap::into_inner to return an option. Projects compiling with version 0.1.3 or later are not affected.