1. No, that is nonsense. Bwater is a two-dimensional array, not three-dimensional! You don't need to free every element, but every array.

2. Sorry, for the confusion. The second statement in my previous post was wrong. memset works bytewise. So your statement will 0x64 as an unsigned char to the whole memory area. If you want to initialize all array elements you have to use a loop for that unless you want to initialize with 0. But that's what sys_malloc does for you in the first place.


Always learn from history, to be sure you make the same mistakes again...