[PATCH 2/9] http-fetch: Fix object list corruption in fill_active_slots().
- From
- Mark Wooding <mdw@distorted.org.uk>
- Date
- Feb 1, 2006, 11:44 UTC
- Message-ID
- <20060201114428.5042.53434.stgit@metalzone.distorted.org.uk>
- In-Reply-To
- <20060201112822.5042.41256.stgit@metalzone.distorted.org.uk>
From: Mark Wooding <mdw@distorted.org.uk>
In fill_active_slots() -- if we find an object which has already arrived, say as part of a pack, /don't/ remove it from the list. It's already been prefetched and someone will ask for it later. Just label it as done and carry blithely on. (As it was, the code would dereference a freed object to continue through the list anyway.)
Signed-off-by: Mark Wooding <mdw@distorted.org.uk> ---
http-fetch.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/http-fetch.c b/http-fetch.c index 4b1b62d..b1ee836 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -312,7 +312,7 @@ void fill_active_slots(void) while (active_requests < max_requests && obj_req != NULL) { if (obj_req->state == WAITING) { if (has_sha1_file(obj_req->sha1)) - release_object_request(obj_req); + obj_req->state = COMPLETE; else start_object_request(obj_req); curl_multi_perform(curlm, &num_transfers);