getting compiling errors with malloc