@@ -739,6 +739,7 @@ int RedisAI_ScriptStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
739739 for (size_t i = 0 ; i < nEntryPoints ; i ++ ) {
740740 const char * entryPoint ;
741741 if (AC_GetString (& ac , & entryPoint , NULL , 0 ) != AC_OK ) {
742+ array_free (entryPoints );
742743 return RedisModule_ReplyWithError (
743744 ctx , "ERR Insufficient arguments, missing script entry points" );
744745 }
@@ -753,6 +754,7 @@ int RedisAI_ScriptStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
753754 }
754755
755756 if (scriptdef == NULL ) {
757+ array_free (entryPoints );
756758 return RedisModule_ReplyWithError (ctx , "ERR Insufficient arguments, missing script SOURCE" );
757759 }
758760
@@ -766,6 +768,7 @@ int RedisAI_ScriptStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
766768 "Backend TORCH not loaded, will try loading default backend" );
767769 int ret = RAI_LoadDefaultBackend (ctx , RAI_BACKEND_TORCH );
768770 if (ret == REDISMODULE_ERR ) {
771+ array_free (entryPoints );
769772 RedisModule_Log (ctx , "warning" , "Could not load TORCH default backend" );
770773 int ret = RedisModule_ReplyWithError (ctx , "ERR Could not load backend" );
771774 RAI_ClearError (& err );
0 commit comments