shithub: choc

Download patch

ref: 0074d76e44a91f7beabc7463dd652d15caa88dbc
parent: 803e8e43d92ae60b7255905429cec7b63996378c
author: Turo Lamminen <[email protected]>
date: Tue Dec 11 14:34:36 EST 2018

net: Fix const correctness issue in NET_SDL_ResolveAddress

--- a/src/net_sdl.c
+++ b/src/net_sdl.c
@@ -343,17 +343,14 @@
     }
     else
     {
-	addr_hostname = address;
+	addr_hostname = M_StringDuplicate(address);
 	addr_port = port;
     }
     
     result = SDLNet_ResolveHost(&ip, addr_hostname, addr_port);
 
-    if (addr_hostname != address)
-    {
-	free(addr_hostname);
-    }
-    
+    free(addr_hostname);
+
     if (result)
     {
         // unable to resolve