dcerpc/tcp: add missing detect state cleanup

pull/5533/head
Victor Julien 5 years ago
parent c72069c3b2
commit 67b5295bbc

@ -17,7 +17,7 @@
use std::mem::transmute; use std::mem::transmute;
use crate::applayer::{AppLayerResult, AppLayerTxData}; use crate::applayer::{AppLayerResult, AppLayerTxData};
use crate::core; use crate::core::{self, sc_detect_engine_state_free};
use crate::dcerpc::parser; use crate::dcerpc::parser;
use nom::error::ErrorKind; use nom::error::ErrorKind;
use nom::number::Endianness; use nom::number::Endianness;
@ -184,6 +184,15 @@ impl DCERPCTransaction {
}; };
} }
pub fn free(&mut self) {
match self.de_state {
Some(state) => {
sc_detect_engine_state_free(state);
}
_ => {}
}
}
pub fn get_req_ctxid(&self) -> u16 { pub fn get_req_ctxid(&self) -> u16 {
self.ctxid self.ctxid
} }
@ -201,6 +210,12 @@ impl DCERPCTransaction {
} }
} }
impl Drop for DCERPCTransaction {
fn drop(&mut self) {
self.free();
}
}
#[derive(Debug)] #[derive(Debug)]
pub struct DCERPCRequest { pub struct DCERPCRequest {
pub ctxid: u16, pub ctxid: u16,

Loading…
Cancel
Save