diff options
Diffstat (limited to 'src/bin/psql')
-rw-r--r-- | src/bin/psql/command.c | 3 | ||||
-rw-r--r-- | src/bin/psql/variables.c | 5 |
2 files changed, 3 insertions, 5 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); diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c index 47c58d2be9d..5cc4bc0cb78 100644 --- a/src/bin/psql/variables.c +++ b/src/bin/psql/variables.c @@ -255,8 +255,7 @@ SetVariable(VariableSpace space, const char *name, const char *value) if (confirmed) { - if (current->value) - pg_free(current->value); + pg_free(current->value); current->value = new_value; /* @@ -272,7 +271,7 @@ SetVariable(VariableSpace space, const char *name, const char *value) free(current); } } - else if (new_value) + else pg_free(new_value); /* current->value is left unchanged */ return confirmed; |