summaryrefslogtreecommitdiff
path: root/sunrpc/svc_udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/svc_udp.c')
-rw-r--r--sunrpc/svc_udp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
index c0c115abeb..67b84f184f 100644
--- a/sunrpc/svc_udp.c
+++ b/sunrpc/svc_udp.c
@@ -485,6 +485,7 @@ svcudp_enablecache (SVCXPRT *transp, u_long size)
uc->uc_entries = ALLOC (cache_ptr, size * SPARSENESS);
if (uc->uc_entries == NULL)
{
+ mem_free (uc, sizeof (struct udp_cache));
CACHE_PERROR (_("enablecache: could not allocate cache data"));
return 0;
}
@@ -492,6 +493,8 @@ svcudp_enablecache (SVCXPRT *transp, u_long size)
uc->uc_fifo = ALLOC (cache_ptr, size);
if (uc->uc_fifo == NULL)
{
+ mem_free (uc->uc_entries, size * SPARSENESS);
+ mem_free (uc, sizeof (struct udp_cache));
CACHE_PERROR (_("enablecache: could not allocate cache fifo"));
return 0;
}
@@ -545,6 +548,7 @@ cache_set (SVCXPRT *xprt, u_long replylen)
newbuf = mem_alloc (su->su_iosz);
if (newbuf == NULL)
{
+ mem_free (victim, sizeof (struct cache_node));
CACHE_PERROR (_("cache_set: could not allocate new rpc_buffer"));
return;
}