use mm_ allocators

Signed-off-by: Kirill Rodriguez <theoden8@tutamail.com>
Signed-off-by: Kirill Rodriguez <theoden8@gmail.com>
This commit is contained in:
Greg Hazel 2018-06-24 13:33:44 -07:00 committed by Kirill Rodriguez
parent b6a3dc5ccc
commit 8572c273e9
No known key found for this signature in database
GPG Key ID: 2AA85EC2AD7F85EA
2 changed files with 5 additions and 5 deletions

View File

@ -5383,9 +5383,9 @@ evdns_cache_write(struct evdns_base *dns_base, char *nodename, struct evutil_add
log(EVDNS_LOG_DEBUG, "Ejecting old cache for %s", nodename);
evdns_cache_free(cache);
}
cache = mm_malloc(sizeof(struct evdns_cache));
cache = mm_calloc(1, sizeof(struct evdns_cache));
cache->base = dns_base;
cache->name = strdup(nodename);
cache->name = mm_strdup(nodename);
cache->ai = evutil_dup_addrinfo_(res);
SPLAY_INSERT(evdns_tree, &cache->base->cache_root, cache);
evtimer_assign(&cache->ev_timeout, dns_base->event_base, evdns_ttl_expired, cache);
@ -5788,7 +5788,7 @@ evdns_getaddrinfo(struct evdns_base *dns_base,
data->user_cb = cb;
data->user_data = arg;
data->evdns_base = dns_base;
data->nodename = strdup(nodename);
data->nodename = mm_strdup(nodename);
want_cname = (hints.ai_flags & EVUTIL_AI_CANONNAME);

View File

@ -1785,10 +1785,10 @@ evutil_dup_addrinfo_(struct evutil_addrinfo *ai)
struct evutil_addrinfo *prev = NULL;
for (; ai; ai = ai->ai_next) {
int len = sizeof(struct evutil_addrinfo) + ai->ai_addrlen;
struct evutil_addrinfo *n = calloc(1, len);
struct evutil_addrinfo *n = mm_calloc(1, len);
memcpy(n, ai, len);
if (ai->ai_canonname) {
n->ai_canonname = strdup(ai->ai_canonname);
n->ai_canonname = mm_strdup(ai->ai_canonname);
}
n->ai_addr = (struct sockaddr*)(((char*)n) + sizeof(struct evutil_addrinfo));
if (!first) {