Skip to content
Permalink
Browse files

sspi: fix memory leaks

Closes #4299
  • Loading branch information...
migueljcrum authored and bagder committed Sep 6, 2019
1 parent cb3dc99 commit 67b30b341811cd0bc60bdaab5a7c5532fa23f623
Showing with 21 additions and 0 deletions.
  1. +5 −0 lib/vauth/digest_sspi.c
  2. +5 −0 lib/vauth/krb5_sspi.c
  3. +5 −0 lib/vauth/ntlm_sspi.c
  4. +6 −0 lib/vauth/spnego_sspi.c
@@ -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);
}

@@ -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);
}

@@ -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);
}

@@ -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);
}

0 comments on commit 67b30b3

Please sign in to comment.
You can’t perform that action at this time.