Every line returned by readline() has to be freed. The call to free()
was unreachable because all paths heading towards it veered off,
resulting in a memory leak. Move the free() to just after where the
line has been used for the last time. Fixes
3a85e0bc9.
add_history(ans);
strncpy(ansbuf, ans, sizeof(ansbuf));
ansbuf[sizeof(ansbuf) - 1] = '\0';
add_history(ans);
strncpy(ansbuf, ans, sizeof(ansbuf));
ansbuf[sizeof(ansbuf) - 1] = '\0';
cpp = brkstring(ansbuf, " ", NULL);
switch (smatch(*cpp, ansp)) {
case AMBIGSW:
cpp = brkstring(ansbuf, " ", NULL);
switch (smatch(*cpp, ansp)) {
case AMBIGSW:
printf(" -%s unknown. Hit <CR> for help.\n", *cpp);
continue;
default:
printf(" -%s unknown. Hit <CR> for help.\n", *cpp);
continue;
default: