Subject: | Memory leak in db_verify() method. (libdb < 4.2) |
Hello!
I am using libdb 3.3.11 and Berkley DB 0.51.
I encountered memory leak problem when I have calling db_verify() method repeatedly.
I think, this problem causes libdb 4.1 or older versions.
libdb 4.1 or older versions are not destroying a DB handle in DB->verify() method.
Berkeley DB 4.2.52 Change Log
http://www.oracle.com/technetwork/products/berkeleydb/if-086276.html
Show quoted text
> Change the DB->verify method API to act as a DB handle destructor. [#7418]
--- BerkeleyDB.xs.orig 2013-04-03 18:03:49.808475163 +0900
+++ BerkeleyDB.xs 2013-04-03 18:03:52.268386453 +0900
@@ -2299,6 +2299,9 @@
RETVAL = db_create(&dbp, dbenv, 0) ;
if (RETVAL == 0) {
RETVAL = dbp->verify(dbp, db, subdb, ofh, flags) ;
+ #ifndef AT_LEAST_DB_4_2
+ dbp->close(dbp, 0) ;
+ #endif
}
if (outfile)
fclose(ofh);