diff options
author | louiz’ <louiz@louiz.org> | 2017-03-09 18:49:48 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-03-09 18:49:48 +0100 |
commit | d44125371fb9f170ea708e96682ad376a45fc293 (patch) | |
tree | fea09636c184ef712be55cf436cba2996dcd2cd5 /louloulibs | |
parent | a0a2de3b4d2facb25bbead59873cbf7f58f1d62a (diff) | |
download | biboumi-d44125371fb9f170ea708e96682ad376a45fc293.tar.gz biboumi-d44125371fb9f170ea708e96682ad376a45fc293.tar.bz2 biboumi-d44125371fb9f170ea708e96682ad376a45fc293.tar.xz biboumi-d44125371fb9f170ea708e96682ad376a45fc293.zip |
Free the result pointer provided by udns
Fix a memory leak that would occur on every DNS request, when using udns
Diffstat (limited to 'louloulibs')
-rw-r--r-- | louloulibs/network/resolver.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/louloulibs/network/resolver.cpp b/louloulibs/network/resolver.cpp index 3558800..db7fb32 100644 --- a/louloulibs/network/resolver.cpp +++ b/louloulibs/network/resolver.cpp @@ -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(); |