[PATCH] cryptnet: avoid memory leak of info (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Oct 13 10:23:27 CDT 2012


Hi,

leak depends on the GetUrlCacheEntryInfoW() implementation,
just take care we do not leak.

Ciao, Marcus
---
 dlls/cryptnet/cryptnet_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c
index 652c812..c7511d7 100644
--- a/dlls/cryptnet/cryptnet_main.c
+++ b/dlls/cryptnet/cryptnet_main.c
@@ -757,7 +757,6 @@ static void CRYPT_CacheURL(LPCWSTR pszURL, const CRYPT_BLOB_ARRAY *pObject,
             if (CompareFileTime(&info->ExpireTime, &ft) < 0)
             {
                 DeleteUrlCacheEntryW(pszURL);
-                CryptMemFree(info);
             }
             else
             {
@@ -767,6 +766,7 @@ static void CRYPT_CacheURL(LPCWSTR pszURL, const CRYPT_BLOB_ARRAY *pObject,
                 return;
             }
         }
+        CryptMemFree(info);
     }
 
     if (!CreateUrlCacheEntryW(pszURL, pObject->rgBlob[0].cbData, NULL, cacheFileName, 0))
-- 
1.7.3.4




More information about the wine-patches mailing list