r5587 - trunk/varnish-cache/lib/libvarnish

phk at varnish-cache.org phk at varnish-cache.org
Mon Nov 22 12:12:45 CET 2010


Author: phk
Date: 2010-11-22 12:12:45 +0100 (Mon, 22 Nov 2010)
New Revision: 5587

Modified:
   trunk/varnish-cache/lib/libvarnish/vss.c
Log:
Fix a FlexeLint warning



Modified: trunk/varnish-cache/lib/libvarnish/vss.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/vss.c	2010-11-22 11:02:45 UTC (rev 5586)
+++ trunk/varnish-cache/lib/libvarnish/vss.c	2010-11-22 11:12:45 UTC (rev 5587)
@@ -144,6 +144,7 @@
 	int i, ret;
 	char *adp, *hop;
 
+	*vap = NULL;
 	memset(&hints, 0, sizeof hints);
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_flags = AI_PASSIVE;
@@ -284,14 +285,12 @@
 int
 VSS_open(const char *str, double tmo)
 {
-	int retval;
+	int retval = -1;
 	int nvaddr, n, i;
 	struct vss_addr **vaddr;
 	struct pollfd pfd;
 
 	nvaddr = VSS_resolve(str, NULL, &vaddr);
-	if (nvaddr <= 0)
-		return (-1);
 	for (n = 0; n < nvaddr; n++) {
 		retval = VSS_connect(vaddr[n], tmo != 0.0);
 		if (retval >= 0 && tmo != 0.0) {




More information about the varnish-commit mailing list