summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/mq.c2
-rw-r--r--src/parse/properties/flex_flow.c10
-rw-r--r--src/parse/properties/list_style.c15
-rw-r--r--src/parse/properties/outline.c15
4 files changed, 33 insertions, 9 deletions
diff --git a/src/parse/mq.c b/src/parse/mq.c
index c6ebe84..b0e47c3 100644
--- a/src/parse/mq.c
+++ b/src/parse/mq.c
@@ -800,13 +800,13 @@ static css_error mq_parse_condition(lwc_string **strings,
}
result->negate = 1;
- result->nparts = 1;
result->parts = malloc(sizeof(*result->parts));
if (result->parts == NULL) {
css__mq_cond_or_feature_destroy(cond_or_feature);
css__mq_cond_destroy(result);
return CSS_NOMEM;
}
+ result->nparts = 1;
result->parts[0] = cond_or_feature;
*cond = result;
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);
diff --git a/src/parse/properties/list_style.c b/src/parse/properties/list_style.c
index f12fa2e..b2c8de3 100644
--- a/src/parse/properties/list_style.c
+++ b/src/parse/properties/list_style.c
@@ -122,20 +122,29 @@ css_error css__parse_list_style(css_language *c,
/* defaults */
if (image) {
error = css__stylesheet_style_appendOPV(image_style,
- CSS_PROP_LIST_STYLE_IMAGE,
+ CSS_PROP_LIST_STYLE_IMAGE,
0, LIST_STYLE_IMAGE_NONE);
+ if (error != CSS_OK) {
+ goto css__parse_list_style_cleanup;
+ }
}
if (position) {
error = css__stylesheet_style_appendOPV(position_style,
- CSS_PROP_LIST_STYLE_POSITION,
+ CSS_PROP_LIST_STYLE_POSITION,
0, LIST_STYLE_POSITION_OUTSIDE);
+ if (error != CSS_OK) {
+ goto css__parse_list_style_cleanup;
+ }
}
if (type) {
error = css__stylesheet_style_appendOPV(type_style,
- CSS_PROP_LIST_STYLE_TYPE,
+ CSS_PROP_LIST_STYLE_TYPE,
0, LIST_STYLE_TYPE_DISC);
+ if (error != CSS_OK) {
+ goto css__parse_list_style_cleanup;
+ }
}
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;
+ }
}