From: Paul Mackerras Date: Sun, 1 Dec 2019 03:30:55 +0000 (+1100) Subject: pppd: Don't free static string X-Git-Tag: ppp-2.4.8~9 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=09f695f09e4ff6905388e15b106cd5669b05965e;p=ppp.git pppd: Don't free static string 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 --- 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) {