mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Avoid memory leak.
This commit is contained in:
@@ -1130,7 +1130,7 @@ static int add(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
|
||||
/* If either is a string, coerce them both to strings and concatenate */
|
||||
if (v1.type == STR_TYPE || v2.type == STR_TYPE) {
|
||||
/* Skanky... copy the values shallowly fode debug */
|
||||
/* Skanky... copy the values shallowly for debug */
|
||||
Value o1 = v1;
|
||||
Value o2 = v2;
|
||||
if ( (r = DoCoerce(STR_TYPE, &v1)) ) {
|
||||
@@ -1164,6 +1164,8 @@ static int add(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
strcpy(ans->v.str, v1.v.str);
|
||||
strcpy(ans->v.str+l1, v2.v.str);
|
||||
DBG(debug_evaluation_binop(ans, OK, &o1, &o2, "+"));
|
||||
DestroyValue(v1);
|
||||
DestroyValue(v2);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user