From 398699c438889582d354b9e5411fd1201472d3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Sat, 29 Aug 2015 22:35:29 +0200 Subject: [PATCH] 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'. --- src/http.c | 2 +- src/main.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/http.c b/src/http.c index e96cad79..406d3296 100644 --- a/src/http.c +++ b/src/http.c @@ -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) { diff --git a/src/main.c b/src/main.c index 7134a2f1..20fdc2be 100644 --- a/src/main.c +++ b/src/main.c @@ -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)