aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-06-17 11:51:38 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-07-03 09:05:34 +0200
commit098c703d308fa88dc9e3f9f623ca023ce4717794 (patch)
tree81e03668d6fc6ea832f16996da78e3483beef4f7 /src/bin/psql/command.c
parente2bc242833da27cd73c279bebfb321a65384808f (diff)
downloadpostgresql-098c703d308fa88dc9e3f9f623ca023ce4717794.tar.gz
postgresql-098c703d308fa88dc9e3f9f623ca023ce4717794.zip
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
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b51d28780b1..653943b87a6 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -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);