diff options
author | Fabian Oehlmann <oehlmann@in.tum.de> | 2013-10-10 11:25:12 +0000 |
---|---|---|
committer | Fabian Oehlmann <oehlmann@in.tum.de> | 2013-10-10 11:25:12 +0000 |
commit | e1f281f93de94c090afd63c7881ec66cac060019 (patch) | |
tree | a402e392e15cf51e5d2c30a590854bf3697e5242 | |
parent | b4c5108baec7fa9a31a5347f34eedc48b1053a97 (diff) | |
download | gnunet-e1f281f93de94c090afd63c7881ec66cac060019.tar.gz gnunet-e1f281f93de94c090afd63c7881ec66cac060019.zip |
-malloc fix for matrix W
-null-pointer fix
-rwxr-xr-x | src/ats/libgnunet_plugin_ats_ril.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ats/libgnunet_plugin_ats_ril.c b/src/ats/libgnunet_plugin_ats_ril.c index 0f2a4c73b..02b0b7d05 100755 --- a/src/ats/libgnunet_plugin_ats_ril.c +++ b/src/ats/libgnunet_plugin_ats_ril.c | |||
@@ -572,7 +572,7 @@ envi_set_active_suggestion (struct GAS_RIL_Handle *solver, | |||
572 | solver->plugin_envi->bandwidth_changed_cb (solver->plugin_envi->bw_changed_cb_cls, | 572 | solver->plugin_envi->bandwidth_changed_cb (solver->plugin_envi->bw_changed_cb_cls, |
573 | new_address); | 573 | new_address); |
574 | } | 574 | } |
575 | else | 575 | else if (agent->address_inuse) |
576 | { | 576 | { |
577 | GNUNET_assert(0 == ntohl (agent->address_inuse->assigned_bw_in.value__)); | 577 | GNUNET_assert(0 == ntohl (agent->address_inuse->assigned_bw_in.value__)); |
578 | GNUNET_assert(0 == ntohl (agent->address_inuse->assigned_bw_out.value__)); | 578 | GNUNET_assert(0 == ntohl (agent->address_inuse->assigned_bw_out.value__)); |
@@ -884,7 +884,7 @@ envi_action_address_switch (struct GAS_RIL_Handle *solver, | |||
884 | static void | 884 | static void |
885 | envi_do_action (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent, int action) | 885 | envi_do_action (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent, int action) |
886 | { | 886 | { |
887 | unsigned int address_index; | 887 | int address_index; |
888 | 888 | ||
889 | switch (action) | 889 | switch (action) |
890 | { | 890 | { |
@@ -1050,7 +1050,7 @@ agent_init (void *s, const struct GNUNET_PeerIdentity *peer) | |||
1050 | agent->active = GNUNET_NO; | 1050 | agent->active = GNUNET_NO; |
1051 | agent->n = RIL_ACTION_TYPE_NUM; | 1051 | agent->n = RIL_ACTION_TYPE_NUM; |
1052 | agent->m = solver->networks_count * RIL_FEATURES_NETWORK_COUNT; | 1052 | agent->m = solver->networks_count * RIL_FEATURES_NETWORK_COUNT; |
1053 | agent->W = (double **) GNUNET_malloc (sizeof (double) * agent->n); | 1053 | agent->W = (double **) GNUNET_malloc (sizeof (double *) * agent->n); |
1054 | for (i = 0; i < agent->n; i++) | 1054 | for (i = 0; i < agent->n; i++) |
1055 | { | 1055 | { |
1056 | agent->W[i] = (double *) GNUNET_malloc (sizeof (double) * agent->m); | 1056 | agent->W[i] = (double *) GNUNET_malloc (sizeof (double) * agent->m); |