summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2019-02-19 00:12:08 +0100
committerFlorian Müllner <fmuellner@gnome.org>2019-02-19 09:05:38 +0100
commit4dd76b69bb97e5e4dfbd5ea200ac07c66d9d6dec (patch)
tree0ed24621628852f7703a095b3163105e70e8dab0
parent71e62c2cfbca29ba400c53dbb5da00f35c230731 (diff)
downloadlibcroco-4dd76b69bb97e5e4dfbd5ea200ac07c66d9d6dec.tar.gz
om-parser: Fix double-free in error case
Freeing decl is already handled under the error label, so don't free it before the jump. Spotted by covscan. https://gitlab.gnome.org/GNOME/libcroco/merge_requests/1
-rw-r--r--src/cr-om-parser.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/cr-om-parser.c b/src/cr-om-parser.c
index ccc45b3..348cd1f 100644
--- a/src/cr-om-parser.c
+++ b/src/cr-om-parser.c
@@ -681,7 +681,6 @@ property (CRDocHandler * a_this,
decl2 = cr_declaration_append
(ctxt->cur_stmt->kind.ruleset->decl_list, decl);
if (!decl2) {
- cr_declaration_destroy (decl);
cr_utils_trace_info
("Could not append decl to ruleset");
goto error;
@@ -696,7 +695,6 @@ property (CRDocHandler * a_this,
(ctxt->cur_stmt->kind.font_face_rule->decl_list,
decl);
if (!decl2) {
- cr_declaration_destroy (decl);
cr_utils_trace_info
("Could not append decl to ruleset");
goto error;
@@ -709,7 +707,6 @@ property (CRDocHandler * a_this,
decl2 = cr_declaration_append
(ctxt->cur_stmt->kind.page_rule->decl_list, decl);
if (!decl2) {
- cr_declaration_destroy (decl);
cr_utils_trace_info
("Could not append decl to ruleset");
goto error;