From efd5267d6e8c5156ce4ea3727fd6610615f4898a Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 12 Dec 2007 09:19:07 +0000 Subject: [PATCH] Plug minor memory leak when an error occurs while parsing enum entries. [r18704] --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index 0e13218..2a075f5 100644 --- a/parser.c +++ b/parser.c @@ -1378,13 +1378,13 @@ static void parse_enum_entries(type_t *const enum_type) } do { - declaration_t *entry = allocate_ast_zero(sizeof(entry[0])); - if(token.type != T_IDENTIFIER) { parse_error_expected("while parsing enum entry", T_IDENTIFIER, 0); eat_block(); return; } + + declaration_t *const entry = allocate_ast_zero(sizeof(entry[0])); entry->storage_class = STORAGE_CLASS_ENUM_ENTRY; entry->type = enum_type; entry->symbol = token.v.symbol; -- 2.20.1