diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-15 16:11:29 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-15 16:11:29 -0500 |
commit | 31cc0d2c0bce11dbddec9e5869fdb2ce1acc001d (patch) | |
tree | 75d3cb79abb3fb9b8a7d8fda23588e83b6d19fb9 /src/rust | |
parent | 92f71b8e88c58b38c027a291066337f896ad344b (diff) | |
parent | 4b6b58ed8ec6f5870bf5825e0013339f0223fa06 (diff) | |
download | tor-31cc0d2c0bce11dbddec9e5869fdb2ce1acc001d.tar.gz tor-31cc0d2c0bce11dbddec9e5869fdb2ce1acc001d.zip |
Merge branch 'maint-0.3.5'
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/protover/ffi.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs index ac149fbbbc..5c29adf045 100644 --- a/src/rust/protover/ffi.rs +++ b/src/rust/protover/ffi.rs @@ -7,7 +7,6 @@ use libc::{c_char, c_int, uint32_t}; use std::ffi::CStr; -use std::ffi::CString; use smartlist::*; use tor_allocate::allocate_and_copy_string; @@ -65,12 +64,7 @@ pub extern "C" fn protover_all_supported( if missing_out.is_null() { return 0; } - let c_unsupported: CString = match CString::new(unsupported.to_string()) { - Ok(n) => n, - Err(_) => return 1, - }; - - let ptr = c_unsupported.into_raw(); + let ptr = allocate_and_copy_string(&unsupported.to_string()); unsafe { *missing_out = ptr }; return 0; |