r2377 - in branches/1.1: . lib/libvarnish

des at projects.linpro.no des at projects.linpro.no
Wed Jan 23 16:51:12 CET 2008


Author: des
Date: 2008-01-23 16:51:12 +0100 (Wed, 23 Jan 2008)
New Revision: 2377

Modified:
   branches/1.1/
   branches/1.1/lib/libvarnish/vss.c
Log:
Merged revisions 2375 via svnmerge from 
svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache

........
  r2375 | des | 2008-01-23 16:45:03 +0100 (Wed, 23 Jan 2008) | 6 lines
  
  Don't assume that res0 != NULL automatically means i == 0.  I can't say for
  sure (without more coffee) that the assumption is incorrect, but it makes
  the code gratuitously non-transparent.
  
  Coverity Scan (CID:8)
........



Property changes on: branches/1.1
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361
   + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361,2375

Modified: branches/1.1/lib/libvarnish/vss.c
===================================================================
--- branches/1.1/lib/libvarnish/vss.c	2008-01-23 15:50:37 UTC (rev 2376)
+++ branches/1.1/lib/libvarnish/vss.c	2008-01-23 15:51:12 UTC (rev 2377)
@@ -135,8 +135,13 @@
 		fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(ret));
 		return (0);
 	}
-	for (res = res0, i = 0; res != NULL; res = res->ai_next)
-		++i;
+	XXXAN(res0);
+	for (res = res0, i = 0; res != NULL; res = res->ai_next, ++i)
+		/* nothing */ ;
+	if (i == 0) {
+		freeaddrinfo(res0);
+		return (0);
+	}
 	va = calloc(i, sizeof *va);
 	XXXAN(va);
 	*vap = va;




More information about the varnish-commit mailing list