mirror of
https://github.com/mirror/wget.git
synced 2025-03-14 20:00:15 +08:00
Correct minor mistakes in syntax. Prevent a leak in http_loop.
This commit is contained in:
parent
40493a76fe
commit
9fd1e97e40
@ -3243,7 +3243,7 @@ Remote file exists.\n\n"));
|
||||
while (!opt.ntry || (count < opt.ntry));
|
||||
|
||||
exit:
|
||||
if (ret == RETROK && local_file)
|
||||
if (ret == RETROK && local_file && !(*local_file))
|
||||
*local_file = xstrdup (hstat.local_file);
|
||||
free_hstat (&hstat);
|
||||
|
||||
|
@ -4,9 +4,10 @@
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "wget.h"
|
||||
|
||||
#include "multi.h"
|
||||
#include "url.h"
|
||||
#include "wget.h"
|
||||
|
||||
int
|
||||
spawn_thread (struct s_thread_ctx *thread_ctx, char * name, int index, int resource)
|
||||
|
@ -1039,7 +1039,7 @@ retrieve_from_file (const char *file, bool html, int *count)
|
||||
for (k = 0; k < num_of_resources; ++k)
|
||||
ranges[j].resources[k] = false;
|
||||
}
|
||||
ranges[k-1].last_byte = file->size -1;
|
||||
ranges[j-1].last_byte = file->size -1;
|
||||
|
||||
sem_init (&retr_sem, 0, 0);
|
||||
j = ranges_covered = 0;
|
||||
@ -1175,6 +1175,7 @@ retrieve_from_file (const char *file, bool html, int *count)
|
||||
free(ranges[j].resources);
|
||||
for (j = 0; j < N_THREADS; ++j)
|
||||
free(files[j]);
|
||||
++i;
|
||||
}
|
||||
|
||||
free(files);
|
||||
|
Loading…
Reference in New Issue
Block a user