diff mbox

[1/3] cifs.upcall: fix memory and call krb5_auth_con_free()

Message ID 1293525693-11562-2-git-send-email-metze@samba.org (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Metzmacher Dec. 28, 2010, 8:41 a.m. UTC
None
diff mbox

Patch

diff --git a/cifs.upcall.c b/cifs.upcall.c
index 9b1436e..9116e56 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -313,13 +313,15 @@  cifs_krb5_get_req(const char *principal, const char *ccname,
 	if (ret) {
 		syslog(LOG_DEBUG, "%s: unable to get session key for %s",
 		       __func__, principal);
-		goto out_free_creds;
+		goto out_free_auth;
 	}
 
 	*mechtoken = data_blob(apreq_pkt.data, apreq_pkt.length);
 	*sess_key = data_blob(KRB5_KEY_DATA(tokb), KRB5_KEY_LENGTH(tokb));
 
 	krb5_free_keyblock(context, tokb);
+out_free_auth:
+	krb5_auth_con_free(context, auth_context);
 out_free_creds:
 	krb5_free_creds(context, out_creds);
 out_free_principal: