Properly destroy temporary memory object. Fix memory leak.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-14 17:16:41 +02:00
parent 0bef248298
commit 010bdd7331
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 2 additions and 2 deletions

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;