PYTHON-1466 Silence minor complaints from Coverity
Remove useless NULL check as GETSTATE cannot return NULL after successful initialization.
This commit is contained in:
parent
fde5b8685e
commit
1a784e1afb
@ -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(
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user