sysctl: use STATIC_DESTRUCTOR_REGISTER() to free arg_prefixes

This commit is contained in:
Lennart Poettering 2018-11-20 11:29:54 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 07a91a45c7
commit fd8bdbc79b

View file

@ -27,6 +27,8 @@ static char **arg_prefixes = NULL;
static bool arg_cat_config = false;
static PagerFlags arg_pager_flags = 0;
STATIC_DESTRUCTOR_REGISTER(arg_prefixes, strv_freep);
static int apply_all(OrderedHashmap *sysctl_options) {
char *property, *value;
Iterator i;
@ -321,8 +323,6 @@ static int run(int argc, char *argv[]) {
finish:
pager_close();
strv_free(arg_prefixes);
return r;
}