aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/variables.c')
-rw-r--r--src/bin/psql/variables.c5
1 files changed, 2 insertions, 3 deletions
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;