When running the node.js unit tests under valgrind, I came across a
memory leak that appears to occur in an edge case:
http://my.cdash.org/viewDynamicAnalysis.php?buildid=213364
http://my.cdash.org/viewDynamicAnalysisFile.php?id=698624
The attached patch fixes the issue, but I don't know enough about
c-ares to know if this is truly the "right" fix.
It looks like this boils down to a call in node to ares_gethostbyname
with ipv6.google.com as the name and AF_INET as the family (If a family
isn't specified to node when attempting to do a lookup, it defaults to
trying IPv4 first. If there are no addresses returned it then tries
IPv6).
You can reproduce with:
valgrind --leak-check=full ./build/default/node
./test/simple/test-c-ares.js
Tom
Received on 2011-07-28