diff options
author | pst <pst@FreeBSD.org> | 1996-09-11 01:39:55 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1996-09-11 01:39:55 +0000 |
commit | 4ff1c6aa9b282c12f466dd45d5af1a5bfdf31ae1 (patch) | |
tree | 06d97d97317c535f6938d80cef65d7a38734e670 | |
parent | 9c9470d34012a98202e89f016eb96568eb8656f1 (diff) | |
download | FreeBSD-src-4ff1c6aa9b282c12f466dd45d5af1a5bfdf31ae1.zip FreeBSD-src-4ff1c6aa9b282c12f466dd45d5af1a5bfdf31ae1.tar.gz |
Close bin/2747: rdist accesses free()d memory
-rw-r--r-- | usr.bin/rdist/gram.y | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rdist/gram.y b/usr.bin/rdist/gram.y index 22d0ee8..09f6f68 100644 --- a/usr.bin/rdist/gram.y +++ b/usr.bin/rdist/gram.y @@ -383,11 +383,11 @@ insert(label, files, hosts, subcmds) struct subcmd *subcmds; { register struct cmd *c, *prev, *nc; - register struct namelist *h; + register struct namelist *h, *next_h; 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; next_h = h->n_next, free(h), h = next_h) { /* * Search command list for an update to the same host. */ |