void-packages/srcpkgs/cppdap/patches/no-freeaddrinfo-null.patch

27 lines
630 B
Diff
Raw Normal View History

2023-08-17 13:26:13 +02:00
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();
}