about summary refs log tree commit diff
path: root/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/svc.c2
-rw-r--r--sunrpc/svc_run.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 59b902dd63..4446692dc0 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -367,7 +367,7 @@ svc_getreq_poll (struct pollfd *pfdp, int pollretval)
 	  ++fds_found;
 
 	  if (p->revents & POLLNVAL)
-	    xprt_unregister (p->fd);
+	    xprt_unregister (xports[p->fd]);
 	  else
 	    svc_getreq_common (p->fd);
 	}
diff --git a/sunrpc/svc_run.c b/sunrpc/svc_run.c
index e6ffb0f027..72fb939e78 100644
--- a/sunrpc/svc_run.c
+++ b/sunrpc/svc_run.c
@@ -70,14 +70,17 @@ svc_run (void)
       switch (i = __poll (my_pollfd, svc_max_pollfd, -1))
 	{
 	case -1:
+	  free (my_pollfd);
 	  if (errno == EINTR)
 	    continue;
 	  perror (_("svc_run: - poll failed"));
 	  return;
 	case 0:
+	  free (my_pollfd);
 	  continue;
 	default:
 	  svc_getreq_poll (my_pollfd, i);
+	  free (my_pollfd);
 	}
     }
 }