Skip to content

Commit 8d749f9

Browse files
WillLillisahelwer
authored andcommitted
fix(scanner): correct UB in nested_scan
1 parent 2d83194 commit 8d749f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scanner.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,8 @@
19821982
// Exiting PlusCal block; rehydrate context then pop
19831983
CharArray* next = array_back(&this->enclosing_contexts);
19841984
scanner_deserialize(&this->current_context, next->contents, next->size);
1985-
array_delete(&array_pop(&this->enclosing_contexts));
1985+
CharArray ctx = array_pop(&this->enclosing_contexts);
1986+
array_delete(&ctx);
19861987
lexer->result_symbol = PCAL_END;
19871988
return true;
19881989
} else {

0 commit comments

Comments
 (0)