Skip to content

fix invalid access after freeing next_item #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/background_workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ static RedisAI_RunInfo **_BGThread_BatchOperations(RunQueueInfo *run_queue_info,

// If all previous checks pass, then keep track of the item
// in the list of evicted items
queueItem *tmp = queueNext(next_item);
queueItem *evicted = queueEvict(run_queue_info->run_queue, next_item);
RedisModule_Free(evicted);
next_item = tmp;
batch_rinfo = array_append(batch_rinfo, next_rinfo);

// Update the batchsize and go to the next item to see if
Expand Down Expand Up @@ -258,7 +260,6 @@ static RedisAI_RunInfo **_BGThread_BatchOperations(RunQueueInfo *run_queue_info,
break;
}
}
next_item = queueNext(next_item);
}
return batch_rinfo;
}
Expand Down