aboutsummaryrefslogtreecommitdiff
path: root/src/ats/plugin_ats_mlp.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2015-02-19 20:30:05 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2015-02-19 20:30:05 +0000
commite862d9c0c245645665ee19cf623d2bd323238a5f (patch)
treecc3d36db2148dc8eaed15b5dab8118f4b2a651ea /src/ats/plugin_ats_mlp.c
parent8bd00cee8c4335f9598ef6e97a06736c925862a7 (diff)
fix crash: check if problem is already created before updating
Diffstat (limited to 'src/ats/plugin_ats_mlp.c')
-rw-r--r--src/ats/plugin_ats_mlp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index 7d402044f1..698b3ef589 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -785,7 +785,6 @@ mlp_create_problem_update_value (struct MLP_Problem *p,
double *val_array;
int *ind_array;
- GNUNET_assert (NULL != p);
GNUNET_assert (NULL != p->prob);
/* Get number of columns and prepare data structure */
@@ -1589,8 +1588,8 @@ GAS_mlp_solve_problem (void *solver)
{
LOG(GNUNET_ERROR_TYPE_DEBUG, "Problem size changed, rebuilding\n");
notify(mlp, GAS_OP_SOLVE_SETUP_START, GAS_STAT_SUCCESS, GAS_INFO_FULL);
- mlp_delete_problem(mlp);
- if (GNUNET_SYSERR == mlp_create_problem(mlp))
+ mlp_delete_problem (mlp);
+ if (GNUNET_SYSERR == mlp_create_problem (mlp))
{
notify(mlp, GAS_OP_SOLVE_SETUP_STOP, GAS_STAT_FAIL, GAS_INFO_FULL);
return GNUNET_SYSERR;
@@ -1905,6 +1904,9 @@ GAS_mlp_address_property_changed (void *solver,
struct MLP_information *mlpi = address->solver_information;
struct GAS_MLP_Handle *mlp = solver;
+ if (NULL == mlp->p.prob)
+ return; /* There is no MLP problem to update yet */
+
if (NULL == mlpi)
{
LOG (GNUNET_ERROR_TYPE_INFO,