diff options
author | Florian Müllner <fmuellner@gnome.org> | 2019-02-18 23:46:39 +0100 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2019-02-19 02:00:05 +0100 |
commit | 32b70110691432898dec7cf2abd4fc60217ec5b8 (patch) | |
tree | 250169611844e8f57f959feb8449c14043c9a086 | |
parent | 6b161973afe5622d96d776d9bc44042f329e7047 (diff) | |
download | libcroco-32b70110691432898dec7cf2abd4fc60217ec5b8.tar.gz |
parser: Don't leak pseudo in error case
Spotted by covscan.
https://gitlab.gnome.org/GNOME/libcroco/merge_requests/1
-rw-r--r-- | src/cr-parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cr-parser.c b/src/cr-parser.c index 18c9a01..65052b2 100644 --- a/src/cr-parser.c +++ b/src/cr-parser.c @@ -1665,6 +1665,7 @@ cr_parser_parse_simple_selector (CRParser * a_this, CRSimpleSel ** a_sel) CRInputPos init_pos; CRToken *token = NULL; CRSimpleSel *sel = NULL; + CRPseudo *pseudo = NULL; CRAdditionalSel *add_sel_list = NULL; gboolean found_sel = FALSE; guint32 cur_char = 0; @@ -1798,7 +1799,6 @@ cr_parser_parse_simple_selector (CRParser * a_this, CRSimpleSel ** a_sel) &attr_sel->location) ; } else if (token && (token->type == DELIM_TK) && (token->u.unichar == ':')) { - CRPseudo *pseudo = NULL; /*try to parse a pseudo */ @@ -1890,6 +1890,8 @@ cr_parser_parse_simple_selector (CRParser * a_this, CRSimpleSel ** a_sel) error: + g_clear_pointer (&pseudo, cr_pseudo_destroy); + if (token) { cr_token_destroy (token); token = NULL; |