Date: Wed, 13 Jun 2001 21:30:03 -0700 (PDT) From: Dima Dorfman <dima@unixfreak.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/27990: ypbind uses memory after freeing it Message-ID: <200106140430.f5E4U3D31535@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/27990; it has been noted by GNATS.
From: Dima Dorfman <dima@unixfreak.org>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106140430.f5E4U3D31535>
