Make cb_set_config() safe

This commit is contained in:
Alexander Krotov
2019-07-30 02:43:39 +03:00
parent 9314a5a8fd
commit f87c98d6ea
3 changed files with 4 additions and 16 deletions

View File

@@ -914,13 +914,7 @@ impl Imap {
let key = format!("imap.mailbox.{}", folder.as_ref());
let val = format!("{}:{}", uidvalidity, lastseenuid);
unsafe {
let key_c = to_cstring(key);
let val_c = to_cstring(val);
(self.set_config)(context, key_c, val_c);
free(key_c as *mut _);
free(val_c as *mut _);
};
(self.set_config)(context, &key, Some(&val));
}
fn fetch_single_msg<S: AsRef<str>>(