From e05de4f46db67696376f16b1627a2b3701314b20 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sun, 7 Dec 2014 11:08:10 +0100 Subject: [PATCH] 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. --- src/tool_operhlp.c | 2 ++ 1 file changed, 2 insertions(+) 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