diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-06-06 10:56:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-06-06 10:56:17 -0700 |
commit | 86079872238041fa0e2aa6b8a94f7881f88e4316 (patch) | |
tree | cdd1a7dea602dd407f1dd8f9cfc848471dc701d4 | |
parent | 99ddd24ad7753458043016bf1b7d88915aaeb396 (diff) | |
parent | 16493eb0d0da26f80286b39c7b6900e261744afa (diff) | |
download | git-86079872238041fa0e2aa6b8a94f7881f88e4316.tar.gz |
Merge branch 'rc/maint-http-local-slot-fix' into rc/http-push
* rc/maint-http-local-slot-fix:
http*: cleanup slot->local after fclose
-rw-r--r-- | http-push.c | 6 | ||||
-rw-r--r-- | http-walker.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/http-push.c b/http-push.c index 29e8ebfebb..a4ff7be217 100644 --- a/http-push.c +++ b/http-push.c @@ -724,9 +724,11 @@ static void finish_request(struct transfer_request *request) struct stat st; struct packed_git *target; struct packed_git **lst; + struct active_request_slot *slot; request->curl_result = request->slot->curl_result; request->http_code = request->slot->http_code; + slot = request->slot; request->slot = NULL; /* Keep locks active */ @@ -823,6 +825,7 @@ static void finish_request(struct transfer_request *request) fclose(request->local_stream); request->local_stream = NULL; + slot->local = NULL; if (!move_temp_to_file(request->tmpfile, request->filename)) { target = (struct packed_git *)request->userData; @@ -1024,17 +1027,20 @@ static int fetch_index(unsigned char *sha1) if (results.curl_result != CURLE_OK) { free(url); fclose(indexfile); + slot->local = NULL; return error("Unable to get pack index %s\n%s", url, curl_errorstr); } } else { free(url); fclose(indexfile); + slot->local = NULL; return error("Unable to start request"); } free(url); fclose(indexfile); + slot->local = NULL; return move_temp_to_file(tmpfile, filename); } diff --git a/http-walker.c b/http-walker.c index 7321ccc9fe..9377851925 100644 --- a/http-walker.c +++ b/http-walker.c @@ -418,15 +418,18 @@ static int fetch_index(struct walker *walker, struct alt_base *repo, unsigned ch run_active_slot(slot); if (results.curl_result != CURLE_OK) { fclose(indexfile); + slot->local = NULL; return error("Unable to get pack index %s\n%s", url, curl_errorstr); } } else { fclose(indexfile); + slot->local = NULL; return error("Unable to start request"); } fclose(indexfile); + slot->local = NULL; return move_temp_to_file(tmpfile, filename); } @@ -776,16 +779,19 @@ static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned cha run_active_slot(slot); if (results.curl_result != CURLE_OK) { fclose(packfile); + slot->local = NULL; return error("Unable to get pack file %s\n%s", url, curl_errorstr); } } else { fclose(packfile); + slot->local = NULL; return error("Unable to start request"); } target->pack_size = ftell(packfile); fclose(packfile); + slot->local = NULL; ret = move_temp_to_file(tmpfile, filename); if (ret) |