8000 Avoid segfault when there is a poll error · PyGreSQL/PyGreSQL@7d93eb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d93eb2

Browse files
committed
Avoid segfault when there is a poll error
1 parent 741f734 commit 7d93eb2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/pgconn.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ conn_getattr(connObject *self, PyObject *nameobj)
4545
/* postmaster host */
4646
if (!strcmp(name, "host")) {
4747
char *r = PQhost(self->cnx);
48-
if (!r || r[0] == '/') /* Pg >= 9.6 can return a Unix socket path */
48+
if (!r || r[0] == '/') /* this can return a Unix socket path */
4949
r = "localhost";
5050
return PyUnicode_FromString(r);
5151
}
@@ -1577,7 +1577,6 @@ conn_poll(connObject *self, PyObject *noargs)
15771577

15781578
if (rc == PGRES_POLLING_FAILED) {
15791579
set_error(InternalError, "Polling failed", self->cnx, NULL);
1580-
Py_XDECREF(self);
15811580
return NULL;
15821581
}
15831582

0 commit comments

Comments
 (0)
0