sspi: fix memory leaks

Closes #4299
This commit is contained in:
migueljcrum 2019-09-06 13:43:51 +00:00 committed by Daniel Stenberg
parent cb3dc99175
commit 67b30b3418
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
4 changed files with 21 additions and 0 deletions

View File

@ -61,6 +61,11 @@ bool Curl_auth_is_digest_supported(void)
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
if(status == SEC_E_OK) {
s_pSecFn->FreeContextBuffer(SecurityPackage);
}
return (status == SEC_E_OK ? TRUE : FALSE);
}

View File

@ -58,6 +58,11 @@ bool Curl_auth_is_gssapi_supported(void)
TEXT(SP_NAME_KERBEROS),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
if(status == SEC_E_OK) {
s_pSecFn->FreeContextBuffer(SecurityPackage);
}
return (status == SEC_E_OK ? TRUE : FALSE);
}

View File

@ -56,6 +56,11 @@ bool Curl_auth_is_ntlm_supported(void)
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
if(status == SEC_E_OK) {
s_pSecFn->FreeContextBuffer(SecurityPackage);
}
return (status == SEC_E_OK ? TRUE : FALSE);
}

View File

@ -59,6 +59,12 @@ bool Curl_auth_is_spnego_supported(void)
TEXT(SP_NAME_NEGOTIATE),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
if(status == SEC_E_OK) {
s_pSecFn->FreeContextBuffer(SecurityPackage);
}
return (status == SEC_E_OK ? TRUE : FALSE);
}