aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-02-22 11:32:41 +0000
committerChristian Grothoff <christian@grothoff.org>2010-02-22 11:32:41 +0000
commit0223276adfcb6e394ba77f3bdb30131c0bf1eabb (patch)
tree24327a0276b151f099385947486a1538d8f856cc /src
parent7e0bf9ebe55da4b69bf6d78c415326089d73cf4c (diff)
downloadgnunet-0223276adfcb6e394ba77f3bdb30131c0bf1eabb.tar.gz
gnunet-0223276adfcb6e394ba77f3bdb30131c0bf1eabb.zip
fixing leaks, use after free
Diffstat (limited to 'src')
-rw-r--r--src/testing/testing_group.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index c2b4340af..d20a6412f 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -582,7 +582,7 @@ create_erdos_renyi (struct GNUNET_TESTING_PeerGroup *pg)
582 char *p_string; 582 char *p_string;
583 connect_attempts = 0; 583 connect_attempts = 0;
584 584
585 probability = GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PROBABILITY", &p_string); 585 GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PROBABILITY", &p_string);
586 if (p_string != NULL) 586 if (p_string != NULL)
587 { 587 {
588 probability = atof(p_string); 588 probability = atof(p_string);
@@ -591,6 +591,7 @@ create_erdos_renyi (struct GNUNET_TESTING_PeerGroup *pg)
591 { 591 {
592 probability = 0.0; /* FIXME: default probability? */ 592 probability = 0.0; /* FIXME: default probability? */
593 } 593 }
594 GNUNET_free (p_string);
594 for (outer_count = 0; outer_count < pg->total - 1; outer_count++) 595 for (outer_count = 0; outer_count < pg->total - 1; outer_count++)
595 { 596 {
596 for (inner_count = outer_count + 1; inner_count < pg->total; 597 for (inner_count = outer_count + 1; inner_count < pg->total;
@@ -761,7 +762,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
761 pid_t pid; 762 pid_t pid;
762 char *arg; 763 char *arg;
763 struct GNUNET_PeerIdentity *temppeer; 764 struct GNUNET_PeerIdentity *temppeer;
764 const char * mytemp; 765 char * mytemp;
765 766
766 for (pg_iter = 0; pg_iter < pg->total; pg_iter++) 767 for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
767 { 768 {
@@ -784,8 +785,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
784 { 785 {
785 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 786 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
786 _("No SERVICEHOME specified in peer configuration, can't copy friends file!\n")); 787 _("No SERVICEHOME specified in peer configuration, can't copy friends file!\n"));
787 fclose(temp_friend_handle);
788 unlink(mytemp); 788 unlink(mytemp);
789 GNUNET_free (mytemp);
789 break; 790 break;
790 } 791 }
791 792
@@ -814,7 +815,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
814#endif 815#endif
815 GNUNET_free(arg); 816 GNUNET_free(arg);
816 } 817 }
817 818 GNUNET_free (temp_service_path);
819 GNUNET_free (mytemp);
818 } 820 }
819} 821}
820 822