diff options
Diffstat (limited to 'src/modules/drizzle')
-rw-r--r-- | src/modules/drizzle/drizzle.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/modules/drizzle/drizzle.c b/src/modules/drizzle/drizzle.c index 54ca204..18ef731 100644 --- a/src/modules/drizzle/drizzle.c +++ b/src/modules/drizzle/drizzle.c @@ -110,10 +110,8 @@ static til_module_context_t * drizzle_create_context(const til_module_t *module, return NULL; ctxt->puddle = puddle_new(PUDDLE_SIZE, PUDDLE_SIZE); - if (!ctxt->puddle) { - free(ctxt); - return NULL; - } + if (!ctxt->puddle) + return til_module_context_free(&ctxt->til_module_context); ctxt->taps.viscosity = til_tap_init_float(ctxt, &ctxt->viscosity, 1, &ctxt->vars.viscosity, "viscosity"); ctxt->taps.rainfall = til_tap_init_float(ctxt, &ctxt->rainfall, 1, &ctxt->vars.rainfall, "rainfall"); |