From 36171134c5ea8d78849f1009bae14e83c9b8feec Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 9 Jun 2022 07:47:36 -0700 Subject: modules/montage: minor fixups Contexts aren't void* anymore, and free the contexts array too on failure. --- src/modules/montage/montage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c index 4702564..2db9fdd 100644 --- a/src/modules/montage/montage.c +++ b/src/modules/montage/montage.c @@ -77,8 +77,9 @@ static til_module_context_t * montage_create_context(unsigned seed, unsigned tic ctxt->modules[ctxt->n_modules++] = module; } - ctxt->contexts = calloc(ctxt->n_modules, sizeof(void *)); + ctxt->contexts = calloc(ctxt->n_modules, sizeof(til_module_context_t *)); if (!ctxt->contexts) { + free(ctxt->modules); free(ctxt); return NULL; -- cgit v1.2.1