arduino: Fixed bug in memory allocation

Thanks to Horst Wagner for pointing this out.