mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Remove redundant null pointer checks before PQclear and PQconninfoFree
These functions already had the free()-like behavior of handling null pointers as a no-op. But it wasn't documented, so add it explicitly to the documentation, too. Discussion: https://www.postgresql.org/message-id/flat/dac5d2d0-98f5-94d9-8e69-46da2413593d%40enterprisedb.com
This commit is contained in:
@ -157,8 +157,7 @@ dblink_res_internalerror(PGconn *conn, PGresult *res, const char *p2)
|
||||
{
|
||||
char *msg = pchomp(PQerrorMessage(conn));
|
||||
|
||||
if (res)
|
||||
PQclear(res);
|
||||
PQclear(res);
|
||||
elog(ERROR, "%s: %s", p2, msg);
|
||||
}
|
||||
|
||||
@ -2756,8 +2755,7 @@ dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
|
||||
* leaking all the strings too, but those are in palloc'd memory that will
|
||||
* get cleaned up eventually.
|
||||
*/
|
||||
if (res)
|
||||
PQclear(res);
|
||||
PQclear(res);
|
||||
|
||||
/*
|
||||
* Format the basic errcontext string. Below, we'll add on something
|
||||
|
Reference in New Issue
Block a user