diff --git a/src/http.c b/src/http.c index 16edf461..0ff4572a 100644 --- a/src/http.c +++ b/src/http.c @@ -4244,19 +4244,19 @@ http_loop (const struct url *u, struct url *original_url, char **newloc, struct stat st; bool send_head_first = true; bool force_full_retrieve = false; - + bool return_local_file; /* If we are writing to a WARC file: always retrieve the whole file. */ if (opt.warc_filename != NULL) force_full_retrieve = true; - /* Assert that no value for *LOCAL_FILE was passed. */ assert (local_file == NULL || *local_file == NULL); /* Set LOCAL_FILE parameter. */ - if (local_file && opt.output_document) - *local_file = HYPHENP (opt.output_document) ? NULL : xstrdup (opt.output_document); + return_local_file = local_file && opt.output_document && !HYPHENP (opt.output_document); + +// return_local_file = (local_file && opt.output_document && !HYPHENP (opt.output_document)); /* Reset NEWLOC parameter. */ *newloc = NULL; @@ -4871,7 +4871,6 @@ Remote file exists.\n\n")); exit: if ((ret == RETROK || opt.content_on_error) && local_file) { - xfree (*local_file); /* Bugfix: Prevent SIGSEGV when hstat.local_file was left NULL (i.e. due to opt.content_disposition). */ if (hstat.local_file)