@@ -739,6 +739,7 @@ int RedisAI_ScriptStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
739
739
for (size_t i = 0 ; i < nEntryPoints ; i ++ ) {
740
740
const char * entryPoint ;
741
741
if (AC_GetString (& ac , & entryPoint , NULL , 0 ) != AC_OK ) {
742
+ array_free (entryPoints );
742
743
return RedisModule_ReplyWithError (
743
744
ctx , "ERR Insufficient arguments, missing script entry points" );
744
745
}
@@ -753,6 +754,7 @@ int RedisAI_ScriptStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
753
754
}
754
755
755
756
if (scriptdef == NULL ) {
757
+ array_free (entryPoints );
756
758
return RedisModule_ReplyWithError (ctx , "ERR Insufficient arguments, missing script SOURCE" );
757
759
}
758
760
@@ -766,6 +768,7 @@ int RedisAI_ScriptStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **ar
766
768
"Backend TORCH not loaded, will try loading default backend" );
767
769
int ret = RAI_LoadDefaultBackend (ctx , RAI_BACKEND_TORCH );
768
770
if (ret == REDISMODULE_ERR ) {
771
+ array_free (entryPoints );
769
772
RedisModule_Log (ctx , "warning" , "Could not load TORCH default backend" );
770
773
int ret = RedisModule_ReplyWithError (ctx , "ERR Could not load backend" );
771
774
RAI_ClearError (& err );
0 commit comments