完善memlib free,防止重复调用free出错。

Signed-off-by: liuning <liuning587@qq.com>