Fix memory leaks
Fix buffer overflow

We should consider about string terminate '\0'.
Merge pull request #3 from kou/fix-buffer-overflow

Fix buffer overflow
Merge pull request #4 from kou/fix-memory-leaks

Fix memory leaks
Fix struct definition style

One space after "{" is missing.
Merge pull request #5 from kou/fix-struct-definition-style

Fix struct definition style