mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
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
This commit is contained in:
parent
558814e16d
commit
199b3e46f9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user