You only need to free
things you malloc
ed, so you don't need to free the static variables.
As your readline function seems to use strdup and that uses malloc/calloc, you need to free input
. You do this in the loop which is good, but you missed it when you exit the loop:
if(strcmp(input,cmd_exit) == 0) {
puts("Bye!");
free(input);
return 0;
}
By the way:
static char prompt[6] = "repl>";
The text "repl>" has 6 chars, r, e, p, l, > and a nul byte to mark the end of the string.