Browse Source

Properly destroy temporary memory object. Fix memory leak.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
010bdd7331
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      engine/vm.c

+ 2
- 2
engine/vm.c View File

@ -4787,7 +4787,7 @@ static sxi32 VmByteCodeExec(
"Argument %u of '%z()' does not match the data type", n + 1, &pVmFunc->sName);
}
pArg->nType = pTmp->nType;
PH7_MemObjRelease(pTmp);
PH7_VmDestroyMemObj(&(*pVm), pTmp);
}
}
if(aFormalArg[n].iFlags & VM_FUNC_ARG_BY_REF) {
@ -4903,7 +4903,7 @@ static sxi32 VmByteCodeExec(
"Default value for argument %u of '%z()' does not match the data type", n + 1, &pVmFunc->sName);
}
pObj->nType = pTmp->nType;
PH7_MemObjRelease(pTmp);
PH7_VmDestroyMemObj(&(*pVm), pTmp);
/* Insert argument index */
sArg.nIdx = pObj->nIdx;
sArg.pUserData = 0;


Loading…
Cancel
Save