rust: Minor nit fixing I stumbled upon this and I am not sure what I was thinking. Signed-off-by: Xiangfei Ding <xfding@google.com> Change-Id: Ifbb091bdaf8d726a4781543b255225d36a6a6964 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/100307 Presubmit-BoringSSL-Verified: boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/rust/bssl-tls/src/methods.rs b/rust/bssl-tls/src/methods.rs index 0efd790..2d0ed4c 100644 --- a/rust/bssl-tls/src/methods.rs +++ b/rust/bssl-tls/src/methods.rs
@@ -29,11 +29,11 @@ _argl: c_long, _argp: *mut c_void, ) { + if ptr.is_null() { + return; + } abort_on_panic(move || { let _ = unsafe { - if ptr.is_null() { - return; - } // Safety: the data was boxed and stored via SSL_CTX_set_ex_data. Box::from_raw(ptr as *mut M) };