mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
introduce safety and a particular EncryptHelper
This commit is contained in:
@@ -78,8 +78,8 @@ pub fn append_ct_param(
|
||||
value: &str,
|
||||
) -> Result<(), Error> {
|
||||
unsafe {
|
||||
let name_c = CString::new(name).unwrap().as_ptr();
|
||||
let value_c = CString::new(value).unwrap().as_ptr();
|
||||
let name_c = name.strdup();
|
||||
let value_c = value.strdup();
|
||||
|
||||
clist_append!(
|
||||
(*content).ct_parameters,
|
||||
@@ -88,6 +88,8 @@ pub fn append_ct_param(
|
||||
value_c as *const u8 as *const libc::c_char as *mut libc::c_char
|
||||
)
|
||||
);
|
||||
libc::free(name_c as *mut libc::c_void);
|
||||
libc::free(value_c as *mut libc::c_void);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user