SCP: Fix potential error path expression evaluation memory leak (Coverity)

This commit is contained in:
Mark Pizzolato 2018-05-01 23:07:57 -07:00
parent 4e508cfc29
commit 130ad1c21f

2
scp.c
View file

@ -13712,6 +13712,7 @@ while (!isempty_Stack(stack2)) {
if (!pop_Stack (stack1, item1, &op1)) {
*stat = SCPE_INVEXPR;
delete_Stack (stack2);
return 0;
}
if (temp_op->unary)
@ -13721,6 +13722,7 @@ while (!isempty_Stack(stack2)) {
(temp_op->string[0] != '-') &&
(temp_op->string[0] != '+')) {
*stat = SCPE_INVEXPR;
delete_Stack (stack2);
return 0;
}
}