Patch by breese: Fixed two memory leaks and an uninitialized array.
Authored by: pheonixstorm 2010-12-12
Parent: [r12966]
Child: [r12968]