proxmox_backup_free_error: test if ptr == NULL

This commit is contained in:
Dietmar Maurer 2019-10-25 08:50:38 +02:00
parent ce96ec7bd7
commit 6abb11b405

View File

@ -30,7 +30,9 @@ use restore::*;
/// and free the allocated memory.
#[no_mangle]
pub extern "C" fn proxmox_backup_free_error(ptr: * mut c_char) {
unsafe { CString::from_raw(ptr); }
if ptr != std::ptr::null_mut() {
unsafe { CString::from_raw(ptr); }
}
}
macro_rules! raise_error_null {