MSVC calloc question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mridul
Posts: 14
Joined: Sun Jan 23, 2011 1:41 pm

Re: MSVC calloc question

Post by mridul »

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