summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: acf5957)
raw | patch | inline | side by side (parent: acf5957)
author | Nick Hengeveld <nickh@reactrix.com> | |
Fri, 18 Nov 2005 19:03:25 +0000 (11:03 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 20 Nov 2005 04:17:25 +0000 (20:17 -0800) |
Clean up memory and file descriptor usage
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index 293269395c90e5e5ec4b3bb06e02e7677da2dac5..f3c92c971e65e9df72fafdab52b4935866a0a794 100644 (file)
--- a/http-push.c
+++ b/http-push.c
} else {
request->state = ABORTED;
free(request->url);
+ request->url = NULL;
}
}
} else {
request->state = ABORTED;
free(request->url);
+ request->url = NULL;
}
}
request->buffer.size = stream.total_out;
request->buffer.posn = 0;
- if (request->url != NULL)
- free(request->url);
request->url = xmalloc(strlen(remote->url) +
strlen(request->lock->token) + 51);
strcpy(request->url, remote->url);
} else {
request->state = ABORTED;
free(request->url);
+ request->url = NULL;
}
}
} else {
request->state = ABORTED;
free(request->url);
+ request->url = NULL;
}
}
if (request->headers != NULL)
curl_slist_free_all(request->headers);
+
+ /* URL is reused for MOVE after PUT */
+ if (request->state != RUN_PUT) {
+ free(request->url);
+ request->url = NULL;
+ }
+
if (request->state == RUN_HEAD) {
if (request->http_code == 404) {
request->state = NEED_PUSH;
entry->next = entry->next->next;
}
- free(request->url);
+ if (request->url != NULL)
+ free(request->url);
free(request);
}
}
} else {
free(url);
+ fclose(indexfile);
return error("Unable to start request");
}