summaryrefslogtreecommitdiff
path: root/src/bin/psql/describe.c
diff options
context:
space:
mode:
authorPeter Eisentraut2022-06-16 19:50:56 +0000
committerPeter Eisentraut2022-07-03 09:47:15 +0000
commit02c408e21a6e78ff246ea7a1beb4669634fa9c4c (patch)
tree7e4cf03f3de7e32af266b739e12c6600d871ed45 /src/bin/psql/describe.c
parent098c703d308fa88dc9e3f9f623ca023ce4717794 (diff)
Remove redundant null pointer checks before free()
Per applicable standards, free() with a null pointer is a no-op. Systems that don't observe that are ancient and no longer relevant. Some PostgreSQL code already required this behavior, so this change does not introduce any new requirements, just makes the code more consistent. Discussion: https://www.postgresql.org/message-id/flat/dac5d2d0-98f5-94d9-8e69-46da2413593d%40enterprisedb.com
Diffstat (limited to 'src/bin/psql/describe.c')
-rw-r--r--src/bin/psql/describe.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index d1ae6991714..2df95bc1654 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1786,8 +1786,7 @@ describeOneTableDetails(const char *schemaname,
printQuery(res, &myopt, pset.queryFout, false, pset.logfile);
- if (footers[0])
- free(footers[0]);
+ free(footers[0]);
retval = true;
goto error_return; /* not an error, just return early */
@@ -3491,8 +3490,7 @@ error_return:
termPQExpBuffer(&title);
termPQExpBuffer(&tmpbuf);
- if (view_def)
- free(view_def);
+ free(view_def);
if (res)
PQclear(res);