From 275ae825d98c90803f7d3db26abcb25c9372b023 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 24 Feb 2020 10:09:29 +0000 Subject: Parse: Add missing error checks for outline shorthand. Fixes scan-build: Value stored to 'error' is never read. Signed-off-by: Michael Drake --- src/parse/properties/outline.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/parse') diff --git a/src/parse/properties/outline.c b/src/parse/properties/outline.c index d9d9ec2..4d4fbf0 100644 --- a/src/parse/properties/outline.c +++ b/src/parse/properties/outline.c @@ -122,20 +122,29 @@ css_error css__parse_outline(css_language *c, /* defaults */ if (color) { error = css__stylesheet_style_appendOPV(color_style, - CSS_PROP_OUTLINE_COLOR, + CSS_PROP_OUTLINE_COLOR, 0, OUTLINE_COLOR_INVERT); + if (error != CSS_OK) { + goto css__parse_outline_cleanup; + } } if (style) { error = css__stylesheet_style_appendOPV(style_style, - CSS_PROP_OUTLINE_STYLE, + CSS_PROP_OUTLINE_STYLE, 0, OUTLINE_STYLE_NONE); + if (error != CSS_OK) { + goto css__parse_outline_cleanup; + } } if (width) { error = css__stylesheet_style_appendOPV(width_style, - CSS_PROP_OUTLINE_WIDTH, + CSS_PROP_OUTLINE_WIDTH, 0, OUTLINE_WIDTH_MEDIUM); + if (error != CSS_OK) { + goto css__parse_outline_cleanup; + } } -- cgit v1.2.3