~singpolyma/biboumi

d44125371fb9f170ea708e96682ad376a45fc293 — louiz’ 7 years ago a0a2de3
Free the result pointer provided by udns

Fix a memory leak that would occur on every DNS request, when using udns
1 files changed, 2 insertions(+), 0 deletions(-)

M louloulibs/network/resolver.cpp
M louloulibs/network/resolver.cpp => louloulibs/network/resolver.cpp +2 -0
@@ 114,6 114,7 @@ void Resolver::start_resolving(const std::string& hostname, const std::string& p
    Resolver* resolver = static_cast<Resolver*>(data);
    resolver->on_hostname6_resolved(result);
    resolver->after_resolved();
    std::free(result);
  };

  auto hostname4_resolved = [](dns_ctx*, dns_rr_a4* result, void* data)


@@ 121,6 122,7 @@ void Resolver::start_resolving(const std::string& hostname, const std::string& p
    Resolver* resolver = static_cast<Resolver*>(data);
    resolver->on_hostname4_resolved(result);
    resolver->after_resolved();
    std::free(result);
  };

  DNSHandler::watch();