gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10402 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r10402 - gnunet/src/testing
Date: Mon, 22 Feb 2010 12:32:41 +0100

Author: grothoff
Date: 2010-02-22 12:32:41 +0100 (Mon, 22 Feb 2010)
New Revision: 10402

Modified:
   gnunet/src/testing/testing_group.c
Log:
fixing leaks, use after free

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2010-02-22 11:25:38 UTC (rev 10401)
+++ gnunet/src/testing/testing_group.c  2010-02-22 11:32:41 UTC (rev 10402)
@@ -582,7 +582,7 @@
   char *p_string;
   connect_attempts = 0;
 
-  probability = GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", 
"PROBABILITY", &p_string);
+  GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PROBABILITY", 
&p_string);
   if (p_string != NULL)
     {
       probability = atof(p_string);
@@ -591,6 +591,7 @@
     {
       probability = 0.0; /* FIXME: default probability? */
     }
+  GNUNET_free (p_string);
   for (outer_count = 0; outer_count < pg->total - 1; outer_count++)
     {
       for (inner_count = outer_count + 1; inner_count < pg->total;
@@ -761,7 +762,7 @@
   pid_t pid;
   char *arg;
   struct GNUNET_PeerIdentity *temppeer;
-  const char * mytemp;
+  char * mytemp;
 
   for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
     {
@@ -784,8 +785,8 @@
         {
           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                     _("No SERVICEHOME specified in peer configuration, can't 
copy friends file!\n"));
-          fclose(temp_friend_handle);
           unlink(mytemp);
+         GNUNET_free (mytemp);
           break;
         }
 
@@ -814,7 +815,8 @@
 #endif
           GNUNET_free(arg);
         }
-
+      GNUNET_free (temp_service_path);
+      GNUNET_free (mytemp);
     }
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]