From 199b3e46f9b9b62238388bb49bdd83303d26437f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 9 Oct 2014 16:37:11 +0200 Subject: get_url_file_name: never return a NULL string *and* OK Change 987a4a73 assumes that as it simplifies life in the calling function. Reported-by: Fabian Keil --- src/tool_operhlp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/tool_operhlp.c') diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index 15eefabe7..4a13cf186 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -143,11 +143,9 @@ CURLcode get_url_file_name(char **filename, const char *url) if(pc) { /* duplicate the string beyond the slash */ pc++; - if(*pc) { - *filename = strdup(pc); - if(!*filename) - return CURLE_OUT_OF_MEMORY; - } + *filename = strdup(pc); + if(!*filename) + return CURLE_OUT_OF_MEMORY; } /* in case we built debug enabled, we allow an environment variable -- cgit v1.2.3