diff options
author | Ben Smithurst <ben@FreeBSD.org> | 2001-06-23 18:07:18 +0000 |
---|---|---|
committer | Ben Smithurst <ben@FreeBSD.org> | 2001-06-23 18:07:18 +0000 |
commit | b12f64736598f900837610624106d9c35efb7bb8 (patch) | |
tree | a97428de19b2f6da74a26d2708f78502cb2bc22a /usr.sbin/ypbind/ypbind.c | |
parent | 8e81760b1a8a2c30a5427b154c617004a5e8a8a9 (diff) | |
download | src-b12f64736598f900837610624106d9c35efb7bb8.tar.gz src-b12f64736598f900837610624106d9c35efb7bb8.zip |
Don't dereference a pointer after freeing that pointer.
PR: 27990
Reviewed by: dd, phk
Tested by: dd
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=78674
Diffstat (limited to 'usr.sbin/ypbind/ypbind.c')
-rw-r--r-- | usr.sbin/ypbind/ypbind.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 5304422116c9..e178f6ad306f 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -394,7 +394,7 @@ char **argv; 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 @@ char **argv; 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)) |