SuggestMgr::lcs uses malloc twice:
c = (char ) malloc((m + 1) * (n + 1));
b = (char ) malloc((m + 1) * (n + 1));
c is never fully initialized - (m(n+1))...((m+1)(n+1)-1) is not initialized. Furthermore, malloc in this form is susceptible to overflows.
Suggested patch: Replace malloc with calloc. (Patch attached)