Fix mutex memory leak in ph7_vm_release()

This commit is contained in:
Rafal Kupiec 2018-07-12 13:43:21 +02:00
parent 25a0e7d64e
commit 404a2cb402
1 changed files with 2 additions and 0 deletions

2
api.c
View File

@ -971,6 +971,8 @@ int ph7_vm_release(ph7_vm *pVm)
#if defined(PH7_ENABLE_THREADS) #if defined(PH7_ENABLE_THREADS)
/* Leave VM mutex */ /* Leave VM mutex */
SyMutexLeave(sMPGlobal.pMutexMethods,pVm->pMutex); /* NO-OP if sMPGlobal.nThreadingLevel != PH7_THREAD_LEVEL_MULTI */ SyMutexLeave(sMPGlobal.pMutexMethods,pVm->pMutex); /* NO-OP if sMPGlobal.nThreadingLevel != PH7_THREAD_LEVEL_MULTI */
/* free VM mutex */
SyMutexRelease(sMPGlobal.pMutexMethods,pVm->pMutex);
#endif #endif
if( rc == PH7_OK ){ if( rc == PH7_OK ){
/* Unlink from the list of active VM */ /* Unlink from the list of active VM */