From: Greg Hudson Date: Tue, 19 Jun 2018 17:15:15 +0000 (-0400) Subject: Fix minor leak in gssrpc UDP cache code X-Git-Tag: krb5-1.17-beta1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F799%2Fhead;p=thirdparty%2Fkrb5.git Fix minor leak in gssrpc UDP cache code In svc_udp.c:cache_set(), if victim is allocated successfully but allocation for newbuf fails, free victim before returning. Reported by Bean Zhang. ticket: 8703 --- diff --git a/src/lib/rpc/svc_udp.c b/src/lib/rpc/svc_udp.c index d3140df6bc..8ecbdf2b33 100644 --- a/src/lib/rpc/svc_udp.c +++ b/src/lib/rpc/svc_udp.c @@ -479,6 +479,7 @@ cache_set( newbuf = mem_alloc(su->su_iosz); if (newbuf == NULL) { CACHE_PERROR("cache_set: could not allocate new rpc_buffer"); + free(victim); return; } }