diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-02-22 10:56:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-02-22 10:56:16 +0000 |
commit | 6b0c9713ef122b8cb0fb7fc12dca579db2c370ee (patch) | |
tree | 40cad51d156a59916ecdfd3761636bc10ac8a54e /src | |
parent | 391ab060f50b3c705c021c1cd0f73caffd7ef538 (diff) | |
download | gnunet-6b0c9713ef122b8cb0fb7fc12dca579db2c370ee.tar.gz gnunet-6b0c9713ef122b8cb0fb7fc12dca579db2c370ee.zip |
fix leaks, code cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/testing/testing.c | 3 | ||||
-rw-r--r-- | src/testing/testing_group.c | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index 3dd4af367..be3e96509 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -549,6 +549,7 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
549 | GNUNET_free (d->cfgfile); | 549 | GNUNET_free (d->cfgfile); |
550 | GNUNET_free_non_null (d->hostname); | 550 | GNUNET_free_non_null (d->hostname); |
551 | GNUNET_free_non_null (d->username); | 551 | GNUNET_free_non_null (d->username); |
552 | GNUNET_free_non_null (d->shortname); | ||
552 | GNUNET_free (d); | 553 | GNUNET_free (d); |
553 | if (NULL != cb) | 554 | if (NULL != cb) |
554 | cb (cb_cls, NULL); | 555 | cb (cb_cls, NULL); |
@@ -779,7 +780,7 @@ notify_connect_result (void *cls, | |||
779 | ctx->d2th = NULL; | 780 | ctx->d2th = NULL; |
780 | GNUNET_CORE_disconnect (ctx->d1core); | 781 | GNUNET_CORE_disconnect (ctx->d1core); |
781 | ctx->d1core = NULL; | 782 | ctx->d1core = NULL; |
782 | 783 | GNUNET_free_non_null (ctx->hello); | |
783 | GNUNET_free (ctx); | 784 | GNUNET_free (ctx); |
784 | } | 785 | } |
785 | 786 | ||
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 744e505ce..d019bfd70 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -982,7 +982,6 @@ GNUNET_TESTING_daemons_start (struct GNUNET_SCHEDULER_Handle *sched, | |||
982 | unsigned int off; | 982 | unsigned int off; |
983 | unsigned int hostcnt; | 983 | unsigned int hostcnt; |
984 | uint16_t minport; | 984 | uint16_t minport; |
985 | int tempsize; | ||
986 | 985 | ||
987 | if (0 == total) | 986 | if (0 == total) |
988 | { | 987 | { |
@@ -1073,18 +1072,18 @@ GNUNET_TESTING_daemons_start (struct GNUNET_SCHEDULER_Handle *sched, | |||
1073 | GNUNET_CONFIGURATION_get_value_string (pcfg, "PATHS", "SERVICEHOME", | 1072 | GNUNET_CONFIGURATION_get_value_string (pcfg, "PATHS", "SERVICEHOME", |
1074 | &baseservicehome)) | 1073 | &baseservicehome)) |
1075 | { | 1074 | { |
1076 | tempsize = snprintf (NULL, 0, "%s/%d/", baseservicehome, off) + 1; | 1075 | GNUNET_asprintf (&newservicehome, |
1077 | newservicehome = GNUNET_malloc (tempsize); | 1076 | "%s/%d/", baseservicehome, off); |
1078 | snprintf (newservicehome, tempsize, "%s/%d/", baseservicehome, off); | 1077 | GNUNET_free (baseservicehome); |
1079 | } | 1078 | } |
1080 | else | 1079 | else |
1081 | { | 1080 | { |
1082 | tmpdir = getenv ("TMPDIR"); | 1081 | tmpdir = getenv ("TMPDIR"); |
1083 | tmpdir = tmpdir ? tmpdir : "/tmp"; | 1082 | tmpdir = tmpdir ? tmpdir : "/tmp"; |
1084 | tempsize = snprintf (NULL, 0, "%s/%s/%d/", tmpdir, "gnunet-testing-test-test", off) + 1; | 1083 | GNUNET_asprintf (&newservicehome, |
1085 | newservicehome = GNUNET_malloc (tempsize); | 1084 | "%s/%s/%d/", |
1086 | snprintf (newservicehome, tempsize, "%s/%d/", | 1085 | tmpdir, |
1087 | "/tmp/gnunet-testing-test-test", off); | 1086 | "gnunet-testing-test-test", off); |
1088 | } | 1087 | } |
1089 | GNUNET_CONFIGURATION_set_value_string (pcfg, | 1088 | GNUNET_CONFIGURATION_set_value_string (pcfg, |
1090 | "PATHS", | 1089 | "PATHS", |