Im curious about an explanation for the following example:
void
release(ptr *foo) {
/* ... */
}
int
main(int argc, char **argv)
{
goto cleanup;
ptr *foo = someFunctionAllocatingMemory();
cleanup:
release(foo);
return 0;
}
What will be the value of foo in the release function? Running that example on an ARM using gcc for compilation gave me NULL. Is that consistent for every architecture / compiler? Can someone explain what is going on here?