Fix memory stomp due to incorrect malloc size.
Merge pull request #5 from reltham/dev

Fix memory stomp due to incorrect malloc size.