X Tutup
Skip to content

Commit fd8bdbc

Browse files
poetteringkeszybz
authored andcommitted
sysctl: use STATIC_DESTRUCTOR_REGISTER() to free arg_prefixes
1 parent 07a91a4 commit fd8bdbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sysctl/sysctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ static char **arg_prefixes = NULL;
2727
static bool arg_cat_config = false;
2828
static PagerFlags arg_pager_flags = 0;
2929

30+
STATIC_DESTRUCTOR_REGISTER(arg_prefixes, strv_freep);
31+
3032
static int apply_all(OrderedHashmap *sysctl_options) {
3133
char *property, *value;
3234
Iterator i;
@@ -321,8 +323,6 @@ static int run(int argc, char *argv[]) {
321323
finish:
322324
pager_close();
323325

324-
strv_free(arg_prefixes);
325-
326326
return r;
327327
}
328328

0 commit comments

Comments
 (0)
X Tutup