From owner-freebsd-bugs Wed Jun 13 21:30:11 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 74C0637B403 for ; Wed, 13 Jun 2001 21:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5E4U3D31535; Wed, 13 Jun 2001 21:30:03 -0700 (PDT) (envelope-from gnats) Date: Wed, 13 Jun 2001 21:30:03 -0700 (PDT) Message-Id: <200106140430.f5E4U3D31535@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Dima Dorfman Subject: Re: bin/27990: ypbind uses memory after freeing it Reply-To: Dima Dorfman Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/27990; it has been noted by GNATS. From: Dima Dorfman To: ben@FreeBSD.org Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/27990: ypbind uses memory after freeing it Date: Wed, 13 Jun 2001 21:21:44 -0700 ben@FreeBSD.org writes: > >Fix: > > This has fixed the problem for me on -stable, not sure if it applies to > current too or not though. If someone can just review it I can commit > it. It applies to -current. I've tried it and it works fine. I also agree with your analysis of the problem. > > --- ypbind.c.orig Sat Jun 9 17:03:47 2001 > +++ ypbind.c Sat Jun 9 17:04:32 2001 > @@ -394,7 +394,7 @@ > int i; > DIR *dird; > struct dirent *dirp; > - struct _dom_binding *ypdb; > + struct _dom_binding *ypdb, *next; > > /* Check that another ypbind isn't already running. */ > if ((yplockfd = (open(YPBINDLOCK, O_RDONLY|O_CREAT, 0444))) == -1) > @@ -493,7 +493,8 @@ > syslog(LOG_WARNING, "select: %m"); > break; > default: > - for(ypdb=ypbindlist; ypdb; ypdb=ypdb->dom_pnext) { > + for(ypdb=ypbindlist; ypdb; ypdb=next) { > + next = ypdb->dom_pnext; > if (READFD > 0 && FD_ISSET(READFD, &fdsr)) { > handle_children(ypdb); > if (children == (MAX_CHILDREN - 1)) > > >Release-Note: > >Audit-Trail: > >Unformatted: > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-bugs" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message