Fixed memory leak when empty word found.
This commit is contained in:
parent
7617bbfae9
commit
690b7730fe
|
|
@ -648,11 +648,12 @@ cp_evloop(char *string)
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
freewl = wlist = getcommand(string);
|
freewl = wlist = getcommand(string);
|
||||||
if (wlist == NULL) { /* End of file or end of user input. */
|
if (wlist == NULL) { /* End of file or end of user input. */
|
||||||
if (cend[stackp] && cend[stackp]->co_parent && !string) {
|
if (cend[stackp] && cend[stackp]->co_parent && !string) {
|
||||||
cp_resetcontrol();
|
cp_resetcontrol();
|
||||||
continue;
|
continue;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -669,12 +670,14 @@ cp_evloop(char *string)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Just a check... */
|
/* Just a check... */
|
||||||
for (ww = wlist; ww; ww = ww->wl_next)
|
for (ww = wlist; ww; ww = ww->wl_next) {
|
||||||
if (!ww->wl_word) {
|
if (!ww->wl_word) {
|
||||||
fprintf(cp_err,
|
fprintf(cp_err,
|
||||||
"cp_evloop: Internal Error: NULL word pointer\n");
|
"cp_evloop: Internal Error: NULL word pointer\n");
|
||||||
|
wl_free(wlist);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Add this to the control structure list. If cend->co_type is
|
/* Add this to the control structure list. If cend->co_type is
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue