dnsget

Abhijit Pandey abhijpandey at gmail.com
Fri Sep 18 22:43:10 MSD 2009


Hi Michael,

Could you point me to such places in the library as well as in application
dnsget.
Seems if I keep the context open, and send multiple queries to it.
In case of errors will run into memory issues.

Abhijit

On Fri, Sep 18, 2009 at 11:09 AM, Michael Tokarev <mjt at tls.msk.ru> wrote:

> Abhijit Pandey wrote:
>
>> In dnsget there is a memory leak before the return statement.
>> dns_close needs to be done.
>>
>>   dns_close(NULL);
>>>
>>
>>    return errors ? 1 : notfound ? 100 : 0;
>>  }
>>
>
> Well, it's at the very end of main(), right before
> return.  There's no need to free memory or close
> filedescriptors there, since kernel will do that
> all much quicker after exit - by freeing things
> here we're just wasting (some small amount of) time.
>
> And if you're about fixing "memory leaks" like this,
> you can as well check all error returns.  Which is,
> again, useless.
>
> /mjt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.corpit.ru/pipermail/udns/attachments/20090918/7abee60b/attachment.htm>


More information about the udns mailing list