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:
Tim Rühsen 2015-08-29 22:35:29 +02:00
parent d3504b9261
commit 398699c438
2 changed files with 5 additions and 2 deletions

View File

@ -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)
{

View File

@ -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)