AW: [En-Nut-Discussion] DNS fix
Oliver Schulz
olischulz at web.de
Thu Apr 15 20:30:12 CEST 2004
Hi Michel,
>
> I made 2 fixes in pro/resolv.c:
> - When an answer contained both CNAME and an A record, the A
> record would
> not be noticed
Right. I received this bugfix today also from Damian Slee and will commit a
new version this evening after testing.
> - Prevent freeing twice
Sorry to say that, but your modifications are are useless.
If you assign a value to a function parameter, which is stored normally on
stack or in a register, this value is destroyed after the function returns,
because it is just a copy of the passed parameter. If you want to alter the
parameter itself, you have to pass it as a pointer, like in this example:
static void ReleaseDnsHeader(DNSHEADER ** doh)
{
if (*doh) {
NutHeapFree(*doh);
*doh = 0;
}
}
Regards,
Oliver.
More information about the En-Nut-Discussion
mailing list