>Is this right?
Correct, there is no guaranteed way of getting the size of allocated memory. Which is why we told you to place the size in a variable from the start.

-Prelude