#define SMTP_MPM DEFAULT_MPM
static MpmCtx *smtp_mpm_ctx = NULL;
-MpmThreadCtx *smtp_mpm_thread_ctx;
+static MpmThreadCtx *smtp_mpm_thread_ctx = NULL;
/* smtp reply codes. If an entry is made here, please make a simultaneous
* entry in smtp_reply_map */
MpmInitThreadCtx(smtp_mpm_thread_ctx, SMTP_MPM);
}
+static void SMTPFreeMpmState(void)
+{
+ if (smtp_mpm_thread_ctx != NULL) {
+ mpm_table[SMTP_MPM].DestroyThreadCtx(smtp_mpm_ctx, smtp_mpm_thread_ctx);
+ smtp_mpm_thread_ctx = NULL;
+ }
+ if (smtp_mpm_ctx != NULL) {
+ mpm_table[SMTP_MPM].DestroyCtx(smtp_mpm_ctx);
+ smtp_mpm_ctx = NULL;
+ }
+}
+
int SMTPStateGetEventInfo(const char *event_name,
int *event_id, AppLayerEventType *event_type)
{
return;
}
+/**
+ * \brief Free memory allocated for global SMTP parser state.
+ */
+void SMTPParserCleanup(void)
+{
+ SMTPFreeMpmState();
+}
+
/***************************************Unittests******************************/
#ifdef UNITTESTS
int SMTPProcessDataChunk(const uint8_t *chunk, uint32_t len, MimeDecParseState *state);
void *SMTPStateAlloc(void);
void RegisterSMTPParsers(void);
+void SMTPParserCleanup(void);
void SMTPParserRegisterTests(void);
#endif /* __APP_LAYER_SMTP_H__ */