static void free_todo_entries(TodoEntry **todos) {
        for (TodoEntry *x = *todos; x && x->dir; x++) {
                closedir(x->dir);
                free(x->dirname);
        }

        freep(todos);
}
The product does not properly control the amount of recursion which takes place,  consuming excessive resources, such as allocated memory or the program stack.