From 124e32ad7852b407bc583268d6149a3246b8f99b Mon Sep 17 00:00:00 2001 From: Miroslav Zagorac Date: Wed, 18 Jan 2023 19:33:21 +0100 Subject: [PATCH] BUG/MINOR: ot: fixed wrong NULL check in flt_ot_parse_cfg_group() After calling flt_ot_conf_group_init() and storing the result in flt_ot_current_group, the code incorrectly checked flt_ot_current_config for NULL instead of the newly assigned flt_ot_current_group. This meant a failed group init was never detected and the error path was never taken. --- addons/ot/src/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/ot/src/parser.c b/addons/ot/src/parser.c index e067501cd..c59a18418 100644 --- a/addons/ot/src/parser.c +++ b/addons/ot/src/parser.c @@ -640,7 +640,7 @@ static int flt_ot_parse_cfg_group(const char *file, int linenum, char **args, in if (pdata->keyword == FLT_OT_PARSE_GROUP_ID) { flt_ot_current_group = flt_ot_conf_group_init(args[1], linenum, &(flt_ot_current_config->groups), &err); - if (flt_ot_current_config == NULL) + if (flt_ot_current_group == NULL) retval |= ERR_ABORT | ERR_ALERT; } else if (pdata->keyword == FLT_OT_PARSE_GROUP_SCOPES) {