summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-09-06 05:29:05 +0000
committerYang Tse <yangsita@gmail.com>2008-09-06 05:29:05 +0000
commitf33bd94c050b8ff5e8bdfc62f8d626de97543e6e (patch)
tree2ef3d0d3f8d83645892d870284f444a753b77123
parent5d2ace75a361e29b71f039420d9c1f36e6991cd8 (diff)
downloadc-ares-f33bd94c050b8ff5e8bdfc62f8d626de97543e6e.tar.gz
c-ares-f33bd94c050b8ff5e8bdfc62f8d626de97543e6e.tar.bz2
c-ares-f33bd94c050b8ff5e8bdfc62f8d626de97543e6e.zip
remove unnecessary typecasting of malloc()
-rw-r--r--ares_init.c4
-rw-r--r--ares_parse_ptr_reply.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/ares_init.c b/ares_init.c
index 20a23a3..bf4771d 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -675,7 +675,7 @@ DhcpNameServer
{
if (bytes)
{
- line = (char *)malloc(bytes+1);
+ line = malloc(bytes+1);
if (RegQueryValueEx(mykey, NAMESERVER, NULL, &data_type,
(unsigned char *)line, &bytes) ==
ERROR_SUCCESS)
@@ -952,7 +952,7 @@ static int init_by_defaults(ares_channel channel)
size_t len = 64;
int res;
- hostname = (char *)malloc(len);
+ hostname = malloc(len);
if(!hostname) {
rc = ARES_ENOMEM;
goto error;
diff --git a/ares_parse_ptr_reply.c b/ares_parse_ptr_reply.c
index cce6471..8d3d40d 100644
--- a/ares_parse_ptr_reply.c
+++ b/ares_parse_ptr_reply.c
@@ -77,7 +77,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
/* Examine each answer resource record (RR) in turn. */
hostname = NULL;
- aliases = (char **) malloc(8 * sizeof(char *));
+ aliases = malloc(8 * sizeof(char *));
if (!aliases)
{
free(ptrname);