summaryrefslogtreecommitdiff
path: root/louloulibs/network/resolver.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-03-09 18:49:48 +0100
committerlouiz’ <louiz@louiz.org>2017-03-09 18:49:48 +0100
commitd44125371fb9f170ea708e96682ad376a45fc293 (patch)
treefea09636c184ef712be55cf436cba2996dcd2cd5 /louloulibs/network/resolver.cpp
parenta0a2de3b4d2facb25bbead59873cbf7f58f1d62a (diff)
downloadbiboumi-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/network/resolver.cpp')
-rw-r--r--louloulibs/network/resolver.cpp2
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();