From 0f4584e447aa54df33d685dbe649aed0f1f34cba Mon Sep 17 00:00:00 2001 From: iedowse Date: Sat, 14 Jul 2001 17:17:48 +0000 Subject: 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(+) (limited to 'usr.sbin') diff --git a/usr.sbin/rpcbind/check_bound.c b/usr.sbin/rpcbind/check_bound.c index fe503d7..e5f7081 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); -- cgit v1.1