diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-06-16 21:50:56 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-07-03 11:47:15 +0200 |
commit | 02c408e21a6e78ff246ea7a1beb4669634fa9c4c (patch) | |
tree | 7e4cf03f3de7e32af266b739e12c6600d871ed45 /src/backend/utils/adt/pg_locale.c | |
parent | 098c703d308fa88dc9e3f9f623ca023ce4717794 (diff) | |
download | postgresql-02c408e21a6e78ff246ea7a1beb4669634fa9c4c.tar.gz postgresql-02c408e21a6e78ff246ea7a1beb4669634fa9c4c.zip |
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/backend/utils/adt/pg_locale.c')
-rw-r--r-- | src/backend/utils/adt/pg_locale.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index a0490a75224..ea42e70e43b 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -374,26 +374,16 @@ assign_locale_messages(const char *newval, void *extra) static void free_struct_lconv(struct lconv *s) { - if (s->decimal_point) - free(s->decimal_point); - if (s->thousands_sep) - free(s->thousands_sep); - if (s->grouping) - free(s->grouping); - if (s->int_curr_symbol) - free(s->int_curr_symbol); - if (s->currency_symbol) - free(s->currency_symbol); - if (s->mon_decimal_point) - free(s->mon_decimal_point); - if (s->mon_thousands_sep) - free(s->mon_thousands_sep); - if (s->mon_grouping) - free(s->mon_grouping); - if (s->positive_sign) - free(s->positive_sign); - if (s->negative_sign) - free(s->negative_sign); + free(s->decimal_point); + free(s->thousands_sep); + free(s->grouping); + free(s->int_curr_symbol); + free(s->currency_symbol); + free(s->mon_decimal_point); + free(s->mon_thousands_sep); + free(s->mon_grouping); + free(s->positive_sign); + free(s->negative_sign); } /* |