Make sure the ext directory is included in the distributed gem.
Avoid freeing of uninitialized memory.

Thanks to Isha for pointing this out.