diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-04-12 09:39:20 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-04-12 09:39:59 +0200 |
commit | c277cc3c99a2499183fed84cdeb25c45a06f141d (patch) | |
tree | 7a8ee86a94b4021e1a6562415c0ac4cd546ff5c2 /libc/inet/resolv.c | |
parent | feb7ce46ef24f74ebf0235f10127bd49f0c7e675 (diff) |
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>
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r-- | libc/inet/resolv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 47bab7519..05a1335e5 100644 --- a/libc/inet/resolv.c +++ b/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); |