From c8a28c2ec9d16becbfe9bbf62972e60dfb7e7344 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Sat, 14 Jul 2001 17:17:48 +0000 Subject: [PATCH] Fix a memory leak in check_bound() by freeing the buffer area of the netbuf before freeing the netbuf structure itself. --- usr.sbin/rpcbind/check_bound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/rpcbind/check_bound.c b/usr.sbin/rpcbind/check_bound.c index fe503d74ebd..e5f7081b6f1 100644 --- a/usr.sbin/rpcbind/check_bound.c +++ b/usr.sbin/rpcbind/check_bound.c @@ -94,6 +94,7 @@ check_bound(struct fdlist *fdl, char *uaddr) fd = __rpc_nconf2fd(fdl->nconf); if (fd < 0) { + free(na->buf); free(na); return (TRUE); } @@ -101,6 +102,7 @@ check_bound(struct fdlist *fdl, char *uaddr) ans = bind(fd, (struct sockaddr *)na->buf, na->len); close(fd); + free(na->buf); free(na); return (ans == 0 ? FALSE : TRUE);