From: Lennart Poettering Date: Fri, 15 Mar 2019 09:42:32 +0000 (+0100) Subject: systemctl: port to static destructors X-Git-Tag: v242-rc1~95^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61ff45db9573c7e78e1fc9c3cff77166e0036d24;p=thirdparty%2Fsystemd.git systemctl: port to static destructors --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index caacfe06362..637985bcda2 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -179,6 +179,12 @@ static bool arg_now = false; static bool arg_jobs_before = false; static bool arg_jobs_after = false; +STATIC_DESTRUCTOR_REGISTER(arg_wall, strv_freep); +STATIC_DESTRUCTOR_REGISTER(arg_root, freep); +STATIC_DESTRUCTOR_REGISTER(arg_types, strv_freep); +STATIC_DESTRUCTOR_REGISTER(arg_states, strv_freep); +STATIC_DESTRUCTOR_REGISTER(arg_properties, strv_freep); + static int daemon_reload(int argc, char *argv[], void* userdata); static int trivial_method(int argc, char *argv[], void *userdata); static int halt_now(enum action a); @@ -9245,13 +9251,6 @@ static int run(int argc, char *argv[]) { finish: release_busses(); - strv_free(arg_types); - strv_free(arg_states); - strv_free(arg_properties); - - strv_free(arg_wall); - free(arg_root); - /* Note that we return r here, not 0, so that we can implement the LSB-like return codes */ return r; }