Skip to content

Commit e60d9ef

Browse files
committed
fix valgrind errors
1 parent 1d0603d commit e60d9ef

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

opt/redis_valgrind.sup

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,11 @@
184184
...
185185
fun:_dl_catch_exception
186186
...
187-
}
187+
}
188+
189+
{
190+
<ignore_torch_cond_jump>
191+
Memcheck:Cond
192+
...
193+
obj:*/libtorch_cpu.so*
194+
}

src/redisai.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)