Skip to content

Commit

Permalink
Fixed a possible memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobambini committed May 31, 2024
1 parent fe1e2f5 commit a31e74d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/compiler/gravity_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,10 @@ static gnode_t *parse_file_expression (gravity_parser_t *parser) {
while (gravity_lexer_peek(lexer) == TOK_OP_DOT) {
gravity_lexer_next(lexer); // consume TOK_OP_DOT
const char *identifier = parse_identifier(parser);
if (!identifier) return NULL;
if (!identifier) {
mem_free(list);
return NULL;
}
cstring_array_push(list, identifier);
}

Expand Down

0 comments on commit a31e74d

Please sign in to comment.