Just as a side note - the code you presented is buggy w.r.t free.
You are trying to free something which has been 'moved' from the original value the *alloc returned you with. If it had been an alligned value returned to begin with, then you are fine (and the code is useless) - else the free is broken.
Just thought I will mention :-)
- Mridul
MSVC calloc question
Moderators: hgm, Rebel, chrisw