summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-07-24 05:05:45 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-07-24 05:05:45 (GMT)
commitaffac0062dfdca716f4dc9228476b06a516c032b (patch)
tree2fe54239decedc57874bcd43034cfd4d62b65c7c
parent81c670d5405192d6c5b6d7fb8ffa3779173a895b (diff)
downloadcpython-affac0062dfdca716f4dc9228476b06a516c032b.zip
cpython-affac0062dfdca716f4dc9228476b06a516c032b.tar.gz
cpython-affac0062dfdca716f4dc9228476b06a516c032b.tar.bz2
Issue #24703: Fixed resource leak on error in bsddb.verify().
Original patch by Pankaj Sharma.
-rw-r--r--Modules/_bsddb.c6
1 files 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);