Skip to content

Commit

Permalink
Fixes test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Dias <[email protected]>
  • Loading branch information
rjd15372 committed Nov 12, 2024
1 parent 6950891 commit 202f8de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/modules/helloscripting.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ static HelloProgram *helloLangParseCode(const char *code,
case FUNCTION:
ValkeyModule_Assert(currentFunc == NULL);
currentFunc = ValkeyModule_Alloc(sizeof(HelloFunc));
memset(currentFunc, 0, sizeof(HelloFunc));
program->functions[program->num_functions++] = currentFunc;
helloLangParseFunction(currentFunc);
break;
Expand Down Expand Up @@ -289,6 +290,8 @@ static int createHelloLangEngine(void *engine_ctx,
// We need to cleanup all parsed functions that were not registered.
for (uint32_t j = i; j < ctx->program->num_functions; j++) {
engineFreeFunction(NULL, ctx->program->functions[j]);
ctx->program->functions[j] = NULL;
ctx->program->num_functions--;
}
return ret;
}
Expand Down

0 comments on commit 202f8de

Please sign in to comment.