X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fwx-console%2Fconsole_conf.c;h=976794b2315a4b8e8fa879951e561accc56627f9;hb=b8224aab234012c2d127b84eceb160e99dd4a14d;hp=82bb8842d8cd90a9da8c30b2c278de44e320212c;hpb=369cbc2c4aafcbfd0404b3a4ca242a81f3db8332;p=bacula%2Fbacula diff --git a/bacula/src/wx-console/console_conf.c b/bacula/src/wx-console/console_conf.c index 82bb8842d8..976794b231 100644 --- a/bacula/src/wx-console/console_conf.c +++ b/bacula/src/wx-console/console_conf.c @@ -320,15 +320,16 @@ void save_resource(int type, RES_ITEM *items, int pass) if (!res_head[rindex]) { res_head[rindex] = (RES *)res; /* store first entry */ } else { - RES *next; - for (next=res_head[rindex]; next->next; next=next->next) { + RES *next, *last; + for (last=next=res_head[rindex]; next; next=next->next) { + last = next; if (strcmp(next->name, res->res_dir.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, wxString(_("Attempt to define second %s resource named \"%s\" is not permitted.\n")).mb_str(*wxConvCurrent), resources[rindex].name, res->res_dir.hdr.name); } } - next->next = (RES *)res; + last->next = (RES *)res; Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type), res->res_dir.hdr.name); }