mirror of
https://github.com/mirror/wget.git
synced 2025-01-07 19:00:30 +08:00
Fix two leaks foudn by Coverity
* src/http.c (gethttp): Do not leak 'message'. * src/main.c (format_and_print_line): Do not leak 'line_dup'.
This commit is contained in:
parent
d3504b9261
commit
398699c438
@ -3168,7 +3168,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
||||
resp = resp_new (head);
|
||||
|
||||
/* Check for status line. */
|
||||
message = NULL;
|
||||
xfree(message);
|
||||
statcode = resp_status (resp, &message);
|
||||
if (statcode < 0)
|
||||
{
|
||||
|
@ -1000,7 +1000,10 @@ format_and_print_line (const char *prefix, const char *line,
|
||||
if (remaining_chars <= (int) strlen (token))
|
||||
{
|
||||
if (printf ("\n%*c", TABULATION, ' ') < 0)
|
||||
return -1;
|
||||
{
|
||||
xfree (line_dup);
|
||||
return -1;
|
||||
}
|
||||
remaining_chars = line_length - TABULATION;
|
||||
}
|
||||
if (printf ("%s ", token) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user