Close bin/2747: rdist accesses free()d memory

This commit is contained in:
Paul Traina 1996-09-11 01:39:55 +00:00
parent 86ca32cd60
commit 172e05288c

View File

@ -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.
*/