Skip to content

Commit 0f402f3

Browse files
committed
Adapted AuditLog based on code check hints
1 parent 01c427f commit 0f402f3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

headers/modsecurity/audit_log.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class AuditLog {
207207
AuditLogType m_type = NotSetAuditLogType;
208208
std::string m_relevant = std::string("");
209209

210-
audit_log::writer::Writer *m_writer = NULL;
210+
audit_log::writer::Writer *m_writer = nullptr;
211211
bool m_ctlAuditEngineActive = false; // rules have at least one action On or RelevantOnly
212212
};
213213

src/audit_log/audit_log.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ namespace modsecurity {
5151
namespace audit_log {
5252

5353

54-
AuditLog::AuditLog() { }
54+
AuditLog::AuditLog() = default;
5555

5656

5757
AuditLog::~AuditLog() {
5858
if (m_writer) {
5959
delete m_writer;
60-
m_writer = NULL;
60+
m_writer = nullptr;
6161
}
6262
}
6363

@@ -210,7 +210,7 @@ bool AuditLog::init(std::string *error) {
210210
&& !m_ctlAuditEngineActive) {
211211
if (m_writer) {
212212
delete m_writer;
213-
m_writer = NULL;
213+
m_writer = nullptr;
214214
}
215215
return true;
216216
}
@@ -228,7 +228,7 @@ bool AuditLog::init(std::string *error) {
228228
tmp_writer = new audit_log::writer::Serial(this);
229229
}
230230

231-
if (tmp_writer == NULL) {
231+
if (tmp_writer == nullptr) {
232232
error->assign("Writer memory alloc failed!");
233233
return false;
234234
}
@@ -306,7 +306,7 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) {
306306
}
307307
ms_dbg_a(transaction, 5, "Saving this request as part " \
308308
"of the audit logs.");
309-
if (m_writer == NULL) {
309+
if (m_writer == nullptr) {
310310
ms_dbg_a(transaction, 1, "Internal error, audit log writer is null");
311311
} else {
312312
std::string error;

0 commit comments

Comments
 (0)