Work around a false positive returned by the static checker

To be submitted to the author.
This commit is contained in:
Daniele Varrazzo 2012-02-29 23:53:00 +00:00
parent a167822e26
commit 9432787279

View File

@ -956,9 +956,10 @@ pq_execute(cursorObject *curs, const char *query, int async)
if (pq_fetch(curs) < 0) return -1;
}
else {
PyObject *tmp;
curs->conn->async_status = async_status;
curs->conn->async_cursor = PyWeakref_NewRef((PyObject *)curs, NULL);
if (!curs->conn->async_cursor) {
curs->conn->async_cursor = tmp = PyWeakref_NewRef((PyObject *)curs, NULL);
if (!tmp) {
/* weakref creation failed */
return -1;
}