Commit c6339096 authored by Neal Norwitz's avatar Neal Norwitz

Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.

We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
parent c21dbd64
......@@ -5560,15 +5560,13 @@ DBEnv_construct(PyObject* self, PyObject* args)
static PyObject*
DBSequence_construct(PyObject* self, PyObject* args, PyObject* kwargs)
{
PyObject* dbobj = NULL;
PyObject* dbobj;
int flags = 0;
static char* kwnames[] = { "db", "flags", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:DBSequence", kwnames, &dbobj, &flags))
return NULL;
if (dbobj == Py_None)
dbobj = NULL;
else if (dbobj && !DBObject_Check(dbobj)) {
if (!DBObject_Check(dbobj)) {
makeTypeError("DB", dbobj);
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment