diff options
author | Victor "Nate" Graf <nategraf1@gmail.com> | 2017-09-13 14:51:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-13 14:51:46 -0700 |
commit | 0d309876c9c5dd5a8e2d34341ba49fe89bf15404 (patch) | |
tree | 0da6b857aa5f86e3c5d10c967cc3f0be6a0e7a79 /src/vm | |
parent | 9fc84cfb5feafe7846307d76df2b9f85455b481a (diff) | |
download | coreclr-0d309876c9c5dd5a8e2d34341ba49fe89bf15404.tar.gz coreclr-0d309876c9c5dd5a8e2d34341ba49fe89bf15404.tar.bz2 coreclr-0d309876c9c5dd5a8e2d34341ba49fe89bf15404.zip |
Eliminate double delete in EventPipeProvider cleanup (#13833)
* Eliminate double delete in EventProvider cleanup
* Fix access after deletion error
* Simplify control flow
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/eventpipeconfiguration.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/vm/eventpipeconfiguration.cpp b/src/vm/eventpipeconfiguration.cpp index 80c4878782..8a1f3bce2a 100644 --- a/src/vm/eventpipeconfiguration.cpp +++ b/src/vm/eventpipeconfiguration.cpp @@ -413,17 +413,12 @@ void EventPipeConfiguration::DeleteDeferredProviders() while(pElem != NULL) { EventPipeProvider *pProvider = pElem->GetValue(); + pElem = m_pProviderList->GetNext(pElem); if(pProvider->GetDeleteDeferred()) { - // The act of deleting the provider unregisters it and removes it from the list. + // The act of deleting the provider unregisters it, + // removes it from the list, and deletes the list element delete(pProvider); - SListElem<EventPipeProvider*> *pCurElem = pElem; - pElem = m_pProviderList->GetNext(pElem); - delete(pCurElem); - } - else - { - pElem = m_pProviderList->GetNext(pElem); } } } |