Fix memory leak

Signed-off-by: leo-ma <begeekmyfriend@gmail.com>