summaryrefslogtreecommitdiff
path: root/contrib/vacuumlo/vacuumlo.c
diff options
context:
space:
mode:
authorPeter Eisentraut2022-08-26 17:16:28 +0000
committerPeter Eisentraut2022-08-26 17:16:28 +0000
commite890ce7a4feb9d72cd502d52c5a4c4d853801974 (patch)
tree7535666c7981bff5d29839ef1733d8896dcebdca /contrib/vacuumlo/vacuumlo.c
parent45987aae260a441886a010323bf3e143ce8e82d6 (diff)
Remove unneeded null pointer checks before PQfreemem()
PQfreemem() just calls free(), and the latter already checks for null pointers. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/cf26e970-8e92-59f1-247a-aa265235075b%40enterprisedb.com
Diffstat (limited to 'contrib/vacuumlo/vacuumlo.c')
-rw-r--r--contrib/vacuumlo/vacuumlo.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c
index b7c8f2c805e..264b879bd39 100644
--- a/contrib/vacuumlo/vacuumlo.c
+++ b/contrib/vacuumlo/vacuumlo.c
@@ -231,12 +231,9 @@ vacuumlo(const char *database, const struct _param *param)
pg_log_error("%s", PQerrorMessage(conn));
PQclear(res);
PQfinish(conn);
- if (schema != NULL)
- PQfreemem(schema);
- if (table != NULL)
- PQfreemem(table);
- if (field != NULL)
- PQfreemem(field);
+ PQfreemem(schema);
+ PQfreemem(table);
+ PQfreemem(field);
return -1;
}