diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-10-23 19:18:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-23 19:18:23 -0400 |
commit | 7edc594ee732960733d34309980d0e7190e35fb2 (patch) | |
tree | dcbecd9e65b0e7d2e4c59b34049f7db350abbbec /src/rust | |
parent | d1eac7830fbd86d145c1892b8a7123615cc34658 (diff) | |
parent | 169bc670ddf9fe898800a2814a1ec30dcc3249da (diff) | |
download | tor-7edc594ee732960733d34309980d0e7190e35fb2.tar.gz tor-7edc594ee732960733d34309980d0e7190e35fb2.zip |
Merge branch 'maint-0.3.3' into maint-0.3.4
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/protover/ffi.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs index e3e545db75..f55b87acf6 100644 --- a/src/rust/protover/ffi.rs +++ b/src/rust/protover/ffi.rs @@ -65,12 +65,10 @@ pub extern "C" fn protover_all_supported( if maybe_unsupported.is_some() { let unsupported: UnvalidatedProtoEntry = maybe_unsupported.unwrap(); - let c_unsupported: CString = match CString::new(unsupported.to_string()) { - Ok(n) => n, - Err(_) => return 1, - }; - - let ptr = c_unsupported.into_raw(); + if missing_out.is_null() { + return 0; + } + let ptr = allocate_and_copy_string(&unsupported.to_string()); unsafe { *missing_out = ptr }; return 0; |