ADVAPI32: make sure not to interfere with the lasterror value returned by the CSP in CryptAcquireContextA

Mike McCormack mike at codeweavers.com
Tue Sep 14 02:34:50 CDT 2004


ChangeLog:
* make sure not to interfere with the lasterror value returned by the 
CSP in CryptAcquireContextA
-------------- next part --------------
Index: dlls/advapi32/crypt.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/crypt.c,v
retrieving revision 1.51
diff -u -r1.51 crypt.c
--- dlls/advapi32/crypt.c	30 Aug 2004 23:57:18 -0000	1.51
+++ dlls/advapi32/crypt.c	14 Sep 2004 06:00:18 -0000
@@ -478,14 +478,20 @@
 error:
 	if (pProv)
 	{
-		FreeLibrary(pProv->hModule);
-		CRYPT_Free(pProv->pVTable);
-		CRYPT_Free(pProv->pFuncs);
+		if (pProv->hModule)
+			FreeLibrary(pProv->hModule);
+		if (pProv->pVTable)
+			CRYPT_Free(pProv->pVTable);
+		if (pProv->pFuncs)
+			CRYPT_Free(pProv->pFuncs);
 		CRYPT_Free(pProv);
 	}
-	CRYPT_Free(provname);
-	CRYPT_Free(temp);
-	CRYPT_Free(imagepath);
+	if (provname)
+		CRYPT_Free(provname);
+	if (temp)
+		CRYPT_Free(temp);
+	if (imagepath)
+		CRYPT_Free(imagepath);
 	return FALSE;
 }
 


More information about the wine-patches mailing list