diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-30 11:10:16 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-30 11:10:16 +0000 |
commit | 25b24f97f1c59f7c98d41419093f42dd8134342a (patch) | |
tree | a92d476a8b13b536f91494720dcff0a8d469a87e /src | |
parent | fba943e3277c68b7212e4803e934f2f301a2b356 (diff) | |
download | gnunet-25b24f97f1c59f7c98d41419093f42dd8134342a.tar.gz gnunet-25b24f97f1c59f7c98d41419093f42dd8134342a.zip |
- fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 79d695b6b..dd6822a41 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -942,6 +942,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, | |||
942 | int status) | 942 | int status) |
943 | { | 943 | { |
944 | struct RunContext *rc = cls; | 944 | struct RunContext *rc = cls; |
945 | struct GNUNET_TESTBED_Host **old_hosts; | ||
945 | unsigned int nhost; | 946 | unsigned int nhost; |
946 | 947 | ||
947 | for (nhost = 0; nhost < rc->num_hosts; nhost++) | 948 | for (nhost = 0; nhost < rc->num_hosts; nhost++) |
@@ -970,7 +971,14 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, | |||
970 | rc->h = rc->hosts[0]; | 971 | rc->h = rc->hosts[0]; |
971 | rc->num_hosts--; | 972 | rc->num_hosts--; |
972 | if (0 < rc->num_hosts) | 973 | if (0 < rc->num_hosts) |
973 | rc->hosts = &rc->hosts[1]; | 974 | { |
975 | old_hosts = rc->hosts; | ||
976 | rc->hosts = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) | ||
977 | * rc->num_hosts); | ||
978 | memcpy (rc->hosts, &old_hosts[1], (sizeof (struct GNUNET_TESTBED_Host *) | ||
979 | * rc->num_hosts)); | ||
980 | GNUNET_free (old_hosts); | ||
981 | } | ||
974 | else | 982 | else |
975 | { | 983 | { |
976 | GNUNET_free (rc->hosts); | 984 | GNUNET_free (rc->hosts); |