impl Drop for AppLayerTxData {
fn drop(&mut self) {
- if self.de_state != std::ptr::null_mut() {
+ if !self.de_state.is_null() {
core::sc_detect_engine_state_free(self.de_state);
}
- if self.events != std::ptr::null_mut() {
+ if !self.events.is_null() {
core::sc_app_layer_decoder_events_free_events(&mut self.events);
}
}
pub unsafe extern "C" fn jb_set_base64(
js: &mut JsonBuilder, key: *const c_char, bytes: *const u8, len: u32,
) -> bool {
- if bytes == std::ptr::null() || len == 0 {
+ if bytes.is_null() || len == 0 {
return false;
}
if let Ok(key) = CStr::from_ptr(key).to_str() {
pub unsafe extern "C" fn jb_set_hex(
js: &mut JsonBuilder, key: *const c_char, bytes: *const u8, len: u32,
) -> bool {
- if bytes == std::ptr::null() || len == 0 {
+ if bytes.is_null() || len == 0 {
return false;
}
if let Ok(key) = CStr::from_ptr(key).to_str() {
pub unsafe extern "C" fn jb_append_base64(
js: &mut JsonBuilder, bytes: *const u8, len: u32,
) -> bool {
- if bytes == std::ptr::null() || len == 0 {
+ if bytes.is_null() || len == 0 {
return false;
}
let val = std::slice::from_raw_parts(bytes, len as usize);