From 09f695f09e4ff6905388e15b106cd5669b05965e Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sun, 1 Dec 2019 14:30:55 +1100 Subject: [PATCH] pppd: Don't free static string MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Commit fcb076c2 ("Various fixes for errors found by coverity static analysis (#109)", 2019-05-06) added statements to free the result returned from get_first_ethernet(). However, the result of get_first_ethernet() is not dynamically allocated, either on Linux or Solaris. Hence this removes the unnecessary (and dangerous) free() statements. Fixes: fcb076c2 ("Various fixes for errors found by coverity static analysis (#109)") Reported-by: Florian Kohnhäuser Signed-off-by: Paul Mackerras --- pppd/multilink.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pppd/multilink.c b/pppd/multilink.c index eb4074d..3aee0bc 100644 --- a/pppd/multilink.c +++ b/pppd/multilink.c @@ -445,13 +445,9 @@ get_default_epdisc(ep) if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { ep->class = EPD_MAC; ep->length = 6; - free(p); return 1; } - if (p) - free(p); - /* see if our hostname corresponds to a reasonable IP address */ hp = gethostbyname(hostname); if (hp != NULL) { -- 2.39.2