diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-12 16:50:58 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-14 17:01:55 +0100 |
commit | e6755a33509f425463ddbbf99839ba3ae6979216 (patch) | |
tree | 0aedbd7362da192e07dd7819ee86a99700bd39e4 /src/basic/locale-util.c | |
parent | 13df9c398d60e441a65b11ada491f750947649bf (diff) | |
download | systemd-e6755a33509f425463ddbbf99839ba3ae6979216.tar.gz |
locale-util: introduce common helper locale_variables_free() for freeing locale variable arrays
Diffstat (limited to 'src/basic/locale-util.c')
-rw-r--r-- | src/basic/locale-util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index 8b89bd0024..9ad51a1972 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -389,6 +389,16 @@ const char *special_glyph(SpecialGlyph code) { return draw_table[is_locale_utf8()][code]; } +void locale_variables_free(char*l[_VARIABLE_LC_MAX]) { + LocaleVariable i; + + if (!l) + return; + + for (i = 0; i < _VARIABLE_LC_MAX; i++) + l[i] = mfree(l[i]); +} + static const char * const locale_variable_table[_VARIABLE_LC_MAX] = { [VARIABLE_LANG] = "LANG", [VARIABLE_LANGUAGE] = "LANGUAGE", |