Fixed double delete and memory leak!

Signed-off-by: PandaDragonThing <jacob@linuxrocket.net>