summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-04-13 19:38:40 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-04-13 19:38:40 +0200
commitd37cda884e573638aa3fafcb7505d733cf8d9eae (patch)
tree176c42722914aa2d570f7bf4969baa2c273eea02 /libc
parent7da4d1e7553a766f2ddc6a9a7d36423c1cf68a80 (diff)
resolv: really fix res_close not to hang with ipv6
Fix goof in previous commit. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/resolv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 05a1335e5..021d5bf5d 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -3008,8 +3008,8 @@ 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)) {
- char *p2 = (char*)(_res._u._ext.nsaddrs[m]);
+ 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);
}