Skip to content

Commit ec613bf

Browse files
committed
Fix another leak: after we execute dag op(s), we always need to free to queue item(s) (even if the DAG is not finished), since we reinsert the item(s) to the queue (and reallocate memory).
1 parent c23cd25 commit ec613bf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/background_workers.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,8 @@ void *RedisAI_Run_ThreadMain(void *arg) {
494494

495495
// If there's nothing else to do for the DAG in the current worker or if an error
496496
// occurred in any worker, we just move on
497-
if (device_complete == 1 || device_complete_after_run == 1 || do_unblock == 1 ||
498-
run_error == 1) {
499-
for (long long i = 0; i < array_len(evicted_items); i++) {
500-
RedisModule_Free(evicted_items[i]);
501-
}
497+
for (long long i = 0; i < array_len(evicted_items); i++) {
498+
RedisModule_Free(evicted_items[i]);
502499
}
503500
run_queue_len = queueLength(run_queue_info->run_queue);
504501
}

0 commit comments

Comments
 (0)