Fixed uninitialized values and leaks.
authorArmin Novak <armin.novak@thincast.com>
Tue, 18 Jul 2017 09:38:59 +0000 (11:38 +0200)
committerArmin Novak <armin.novak@thincast.com>
Mon, 13 Nov 2017 15:20:57 +0000 (16:20 +0100)
winpr/libwinpr/sspi/Kerberos/kerberos.c

index a02dd19..5de991f 100644 (file)
@@ -425,7 +425,10 @@ SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(PCredHandle phCred
                context->credentials = credentials;
 
                if (kerberos_SetContextServicePrincipalNameA(context, pszTargetName) < 0)
+               {
+                       kerberos_ContextFree(context);
                        return SEC_E_INTERNAL_ERROR;
+               }
 
                sspi_SecureHandleSetLowerPointer(phNewContext, context);
                sspi_SecureHandleSetUpperPointer(phNewContext, (void*) KRB_PACKAGE_NAME);