From 107bdcd8e687b1a33b04db0e058925aafd83f9fb Mon Sep 17 00:00:00 2001 From: JustinAJ Date: Fri, 6 Jun 2014 23:51:40 -0400 Subject: [PATCH] resolveAddress() and resolveHostname() now have static buffers. --- Jupiter/Socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jupiter/Socket.cpp b/Jupiter/Socket.cpp index cbfcd97..bd4141d 100644 --- a/Jupiter/Socket.cpp +++ b/Jupiter/Socket.cpp @@ -260,7 +260,7 @@ addrinfo *Jupiter::Socket::getAddrInfo(addrinfo *addr, int result) // static char *Jupiter::Socket::resolveAddress(const addrinfo *addr) // static { - char *resolved = new char[NI_MAXHOST]; + static char resolved[NI_MAXHOST]; getnameinfo(addr->ai_addr, addr->ai_addrlen, resolved, NI_MAXHOST, 0, 0, NI_NUMERICHOST); return resolved; } @@ -281,7 +281,7 @@ char *Jupiter::Socket::resolveAddress(const char *hostname, int result) // stati char *Jupiter::Socket::resolveHostname(addrinfo *addr) // static { - char *resolved = new char[NI_MAXHOST]; + static char resolved[NI_MAXHOST]; getnameinfo(addr->ai_addr, addr->ai_addrlen, resolved, NI_MAXHOST, 0, 0, 0); return resolved; }