27 lines
630 B
Diff
27 lines
630 B
Diff
src/socket.cpp | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/socket.cpp b/src/socket.cpp
|
|
index 1211310..e9402d3 100644
|
|
--- a/src/socket.cpp
|
|
+++ b/src/socket.cpp
|
|
@@ -108,7 +108,6 @@ class dap::Socket::Shared : public dap::ReaderWriter {
|
|
return out;
|
|
}
|
|
|
|
- freeaddrinfo(info);
|
|
term();
|
|
return nullptr;
|
|
}
|
|
@@ -117,7 +116,9 @@ class dap::Socket::Shared : public dap::ReaderWriter {
|
|
Shared(addrinfo* info, SOCKET socket) : info(info), s(socket) {}
|
|
|
|
~Shared() {
|
|
- freeaddrinfo(info);
|
|
+ if (info) {
|
|
+ freeaddrinfo(info);
|
|
+ }
|
|
close();
|
|
term();
|
|
}
|