(no commit message)
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Apr 2010 15:57:19 +0000 (15:57 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Apr 2010 15:57:19 +0000 (15:57 +0000)
src/hostlist/hostlist-client.c
src/hostlist/hostlist-server.c

index ecdd578af24109a2be0aa0abacf0fb4862a92ebe..181f9da14ccc573d4e2af3d663b1a53cb7a50af2 100644 (file)
@@ -1053,7 +1053,7 @@ load_hostlist_file ()
       return;
     }
 
-
+  counter = 0;
   while ( (GNUNET_OK == GNUNET_BIO_read_string (rh, "url" , &uri, MAX_URL_LEN)) &&
          (GNUNET_OK == GNUNET_BIO_read_int32 (rh, &times_used)) &&
          (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &quality)) &&
@@ -1072,6 +1072,7 @@ load_hostlist_file ()
       linked_list_size++;
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Added hostlist entry eith URI `%s' \n", hostlist->hostlist_uri);
+      GNUNET_free (uri);
       uri = NULL;
       counter++;
       if ( counter >= MAX_NUMBER_HOSTLISTS ) break;
@@ -1114,6 +1115,7 @@ static void save_hostlist_file ( int shutdown )
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                   _("No `%s' specified in `%s' configuration, cannot save hostlists to file.\n"),
                   "HOSTLISTFILE", "HOSTLIST");
+                  GNUNET_free (filename);
       return;
     }
   wh = GNUNET_BIO_write_open (filename);
@@ -1123,6 +1125,7 @@ static void save_hostlist_file ( int shutdown )
                   _("Could not open file `%s' for writing to save hostlists: %s\n"),
                   filename,
                  STRERROR (errno));
+                  GNUNET_free (filename);
       return;
     }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
index e9a72d42b8060f4aab4ea187212cd9ba766daf33..bb9265b3af3afc5cabb105659a8a8d62330c7af2 100644 (file)
@@ -613,6 +613,7 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
       size = strlen (hostname);
       if (size + 15 > MAX_URL_LEN)
        {
+          GNUNET_free ( hostname );
          GNUNET_break (0);
        }
       else
@@ -627,6 +628,7 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
                      hostlist_uri);
        }
     }
+  GNUNET_free ( hostname );
   daemon_handle_v6 = MHD_start_daemon (MHD_USE_IPv6 
 #if DEBUG_HOSTLIST_SERVER
                                       | MHD_USE_DEBUG