Handle calloc failure in evdns. (Found by Dave Hart)

This commit is contained in:
Nick Mathewson 2011-04-21 17:11:41 -04:00
parent dde3b73963
commit 364291e9a9

View File

@ -794,6 +794,12 @@ reply_schedule_callback(struct request *const req, u32 ttl, u32 err, struct repl
{
struct deferred_reply_callback *d = mm_calloc(1, sizeof(*d));
if (!d) {
event_warn("%s: Couldn't allocate space for deferred callback.",
__func__);
return;
}
ASSERT_LOCKED(req->base);
d->request_type = req->request_type;