diff options
Diffstat (limited to 'ares_send.c')
-rw-r--r-- | ares_send.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ares_send.c b/ares_send.c index 1a450b1..88c0035 100644 --- a/ares_send.c +++ b/ares_send.c @@ -47,25 +47,25 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, } /* Allocate space for query and allocated fields. */ - query = malloc(sizeof(struct query)); + query = ares_malloc(sizeof(struct query)); if (!query) { callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } - query->tcpbuf = malloc(qlen + 2); + query->tcpbuf = ares_malloc(qlen + 2); if (!query->tcpbuf) { - free(query); + ares_free(query); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } - query->server_info = malloc(channel->nservers * - sizeof(query->server_info[0])); + query->server_info = ares_malloc(channel->nservers * + sizeof(query->server_info[0])); if (!query->server_info) { - free(query->tcpbuf); - free(query); + ares_free(query->tcpbuf); + ares_free(query); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } |