On Fri, 29 Sep 2017 23:50:23 -0700 (PDT),
asetof...@gmail.com
wrote:
>I say this because it seems that code (if I write some other ;)
>compile run and when it return out from the loop : return one obj not ok at last the free() function I use says this
If that incomprehensible sentence means free reports that the value is
not one that was returned by an appropriate allocation function, that
makes perfect sense. After 100 iterations of your for loop never
executing the return statement, the function exits without returning a
value. Attempting to evaluate the non-existent returned value causes
undefined behavior.
In practical terms, the value your calling function receives will
probably be whatever residual bit pattern was left in the stack where
the returned value would have been placed by a return statement. It
is extremely unlikely that this value is one that free can process
properly.