fix: Fixed the memory leaks for good! Thank's valgrind!

Signed-off-by: Stephen L. <lrq3000@gmail.com>