crypt32: Avoid double free in CRYPT_LoadSIP on error path (coverity).

This commit is contained in:
Frédéric Delanoy 2012-10-29 21:17:31 +01:00 committed by Alexandre Julliard
parent 3dd7c64c25
commit e078c872a0
1 changed files with 3 additions and 0 deletions

View File

@ -634,14 +634,17 @@ static BOOL CRYPT_LoadSIP(const GUID *pgSubject)
if (!sip.pfPut || temp != lib) if (!sip.pfPut || temp != lib)
goto error; goto error;
FreeLibrary(temp); FreeLibrary(temp);
temp = NULL;
sip.pfCreate = CRYPT_LoadSIPFunc(pgSubject, szCreate, &temp); sip.pfCreate = CRYPT_LoadSIPFunc(pgSubject, szCreate, &temp);
if (!sip.pfCreate || temp != lib) if (!sip.pfCreate || temp != lib)
goto error; goto error;
FreeLibrary(temp); FreeLibrary(temp);
temp = NULL;
sip.pfVerify = CRYPT_LoadSIPFunc(pgSubject, szVerify, &temp); sip.pfVerify = CRYPT_LoadSIPFunc(pgSubject, szVerify, &temp);
if (!sip.pfVerify || temp != lib) if (!sip.pfVerify || temp != lib)
goto error; goto error;
FreeLibrary(temp); FreeLibrary(temp);
temp = NULL;
sip.pfRemove = CRYPT_LoadSIPFunc(pgSubject, szRemoveSigned, &temp); sip.pfRemove = CRYPT_LoadSIPFunc(pgSubject, szRemoveSigned, &temp);
if (!sip.pfRemove || temp != lib) if (!sip.pfRemove || temp != lib)
goto error; goto error;