1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Remove redundant null pointer checks before pg_free()

These are especially useless because the whole point of pg_free() was
to do that very check before calling free().

pg_free() could be removed altogether, but I'm keeping it here to keep
the API consistent.

Discussion: https://www.postgresql.org/message-id/flat/dac5d2d0-98f5-94d9-8e69-46da2413593d%40enterprisedb.com
This commit is contained in:
Peter Eisentraut
2022-06-17 11:51:38 +02:00
parent e2bc242833
commit 098c703d30
5 changed files with 13 additions and 25 deletions

View File

@ -3492,8 +3492,7 @@ do_connect(enum trivalue reuse_previous_specification,
} /* end retry loop */
/* Release locally allocated data, whether we succeeded or not */
if (password)
pg_free(password);
pg_free(password);
if (cinfo)
PQconninfoFree(cinfo);