Hello,

It seems that the windows version of uv-freeaddrinfo() does not
deallocate the list of addrinfo structures properly which results in a
memory leak.

glibc on Linux implements freeaddrinfo (which is simply called by
uv-freeaddrinfo() on Unix) as:

void
freeaddrinfo (struct addrinfo *ai)
{
  struct addrinfo *p;

  while (ai != NULL)
    {
      p = ai;
      ai = ai->ai_next;
      free (p->ai_canonname);
      free (p);
    }
}

Whereas on Windows uv-freeaddrinfo() is implemented as such:

void uv_freeaddrinfo(struct addrinfo* ai) {
  char* alloc_ptr = (char*)ai;

  /* release copied result memory */
  if (alloc_ptr != NULL) {
    free(alloc_ptr);
  }
}

So obviously the linked addrinfo structures are properly deallocated.


-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to