mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
DIRECTOR: LINGO: Fix memory leak
Memory leak happens when a cast is moved but without specifying the place for it to move to. Datum constructor gets the castMemberId by copy leaving the resource to be dealt with by the original function. - Includes lingo test. Fixes COVERITY: 1498924
This commit is contained in:
parent
8dfe2ccc96
commit
9e4e20962b
@ -2148,6 +2148,7 @@ void LB::b_move(int nargs) {
|
||||
int id = (int) g_director->getCurrentMovie()->getCast()->_castArrayStart;
|
||||
CastMemberID *castId = new CastMemberID(id, 0);
|
||||
Datum d = Datum(*castId);
|
||||
delete castId;
|
||||
g_lingo->push(d);
|
||||
b_findEmpty(1);
|
||||
dest = g_lingo->pop();
|
||||
|
@ -11,6 +11,8 @@ open "Hello" && "more" with "Finder"
|
||||
move cast 1, cast 1
|
||||
move cast 1, 3
|
||||
move cast 3, 1
|
||||
move cast 1
|
||||
|
||||
put findEmpty(cast 10)
|
||||
pasteClipBoardInto cast 2
|
||||
put the width of cast 1
|
||||
|
Loading…
Reference in New Issue
Block a user