check against null in dc_backup_provider_unref() (#4232)

this is what we're doing in most comparable unref() functions.
This commit is contained in:
bjoern
2023-03-26 19:25:23 +02:00
committed by GitHub
parent 0dfec83b0f
commit 070d832580

View File

@@ -4230,6 +4230,10 @@ pub unsafe extern "C" fn dc_backup_provider_wait(provider: *mut dc_backup_provid
#[no_mangle]
pub unsafe extern "C" fn dc_backup_provider_unref(provider: *mut dc_backup_provider_t) {
if provider.is_null() {
eprintln!("ignoring careless call to dc_backup_provider_unref()");
return;
}
drop(Box::from_raw(provider));
}