diff options
author | uzhas <uzhas@ydb.tech> | 2023-10-17 18:43:28 +0300 |
---|---|---|
committer | uzhas <uzhas@ydb.tech> | 2023-10-17 19:33:12 +0300 |
commit | cc1f2e5275032108b1e7e7410b858797b6c44ac8 (patch) | |
tree | 592ba12321817c051c8efc7aa46e3fda8a84e62d /library/cpp | |
parent | c956902b9bd04fcbd41281426bf74d7acc1f9fc0 (diff) | |
download | ydb-cc1f2e5275032108b1e7e7410b858797b6c44ac8.tar.gz |
fix coverity issue: resource leak
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/actors/http/http_proxy_sock64.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/cpp/actors/http/http_proxy_sock64.h b/library/cpp/actors/http/http_proxy_sock64.h index 9b7db8f6620..fa6d9a1e567 100644 --- a/library/cpp/actors/http/http_proxy_sock64.h +++ b/library/cpp/actors/http/http_proxy_sock64.h @@ -81,19 +81,21 @@ public: .ai_family = 0, .ai_socktype = SOCK_STREAM, }; + int result = 0; struct addrinfo* gai_res = nullptr; int gai_ret = getaddrinfo(address.data(), nullptr, &hints, &gai_res); if (gai_ret == 0 && gai_res->ai_addr) { switch (gai_res->ai_addr->sa_family) { case AF_INET: case AF_INET6: - return gai_res->ai_addr->sa_family; + result = gai_res->ai_addr->sa_family; + break; } } if (gai_res) { freeaddrinfo(gai_res); } - return 0; + return result; } static std::shared_ptr<ISockAddr> MakeAddress(const sockaddr_storage& storage) { |