diff options
author | Yu Jiung <jiung.yu@samsung.com> | 2016-11-09 11:18:45 +0900 |
---|---|---|
committer | Yu Jiung <jiung.yu@samsung.com> | 2016-11-09 11:18:55 +0900 |
commit | eb886f120599b2a184db20b527db6dfdfcb7852e (patch) | |
tree | b49d8075742c4a27b237fa183cb68670e421d398 /ares_send.c | |
parent | b6627e2c19506bd30328969ea8aab73fa0945f36 (diff) | |
download | c-ares-eb886f120599b2a184db20b527db6dfdfcb7852e.tar.gz c-ares-eb886f120599b2a184db20b527db6dfdfcb7852e.tar.bz2 c-ares-eb886f120599b2a184db20b527db6dfdfcb7852e.zip |
Imported Upstream version 1.11.0upstream/1.11.0
Change-Id: I238c24b75a10aa902d9bc4076ed68b76b5e2a750
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; } |