]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/multilink.c
Various fixes for errors found by coverity static analysis (#109)
[ppp.git] / pppd / multilink.c
index 135cab0b42ad419d1c4297240cf464ca6b83b14f..c49c4465ced8f1b65d3be54c35b71c000c0ac33b 100644 (file)
@@ -445,9 +445,13 @@ 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) {