aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-05-02 19:13:56 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-05-02 19:13:56 +0000
commit9f72db13c4608d57e8232f355e5b96335d2035f6 (patch)
treede9ff4e3178298dfa9aa8ae42760fd79135ed2f4 /lib/url.c
parentacc4868b78c6fa0c4d2aba6a4155d2a11fb173ee (diff)
Fixed an out of memory handling issue with HTTP pipelines.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 5ebc9e8b9..4b8c53399 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1925,8 +1925,8 @@ static bool IsPipeliningEnabled(struct SessionHandle *handle)
return FALSE;
}
-void Curl_addHandleToPipeline(struct SessionHandle *data,
- struct curl_llist *pipe)
+CURLcode Curl_addHandleToPipeline(struct SessionHandle *data,
+ struct curl_llist *pipe)
{
#ifdef CURLDEBUG
if(!IsPipeliningPossible(data)) {
@@ -1935,7 +1935,9 @@ void Curl_addHandleToPipeline(struct SessionHandle *data,
infof(data, "PIPE when no PIPE supposed!\n");
}
#endif
- Curl_llist_insert_next(pipe, pipe->tail, data);
+ if (!Curl_llist_insert_next(pipe, pipe->tail, data))
+ return CURLE_OUT_OF_MEMORY;
+ return CURLE_OK;
}
@@ -1995,6 +1997,9 @@ static void signalPipeClose(struct curl_llist *pipe)
{
struct curl_llist_element *curr;
+ if (!pipe)
+ return;
+
curr = pipe->head;
while (curr) {
struct curl_llist_element *next = curr->next;