mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
If PQgetCancel() returns NULL we should also return false.
Noted by Andres Freund.
This commit is contained in:
@@ -443,8 +443,9 @@ CancelQuery(PGconn *conn, int timeout)
|
|||||||
|
|
||||||
pgcancel = PQgetCancel(conn);
|
pgcancel = PQgetCancel(conn);
|
||||||
|
|
||||||
if (pgcancel != NULL)
|
if (pgcancel == NULL)
|
||||||
{
|
return false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PQcancel can only return 0 if socket()/connect()/send()
|
* PQcancel can only return 0 if socket()/connect()/send()
|
||||||
* fails, in any of those cases we can assume something
|
* fails, in any of those cases we can assume something
|
||||||
@@ -458,7 +459,6 @@ CancelQuery(PGconn *conn, int timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PQfreeCancel(pgcancel);
|
PQfreeCancel(pgcancel);
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user