Fixed a memory leak

Fixed 2 memory leaks, turns out one was already fixed.