From: Marcin Siodelski Date: Tue, 20 Jul 2021 12:10:43 +0000 (+0200) Subject: [#1928] Throw upon clearing not started audit X-Git-Tag: Kea-1.9.10~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e77245c57106bf2f47663ded95cd6169c8f0123;p=thirdparty%2Fkea.git [#1928] Throw upon clearing not started audit --- diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc index 5a2f6f06c1..51e35d11f0 100644 --- a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc +++ b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc @@ -179,9 +179,10 @@ MySqlConfigBackendImpl::createAuditRevision(const int index, void MySqlConfigBackendImpl::clearAuditRevision() { - if (audit_revision_ref_count_ > 0) { - --audit_revision_ref_count_; + if (audit_revision_ref_count_ <= 0) { + isc_throw(Unexpected, "attempted to clear audit revision that does not exist - coding error"); } + --audit_revision_ref_count_; } void