summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-09-28 20:42:24 +0000
committerMike Frysinger <vapier@gentoo.org>2007-09-28 20:42:24 +0000
commit9e5250dae08a1601c3c7c82d9128613d7c22dd84 (patch)
tree0b109afe567e37a93efd994976a63656be17cd1f /libc
parent283dc2c2d0a89fae1f1ac39c51df2e2e48dd616a (diff)
do not check the pointer before freeing it since free(NULL) works just fine
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/resolv.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 6634d594b..749c647fc 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -989,10 +989,8 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
fail:
if (fd != -1)
close(fd);
- if (lookup)
- free(lookup);
- if (packet)
- free(packet);
+ free(lookup);
+ free(packet);
h_errno = NETDB_INTERNAL;
/* Mess with globals while under lock */
if (local_ns != -1) {
@@ -1252,12 +1250,10 @@ int res_query(const char *dname, int class, int type,
if (a.atype == type) { /* CNAME*/
int len = MIN(anslen, i);
memcpy(answer, packet, len);
- if (packet)
- free(packet);
+ free(packet);
return(len);
}
- if (packet)
- free(packet);
+ free(packet);
return i;
}
libc_hidden_def(res_query)