diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-07-14 17:17:48 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-07-14 17:17:48 +0000 |
commit | 0f4584e447aa54df33d685dbe649aed0f1f34cba (patch) | |
tree | 51cddda5c87559466c4203530110ae046f612769 /usr.sbin | |
parent | 7727f026d5f148e9654b229e6f3883c459da14c9 (diff) | |
download | FreeBSD-src-0f4584e447aa54df33d685dbe649aed0f1f34cba.zip FreeBSD-src-0f4584e447aa54df33d685dbe649aed0f1f34cba.tar.gz |
Fix a memory leak in check_bound() by freeing the buffer area of
the netbuf before freeing the netbuf structure itself.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rpcbind/check_bound.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |