fix memory leak

details:
ws->input will be malloced in c-sdk,
so input = malloc() will make a big memory leak