Fixed off-by-one memory allocation that could lead to invalid memory reads on strlen()
Always properly null terminate strings before ini parsing
Remove unnecessary memset() statements