From: Greg Hudson Date: Tue, 19 Apr 2011 16:37:19 +0000 (+0000) Subject: Fix memory leak in kpasswd server UDP error path X-Git-Tag: krb5-1.10-alpha1~463 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4ffd70b133afea3d19fccbac269798c1d210c0fd;p=krb5.git Fix memory leak in kpasswd server UDP error path The dispatch() in kadmind's schpw.c could return a failure code with an allocated response container. net-server.c does not expect this and leaks the container in the UDP case. Free the container in dispatch() if we are returning an error. ticket: 6903 target_version: 1.9.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24886 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/server/schpw.c b/src/kadmin/server/schpw.c index ca0710754..f8c235c45 100644 --- a/src/kadmin/server/schpw.c +++ b/src/kadmin/server/schpw.c @@ -535,6 +535,10 @@ dispatch(void *handle, remote_faddr, request, *response); + if (ret) { + krb5_free_data(server_handle->context, *response); + *response = NULL; + } cleanup: if (local_kaddrs != NULL)