File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -768,22 +768,19 @@ impl rustls_client_config {
768768 }
769769 CStr :: from_ptr( server_name)
770770 } ;
771- let config = try_clone_arc!( config) ;
772- let conn_out = try_mut_from_ptr_ptr!( conn_out) ;
773-
774771 let Ok ( server_name) = server_name. to_str( ) else {
775772 return rustls_result:: InvalidDnsNameError ;
776773 } ;
777774 let Ok ( server_name) = server_name. try_into( ) else {
778775 return rustls_result:: InvalidDnsNameError ;
779776 } ;
780- let client = ClientConnection :: new( config, server_name) . unwrap( ) ;
781777
782- // We've succeeded. Put the client on the heap, and transfer ownership
783- // to the caller. After this point, we must return rustls_result::Ok so the
784- // caller knows it is responsible for this memory.
785- let c = Connection :: from_client( client) ;
786- set_boxed_mut_ptr( conn_out, c) ;
778+ set_boxed_mut_ptr(
779+ try_mut_from_ptr_ptr!( conn_out) ,
780+ Connection :: from_client(
781+ ClientConnection :: new( try_clone_arc!( config) , server_name) . unwrap( ) ,
782+ ) ,
783+ ) ;
787784 rustls_result:: Ok
788785 }
789786 }
You can’t perform that action at this time.
0 commit comments