From e253f49b415215906d40a4a7124e08788cc46c44 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 24 Feb 2020 09:54:02 +0000 Subject: Parse: Add missing error checks for flex-flow shorthand. Fixes scan-build: Value stored to 'error' is never read. Signed-off-by: Michael Drake --- src/parse/properties/flex_flow.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/parse/properties/flex_flow.c b/src/parse/properties/flex_flow.c index 6a83e15..e2d0e0c 100644 --- a/src/parse/properties/flex_flow.c +++ b/src/parse/properties/flex_flow.c @@ -107,15 +107,21 @@ css_error css__parse_flex_flow(css_language *c, /* defaults */ if (direction) { - error = css__stylesheet_style_appendOPV(direction_style, + error = css__stylesheet_style_appendOPV(direction_style, CSS_PROP_FLEX_DIRECTION, 0, FLEX_DIRECTION_ROW); + if (error != CSS_OK) { + goto css__parse_flex_flow_cleanup; + } } if (wrap) { - error = css__stylesheet_style_appendOPV(wrap_style, + error = css__stylesheet_style_appendOPV(wrap_style, CSS_PROP_FLEX_WRAP, 0, FLEX_WRAP_NOWRAP); + if (error != CSS_OK) { + goto css__parse_flex_flow_cleanup; + } } error = css__stylesheet_merge_style(result, direction_style); -- cgit v1.2.3