Nikolay Sivov : dmloader: Use safe list iterator when clearing the cache ( Coverity).

Alexandre Julliard julliard at winehq.org
Tue Aug 8 07:36:37 CDT 2017


Module: wine
Branch: master
Commit: 96fd03b269cbd991e6609f0fa2ce4c12984cfd43
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=96fd03b269cbd991e6609f0fa2ce4c12984cfd43

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Aug  7 10:34:50 2017 +0300

dmloader: Use safe list iterator when clearing the cache (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmloader/loader.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index e44d2b9..10a2151 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -776,11 +776,11 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 *
 static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *iface, REFGUID class)
 {
     IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface);
-    struct cache_entry *obj;
+    struct cache_entry *obj, *obj2;
 
     TRACE("(%p, %s)\n", This, debugstr_dmguid(class));
 
-    LIST_FOR_EACH_ENTRY(obj, &This->cache, struct cache_entry, entry) {
+    LIST_FOR_EACH_ENTRY_SAFE(obj, obj2, &This->cache, struct cache_entry, entry) {
         if ((IsEqualGUID(class, &GUID_DirectMusicAllTypes) || IsEqualGUID(class, &obj->Desc.guidClass)) &&
             (obj->Desc.dwValidData & DMUS_OBJ_LOADED)) {
             /* basically, wrap to ReleaseObject for each object found */




More information about the wine-cvs mailing list