malloc, cudaMalloc , openGL interoperability & teapot?

Cuda by Example chapter 8 does not use malloc or cudaMalloc.
Could anyone expand on why malloc & cudaMalloc are not needed?

and as necessary why they are needed here:

as an aside what does simpleCUDA2GL do?
ie a window in gingham check is displayed by Jetson,
but code seems rather lengthy and complex…
where is teapot:
GLuint shDrawPot; // colors the teapot