Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1712?usp=email
to review the following change.
Change subject: dns: Fix memory leak in dns_server_addr_parse
......................................................................
dns: Fix memory leak in dns_server_addr_parse
When the DNS server's address count is already full (exceeds the
limit of 8), the function returned early without freeing the
successfully resolved addrinfo struct. Fix this by checking the
limit before executing the DNS lookup.
Change-Id: I7ec318c86af994284d1c6272e3bbe2b1ede160fd
Signed-off-by: saddamr3e <[email protected]>
---
M src/openvpn/dns.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/12/1712/1
diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c
index 954ed52..1465cdf 100644
--- a/src/openvpn/dns.c
+++ b/src/openvpn/dns.c
@@ -114,13 +114,13 @@
addr = addrcopy;
}
- struct addrinfo *ai = NULL;
- if (openvpn_getaddrinfo(0, addr, NULL, 0, NULL, af, &ai) != 0)
+ if (server->addr_count >= SIZE(server->addr))
{
return false;
}
- if (server->addr_count >= SIZE(server->addr))
+ struct addrinfo *ai = NULL;
+ if (openvpn_getaddrinfo(0, addr, NULL, 0, NULL, af, &ai) != 0)
{
return false;
}
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1712?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7ec318c86af994284d1c6272e3bbe2b1ede160fd
Gerrit-Change-Number: 1712
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel