Added cpychecker hints to libpq

This commit is contained in:
Daniele Varrazzo 2019-01-22 17:26:39 +00:00
parent de1b816f83
commit 6dc1f9a3b0

View File

@ -1281,10 +1281,10 @@ _pq_fetch_tuples(cursorObject *curs)
PyTuple_SET_ITEM(casts, i, cast); PyTuple_SET_ITEM(casts, i, cast);
} }
curs->description = description; curs->description = TO_STATE(description);
description = NULL; description = NULL;
curs->casts = casts; curs->casts = TO_STATE(casts);
casts = NULL; casts = NULL;
rv = 0; rv = 0;
@ -1744,6 +1744,7 @@ pq_send_replication_feedback(replicationCursorObject *repl, int reply_requested)
When no message is available, blocks on the connection socket, but When no message is available, blocks on the connection socket, but
manages to send keepalive messages to the server as needed. manages to send keepalive messages to the server as needed.
*/ */
IGNORE_REFCOUNT /* cpychecker bug TODO report */
int int
pq_copy_both(replicationCursorObject *repl, PyObject *consume, double keepalive_interval) pq_copy_both(replicationCursorObject *repl, PyObject *consume, double keepalive_interval)
{ {
@ -1860,8 +1861,8 @@ pq_fetch(cursorObject *curs, int no_result)
/* backend status message */ /* backend status message */
Py_CLEAR(curs->pgstatus); Py_CLEAR(curs->pgstatus);
if (!(curs->pgstatus = conn_text_from_chars( if (!(curs->pgstatus = TO_STATE(conn_text_from_chars(
curs->conn, PQcmdStatus(curs->pgres)))) { curs->conn, PQcmdStatus(curs->pgres))))) {
ex = -1; ex = -1;
return ex; return ex;
} }