diff src/network.c @ 11213:ff728e84d59a

[gaim-migrate @ 13344] Changes by Adam Warrington Fixes a crash on UPnP timeout committer: Tailor Script <tailor@pidgin.im>
author Thomas Butter <tbutter>
date Mon, 08 Aug 2005 21:43:44 +0000
parents 3aeb85cc9cda
children 986160f7b6ca
line wrap: on
line diff
--- a/src/network.c	Mon Aug 08 19:56:41 2005 +0000
+++ b/src/network.c	Mon Aug 08 21:43:44 2005 +0000
@@ -134,8 +134,8 @@
 const char *
 gaim_network_get_my_ip(int fd)
 {
-	const char *ip = NULL;
-  const char *controlURL = NULL;
+  char *ip = NULL;
+  char *controlURL = NULL;
 
 	/* Check if the user specified an IP manually */
 	if (!gaim_prefs_get_bool("/core/network/auto_ip")) {
@@ -147,6 +147,7 @@
   /* attempt to get the ip from a NAT device */
   if ((controlURL = gaim_upnp_discover()) != NULL) {
     ip = gaim_upnp_get_public_ip(controlURL);
+    free(controlURL);
     if (ip != NULL)
       return ip;
   }
@@ -160,7 +161,7 @@
 {
 	int listenfd = -1;
 	const int on = 1;
-  const char *controlURL = NULL;
+  char *controlURL = NULL;
 #if HAVE_GETADDRINFO
 	int errnum;
 	struct addrinfo hints, *res, *next;
@@ -236,6 +237,7 @@
       gaim_upnp_remove_port_mapping(controlURL, port, "TCP");
       gaim_upnp_set_port_mapping(controlURL, port, "TCP");
     }
+    free(controlURL);
   }
 
 	gaim_debug_info("network", "Listening on port: %hu\n", gaim_network_get_port_from_fd(listenfd));