diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-10-30 07:37:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-30 07:37:20 -0400 |
commit | 632e0406595ade9da40317a777f438c43ea5b5f3 (patch) | |
tree | d05364c1b865474ba0e149e51f4146447e14b3a2 /src/rust/protover/ffi.rs | |
parent | 709cd447f0b207f969d448bd4fe2d5f2795e678d (diff) | |
download | tor-632e0406595ade9da40317a777f438c43ea5b5f3.tar.gz tor-632e0406595ade9da40317a777f438c43ea5b5f3.zip |
Try to restore a proper fix for bug27740 in 0.3.5.
(I messed up the merge in 289a7dbac32a981897e12a3c250f0b6c67eec809.)
Diffstat (limited to 'src/rust/protover/ffi.rs')
-rw-r--r-- | src/rust/protover/ffi.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs index f17f30127d..e29efd6dfc 100644 --- a/src/rust/protover/ffi.rs +++ b/src/rust/protover/ffi.rs @@ -65,12 +65,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; |