diff --git a/headers/modsecurity/audit_log.h b/headers/modsecurity/audit_log.h index d1a6c3ab..bfc2f99b 100644 --- a/headers/modsecurity/audit_log.h +++ b/headers/modsecurity/audit_log.h @@ -207,7 +207,7 @@ class AuditLog { AuditLogType m_type = NotSetAuditLogType; std::string m_relevant = std::string(""); - audit_log::writer::Writer *m_writer = NULL; + audit_log::writer::Writer *m_writer = nullptr; bool m_ctlAuditEngineActive = false; // rules have at least one action On or RelevantOnly }; diff --git a/src/audit_log/audit_log.cc b/src/audit_log/audit_log.cc index 18d1d529..01dd82ea 100644 --- a/src/audit_log/audit_log.cc +++ b/src/audit_log/audit_log.cc @@ -51,13 +51,13 @@ namespace modsecurity { namespace audit_log { -AuditLog::AuditLog() { } +AuditLog::AuditLog() = default; AuditLog::~AuditLog() { if (m_writer) { delete m_writer; - m_writer = NULL; + m_writer = nullptr; } } @@ -210,7 +210,7 @@ bool AuditLog::init(std::string *error) { && !m_ctlAuditEngineActive) { if (m_writer) { delete m_writer; - m_writer = NULL; + m_writer = nullptr; } return true; } @@ -228,7 +228,7 @@ bool AuditLog::init(std::string *error) { tmp_writer = new audit_log::writer::Serial(this); } - if (tmp_writer == NULL) { + if (tmp_writer == nullptr) { error->assign("Writer memory alloc failed!"); return false; } @@ -306,7 +306,7 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) { } ms_dbg_a(transaction, 5, "Saving this request as part " \ "of the audit logs."); - if (m_writer == NULL) { + if (m_writer == nullptr) { ms_dbg_a(transaction, 1, "Internal error, audit log writer is null"); } else { std::string error;