]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
LMDB: Clarify that the base commit() method should be called in the dtor
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 29 Mar 2022 15:49:41 +0000 (17:49 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 29 Mar 2022 15:49:41 +0000 (17:49 +0200)
CodeQL warns that there might some ambiguity about whether the base
or derived commit() method is called in derived classes:

https://github.com/PowerDNS/pdns/security/code-scanning/379

ext/lmdb-safe/lmdb-safe.cc

index f159eafafa217861bbb1f5d1309d7849e4c1a7f6..ed7f27a1e2d717aea5d9789524407df845567354 100644 (file)
@@ -262,7 +262,7 @@ MDBROTransactionImpl::MDBROTransactionImpl(MDBEnv *parent, int flags):
 MDBROTransactionImpl::~MDBROTransactionImpl()
 {
   // this is safe because C++ will not call overrides of virtual methods in destructors.
-  commit();
+  MDBROTransactionImpl::commit();
 }
 
 void MDBROTransactionImpl::abort()