From b1a7433e0b06c3aa84d6fca95dbc11a1cb07324d Mon Sep 17 00:00:00 2001 From: Mike Heffner Date: Tue, 19 Jun 2001 03:48:26 +0000 Subject: [PATCH] Call clnt_destroy() to prevent exhausting resources. PR: bin/14255 Reviewed by: Kenji Tomita MFC after: 2 weeks --- usr.bin/rup/rup.c | 2 ++ usr.bin/rusers/rusers.c | 1 + 2 files changed, 3 insertions(+) diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c index 6d414b059be..a93c6a235da 100644 --- a/usr.bin/rup/rup.c +++ b/usr.bin/rup/rup.c @@ -176,11 +176,13 @@ onehost(char *host) tv.tv_usec = 0; if (clnt_call(rstat_clnt, RSTATPROC_STATS, xdr_void, NULL, xdr_statstime, &host_stat, tv) != RPC_SUCCESS) { warnx("%s: %s", host, clnt_sperror(rstat_clnt, host)); + clnt_destroy(rstat_clnt); return(-1); } addr.sin_addr.s_addr = *(int *)hp->h_addr; rstat_reply((caddr_t)&host_stat, &addr); + clnt_destroy(rstat_clnt); return (0); } diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c index 0605a612374..2322c98b26e 100644 --- a/usr.bin/rusers/rusers.c +++ b/usr.bin/rusers/rusers.c @@ -191,6 +191,7 @@ onehost(char *host) errx(1, "%s", clnt_sperror(rusers_clnt, "")); addr.sin_addr.s_addr = *(int *)hp->h_addr; rusers_reply((caddr_t)&up, &addr); + clnt_destroy(rusers_clnt); } void