PYTHON-1466 Silence minor complaints from Coverity

Remove useless NULL check as GETSTATE cannot return NULL after
successful initialization.
This commit is contained in:
Shane Harvey 2018-01-30 17:32:12 -08:00
parent fde5b8685e
commit 1a784e1afb
2 changed files with 3 additions and 8 deletions

View File

@ -2642,8 +2642,8 @@ static PyObject* _elements_to_dict(PyObject* self, const char* string,
return NULL;
}
while (position < max) {
PyObject* name;
PyObject* value;
PyObject* name = NULL;
PyObject* value = NULL;
int new_position;
new_position = _element_to_dict(

View File

@ -1293,7 +1293,6 @@ init_cmessage(void)
PyObject *_cbson = NULL;
PyObject *c_api_object = NULL;
PyObject *m = NULL;
struct module_state *state;
/* Store a reference to the _cbson module since it's needed to call some
* of its functions
@ -1330,11 +1329,7 @@ init_cmessage(void)
goto fail;
}
state = GETSTATE(m);
if (state == NULL) {
goto fail;
}
state->_cbson = _cbson;
GETSTATE(m)->_cbson = _cbson;
Py_DECREF(c_api_object);