diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-10 23:20:22 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-10 23:20:22 +0000 |
commit | 7db7941547de86662ef38d041af7c03f2a91a7b5 (patch) | |
tree | a2519b2f7d18b654330f104bdd6bad42110aa801 | |
parent | 39111448a26dbc6d14f342df42a47760a7b422ec (diff) |
Fix deref of free()'d ptr. NetBSD PR#2747 from beal@dilbert.umiacs.umd.edu
-rw-r--r-- | usr.bin/oldrdist/gram.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/oldrdist/gram.y b/usr.bin/oldrdist/gram.y index 4353c98ab09..231e066f9bd 100644 --- a/usr.bin/oldrdist/gram.y +++ b/usr.bin/oldrdist/gram.y @@ -34,7 +34,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)gram.y 8.1 (Berkeley) 6/9/93"; */ -static char *rcsid = "$Id: gram.y,v 1.2 1996/08/22 20:33:20 millert Exp $"; +static char *rcsid = "$Id: gram.y,v 1.3 1996/09/10 23:20:21 millert Exp $"; #endif /* not lint */ #include "defs.h" @@ -368,11 +368,11 @@ insert(label, files, hosts, subcmds) struct subcmd *subcmds; { register struct cmd *c, *prev, *nc; - register struct namelist *h; + register struct namelist *h, *nexth; files = expand(files, E_VARS|E_SHELL); hosts = expand(hosts, E_ALL); - for (h = hosts; h != NULL; free(h), h = h->n_next) { + for (h = hosts; h != NULL; nexth = h->n_next, free(h), h = nexth) { /* * Search command list for an update to the same host. */ |