From 598b7828925bcf95d93cb36d49ac95a8488be7c2 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 8 Jun 2006 19:21:53 +0000 Subject: [PATCH] Avoid memory leak in error path. Reported by Rainer Weikusat ticket: 3791 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18088 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/set_allowable_enctypes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/gssapi/krb5/set_allowable_enctypes.c b/src/lib/gssapi/krb5/set_allowable_enctypes.c index 88cae714a..2bc2090fa 100644 --- a/src/lib/gssapi/krb5/set_allowable_enctypes.c +++ b/src/lib/gssapi/krb5/set_allowable_enctypes.c @@ -115,8 +115,10 @@ gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status, goto error_out; } kerr = k5_mutex_lock(&cred->lock); - if (kerr) + if (kerr) { + free(new_ktypes); goto error_out; + } if (cred->req_enctypes) free(cred->req_enctypes); cred->req_enctypes = new_ktypes; -- 2.26.2