FreeMem and SD

Signed-off-by: Haohua Li <lihaohua90@gmail.com>