diff --git a/cadical/src/lib.rs b/cadical/src/lib.rs index b5408cd8..d0c88651 100644 --- a/cadical/src/lib.rs +++ b/cadical/src/lib.rs @@ -93,6 +93,10 @@ unsafe impl Send for CaDiCaL<'_, '_> {} impl Default for CaDiCaL<'_, '_> { fn default() -> Self { + let handle = unsafe { ffi::ccadical_init() }; + if handle.is_null() { + panic!("not enough memory to initialize CaDiCaL solver") + } let solver = Self { handle: unsafe { ffi::ccadical_init() }, state: Default::default(),