If PQgetCancel() returns NULL we should also return false.

Noted by Andres Freund.
This commit is contained in:
Jaime Casanova
2013-07-12 08:01:01 -05:00
parent 2bc8044fda
commit 2e7acf03c4

View File

@@ -443,8 +443,9 @@ CancelQuery(PGconn *conn, int timeout)
pgcancel = PQgetCancel(conn);
if (pgcancel != NULL)
{
if (pgcancel == NULL)
return false;
/*
* PQcancel can only return 0 if socket()/connect()/send()
* fails, in any of those cases we can assume something
@@ -458,7 +459,6 @@ CancelQuery(PGconn *conn, int timeout)
}
PQfreeCancel(pgcancel);
}
return true;
}