From affac0062dfdca716f4dc9228476b06a516c032b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 24 Jul 2015 08:05:45 +0300 Subject: Issue #24703: Fixed resource leak on error in bsddb.verify(). Original patch by Pankaj Sharma. --- Modules/_bsddb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index 203bba2..408efc3 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -3454,9 +3454,11 @@ DB_verify(DBObject* self, PyObject* args, PyObject* kwargs) error=DB_close_internal(self, 0, 1); if (error) { - return error; + if (outFile) + fclose(outFile); + return error; } - } + } MYDB_BEGIN_ALLOW_THREADS; err = self->db->verify(self->db, fileName, dbName, outFile, flags); -- cgit v0.12