aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-12-07 11:08:10 +0100
committerDan Fandrich <dan@coneharvesters.com>2014-12-07 11:09:14 +0100
commite05de4f46db67696376f16b1627a2b3701314b20 (patch)
tree5cf538576dbb5e9b17b4dbe2faadb1a8b9e8784c /src
parentf5e9c636e83b8808d6b278fbcd5e1a082b1403c5 (diff)
get_url_file_name: Fixed crash on OOM on debug build
This caused a null-pointer dereference which caused a few dozen torture tests to fail.
Diffstat (limited to 'src')
-rw-r--r--src/tool_operhlp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c
index 7a6ed2015..abf949617 100644
--- a/src/tool_operhlp.c
+++ b/src/tool_operhlp.c
@@ -164,6 +164,8 @@ CURLcode get_url_file_name(char **filename, const char *url)
Curl_safefree(*filename);
*filename = strdup(buffer); /* clone the buffer */
curl_free(tdir);
+ if(!*filename)
+ return CURLE_OUT_OF_MEMORY;
}
}
#endif