Fix a typo in memory allocation

Could cause crashes or some wasted memory.