[master] 8c36361 Insignificant memory leak.

Poul-Henning Kamp phk at FreeBSD.org
Mon May 5 10:30:00 CEST 2014


commit 8c363610f79f0460a55e2b7f1017921574f30450
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 5 08:29:42 2014 +0000

    Insignificant memory leak.
    
    Spotted by:	Coverity

diff --git a/lib/libvarnish/vss.c b/lib/libvarnish/vss.c
index 2c1d8d6..85b3d67 100644
--- a/lib/libvarnish/vss.c
+++ b/lib/libvarnish/vss.c
@@ -149,9 +149,12 @@ VSS_resolve(const char *addr, const char *port, struct vss_addr ***vap)
 	if (adp == NULL)
 		ret = getaddrinfo(addr, port, &hints, &res0);
 	else {
-		ptst = strtol(adp,NULL,10);
-		if (ptst < 0 || ptst > 65535)
+		ptst = strtol(adp, NULL, 10);
+		if (ptst < 0 || ptst > 65535) {
+			free(hop);
+			free(adp);
 			return(0);
+		}
 		ret = getaddrinfo(hop, adp, &hints, &res0);
 	}
 



More information about the varnish-commit mailing list