]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1928] Throw upon clearing not started audit
authorMarcin Siodelski <marcin@isc.org>
Tue, 20 Jul 2021 12:10:43 +0000 (14:10 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 21 Jul 2021 10:49:50 +0000 (10:49 +0000)
src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc

index 5a2f6f06c1feba0f922117c26fc7f3fcdc84623c..51e35d11f0ed9943b6aaecaa571d992fb44f6538 100644 (file)
@@ -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