diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-08-31 11:43:50 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-08-31 11:43:50 -0700 |
commit | dc6b630ed191cc32399304717f77958c8e18c6ad (patch) | |
tree | 8308115069b9e7c838b01adb65ec59cff5c100a9 /src/modules/rkt | |
parent | c5e0f1db92673e7520e42563dff894b211187b28 (diff) |
modules/*: use til_setup_free_with_ret_err() where apropos
Just some more res_setup baking failure path cleanups, largely
mechanical change.
Diffstat (limited to 'src/modules/rkt')
-rw-r--r-- | src/modules/rkt/rkt.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c index 0e162e6..677e2b9 100644 --- a/src/modules/rkt/rkt.c +++ b/src/modules/rkt/rkt.c @@ -633,11 +633,8 @@ static int rkt_setup(const til_settings_t *settings, til_setting_t **res_setting setup->scener_listen = 1; setup->scener_address = strdup(listen_address->value); - if (!setup->scener_address) { - til_setup_free(&setup->til_setup); - - return -ENOMEM; - } + if (!setup->scener_address) + return til_setup_free_with_ret_err(&setup->til_setup, -ENOMEM); if (sscanf(listen_port->value, "%hu", &setup->scener_port) != 1) return til_setup_free_with_failed_setting_ret_err(&setup->til_setup, listen_port, res_setting, -EINVAL); @@ -669,31 +666,22 @@ static int rkt_setup(const til_settings_t *settings, til_setting_t **res_setting res_setting, res_desc, &setup->scenes[i].setup); /* XXX: note no res_setup, must defer finalize */ - if (r < 0) { - til_setup_free(&setup->til_setup); - - return r; - } + if (r < 0) + return til_setup_free_with_ret_err(&setup->til_setup, r); assert(r == 0); /* the settings should be complete by now, so this is unexpected */ } setup->base = strdup(base->value); - if (!setup->base) { - til_setup_free(&setup->til_setup); - - return -ENOMEM; - } + if (!setup->base) + return til_setup_free_with_ret_err(&setup->til_setup, -ENOMEM); if (!strcasecmp(connect->value, "on")) { setup->connect = 1; setup->host = strdup(host->value); - if (!setup->host) { - til_setup_free(&setup->til_setup); - - return -ENOMEM; - } + if (!setup->host) + return til_setup_free_with_ret_err(&setup->til_setup, -ENOMEM); if (sscanf(port->value, "%hu", &setup->port) != 1) return til_setup_free_with_failed_setting_ret_err(&setup->til_setup, port, res_setting, -EINVAL); |