From 909c655a9fa38102cfc9864757a33173388146ba Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Tue, 19 Jun 2018 13:15:15 -0400 Subject: [PATCH] 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 --- src/lib/rpc/svc_udp.c | 1 + 1 file changed, 1 insertion(+) 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; } } -- 2.47.2