fixed memory allocs on posix