Skip to content

Commit

Permalink
get_url_file_name: never return a NULL string *and* OK
Browse files Browse the repository at this point in the history
Change 987a4a7 assumes that as it simplifies life in the calling
function.

Reported-by: Fabian Keil
  • Loading branch information
bagder committed Oct 9, 2014
1 parent 558814e commit 199b3e4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/tool_operhlp.c
Expand Up @@ -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
Expand Down

0 comments on commit 199b3e4

Please sign in to comment.