less malloc, still leaky
less malloc, still leaky