Replace memcpy with struct assignment.

Doing so limits the attack vector as memcpy() can cause a buffer overflow() attack. That, and memcpy() is probably less efficient than a struct assignment.
Remove malloc

I changed the memory allocation from dynamic (malloc()) to static (stack) for performance and simplicity, as static memory allocations don't require free()ing. Plus, that's one less thing to link to the binary.