From e391cbd1215569ee7654b1d93153fcd14c2a60a7 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 3 Jul 2023 07:37:19 -0700 Subject: til: optionally finalize in til_module_setup() This was assuming non-NULL res_setup which would assert in til_module_setup_finalize() which doesn't expect a NULL res_setup since that's its entire purpose. It's not a bug that was actually triggered by any callers (yet) --- src/til.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/til.c b/src/til.c index fdcce68..c5c5eae 100644 --- a/src/til.c +++ b/src/til.c @@ -512,7 +512,10 @@ int til_module_setup(const til_settings_t *settings, til_setting_t **res_setting if (module->setup) return module->setup(settings, res_setting, res_desc, res_setup); - return til_module_setup_finalize(module, settings, res_setup); + if (res_setup) + return til_module_setup_finalize(module, settings, res_setup); + + return 0; } -- cgit v1.2.3