aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-07-09 18:33:35 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-07-09 18:33:35 +0000
commitd4b253ba3ec87e1d703910bdb278d142e6e6abf8 (patch)
treee910ce69628d5e83ad32b7fdb76c59a6df826e1d /lib
parentaee7fc118b72c4901fb4414f68f5f77537518949 (diff)
Fixed an OOM handling problem that cause test 11 to fail the torture test.
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index b45be0a56..11202af80 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -2398,17 +2398,21 @@ CURLcode Curl_perform(struct SessionHandle *data)
if(data->req.newurl) {
follow = FOLLOW_REDIR;
newurl = strdup(data->req.newurl);
+ if (!newurl)
+ res = CURLE_OUT_OF_MEMORY;
}
else if(data->req.location) {
follow = FOLLOW_FAKE;
newurl = strdup(data->req.location);
+ if (!newurl)
+ res = CURLE_OUT_OF_MEMORY;
}
}
/* in the above cases where 'newurl' gets assigned, we have a fresh
* allocated memory pointed to */
}
- else {
+ if(res != CURLE_OK) {
/* The transfer phase returned error, we mark the connection to get
* closed to prevent being re-used. This is becasue we can't
* possibly know if the connection is in a good shape or not now. */