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.
This commit is contained in:
Neal Norwitz 2006-06-11 05:44:18 +00:00
parent 7f54740c4d
commit b4fcf8d787
1 changed files with 2 additions and 4 deletions

View File

@ -5560,15 +5560,13 @@ DBEnv_construct(PyObject* self, PyObject* args)
static PyObject* static PyObject*
DBSequence_construct(PyObject* self, PyObject* args, PyObject* kwargs) DBSequence_construct(PyObject* self, PyObject* args, PyObject* kwargs)
{ {
PyObject* dbobj = NULL; PyObject* dbobj;
int flags = 0; int flags = 0;
static char* kwnames[] = { "db", "flags", NULL}; static char* kwnames[] = { "db", "flags", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:DBSequence", kwnames, &dbobj, &flags)) if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:DBSequence", kwnames, &dbobj, &flags))
return NULL; return NULL;
if (dbobj == Py_None) if (!DBObject_Check(dbobj)) {
dbobj = NULL;
else if (dbobj && !DBObject_Check(dbobj)) {
makeTypeError("DB", dbobj); makeTypeError("DB", dbobj);
return NULL; return NULL;
} }