Browse Source

resolv: fix res_close not to hang with ipv6

Timo Teräs writes:
The memory release loop is missing an obvious counter increment.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 13 years ago
parent
commit
c277cc3c99
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/inet/resolv.c

+ 1 - 1
libc/inet/resolv.c

@@ -3008,7 +3008,7 @@ void res_close(void)
 		char *p1 = (char*) &(_res.nsaddr_list[0]);
 		int m = 0;
 		/* free nsaddrs[m] if they do not point to nsaddr_list[x] */
-		while (m < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
+		while (m++ < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
 			char *p2 = (char*)(_res._u._ext.nsaddrs[m]);
 			if (p2 < p1 || (p2 - p1) > sizeof(_res.nsaddr_list))
 				free(p2);