From: Greg Hudson Date: Tue, 2 Sep 2014 18:02:26 +0000 (-0400) Subject: Fix unlikely memory leak in KCM client X-Git-Tag: krb5-1.14-alpha1~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=935de68b110ca0369e4cf16bbdc7da74b5799e69;p=thirdparty%2Fkrb5.git Fix unlikely memory leak in KCM client Commit 956cbd24e645609c94fbc836840ce0f87ba3ce79 created a memory leak if the KCM_OP_GET_DEFAULT_CACHE call fails inside kcm_ptcursor_new after the KCM_OP_GET_CACHE_UUID_LIST call succeeds. Fix it. ticket: 8002 --- diff --git a/src/lib/krb5/ccache/cc_kcm.c b/src/lib/krb5/ccache/cc_kcm.c index 926a99c599..1e404ee279 100644 --- a/src/lib/krb5/ccache/cc_kcm.c +++ b/src/lib/krb5/ccache/cc_kcm.c @@ -869,7 +869,7 @@ kcm_ptcursor_new(krb5_context context, krb5_cc_ptcursor *cursor_out) krb5_error_code ret; struct kcmreq req = EMPTY_KCMREQ; struct kcmio *io = NULL; - struct uuid_list *uuids; + struct uuid_list *uuids = NULL; const char *defname, *primary; *cursor_out = NULL; @@ -911,9 +911,11 @@ kcm_ptcursor_new(krb5_context context, krb5_cc_ptcursor *cursor_out) goto cleanup; ret = make_ptcursor(primary, uuids, io, cursor_out); + uuids = NULL; io = NULL; cleanup: + free_uuid_list(uuids); kcmio_close(io); kcmreq_free(&req); return ret;