Originally Posted by
MK27
Who but me would have freed() it?
I wasn't really using that &, I was just covering a personal uncertainty ;)
vis. NOT allocating the memory, what then: isn't there the danger of the same problem if those 24 bytes are written somewhere "unallocated"? in_addr is the same size as a pointer, but that doesn't mean those 4 bytes will be written into the pointer does it?
Or (this is a real question): if I'm using a pointer to structure like this but the logic of the program is such that the info from the struct gets used or copied out in the very next set of instructions, so it doesn't matter what happens to it, mean that I don't need to allocate memory for the return value of function before calling it because this unallocated returned data can't overwrite anything else because it was staticly allocated as part of the function, is now free, but still exists uncorrupted because there are no instructions writing anything to memory?