xdg: Fix a file handle leak (coverity)

Frédéric Delanoy frederic.delanoy at gmail.com
Wed Dec 26 05:09:58 CST 2012


CID 210854
---
 dlls/shell32/xdg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/shell32/xdg.c b/dlls/shell32/xdg.c
index ce8c203..d05539c 100644
--- a/dlls/shell32/xdg.c
+++ b/dlls/shell32/xdg.c
@@ -942,7 +942,10 @@ HRESULT XDG_UserDirLookup(const char * const *xdg_dirs, const unsigned int num_d
         if (FAILED(hr))
         {
             if (hr == E_OUTOFMEMORY)
+            {
+                fclose(file);
                 goto xdg_user_dir_lookup_error;
+            }
             continue;
         }
     }
-- 
1.8.0




More information about the wine-patches mailing list