Fixed a memory leak

Fixed a memory leak