diff --git a/src/functions.c b/src/functions.c index 3f67816e91..916d8fd622 100644 --- a/src/functions.c +++ b/src/functions.c @@ -186,12 +186,16 @@ void functionsLibCtxClearCurrent(int async) { } /* Free the given functions ctx */ -void functionsLibCtxFreeGeneric(functionsLibCtx *functions_lib_ctx, int async) { +static void functionsLibCtxFreeGeneric(functionsLibCtx *functions_lib_ctx, int async) { if (async) { freeFunctionsAsync(functions_lib_ctx); - return; + } else { + functionsLibCtxFree(functions_lib_ctx); } +} +/* Free the given functions ctx */ +void functionsLibCtxFree(functionsLibCtx *functions_lib_ctx) { functionsLibCtxClear(functions_lib_ctx); dictRelease(functions_lib_ctx->functions); dictRelease(functions_lib_ctx->libraries); @@ -199,11 +203,6 @@ void functionsLibCtxFreeGeneric(functionsLibCtx *functions_lib_ctx, int async) { zfree(functions_lib_ctx); } -/* Free the given functions ctx */ -void functionsLibCtxFree(functionsLibCtx *functions_lib_ctx) { - functionsLibCtxFreeGeneric(functions_lib_ctx, 0); -} - /* Swap the current functions ctx with the given one. * Free the old functions ctx. */ void functionsLibCtxSwapWithCurrent(functionsLibCtx *new_lib_ctx, int async) {