Fixed Memory leaks

Signed-off-by: Crant <chrippe10@hotmail.com>