rdmenezes / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

Release buffer from DnsQuery #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SmtpClient.cpp shoud be

int CSmtpClient::GetSmtpServerName(..)
{
...
  if(r==0)
  {
    PDNS_RECORD pRecOrig = apResult;

    while(apResult!=NULL)
    {
      if(apResult->wType==DNS_TYPE_MX)        
      {
        CString sServerName = CString(apResult->Data.MX.pNameExchange);        
        host_list[apResult->Data.MX.wPreference] = sServerName;
      }

      apResult = apResult->pNext;
    }

    DnsRecordListFree( pRecOrig, DnsFreeRecordList);

    return 0;
  }
...
}

buffer returned from dns query must be released and since apResult is NULL 
after evaluation a copy of the original pointer must be saved and passed to 
DnsRecordListFree(..)

Original issue reported on code.google.com by zacca...@zaksoft.com on 21 Jun 2010 at 6:57

GoogleCodeExporter commented 9 years ago
Did this issue have any negative effect? Just a memory leak?

Original comment by zexspect...@gmail.com on 24 Jun 2010 at 4:14

GoogleCodeExporter commented 9 years ago
Fixed in v1.2.5

Original comment by zexspect...@gmail.com on 26 Jun 2010 at 12:24