summaryrefslogtreecommitdiff
path: root/evdns.c
diff options
context:
space:
mode:
authorJardel Weyrich <jweyrich@gmail.com>2010-12-18 01:07:27 -0200
committerNick Mathewson <nickm@torproject.org>2011-01-07 13:03:31 -0500
commit666b09669187daad7107b340dd7dde50070a2feb (patch)
tree78ad3ded150b73569ed13d000c2f42c4c67daa39 /evdns.c
parent0144886e7e9fdfb5dc630dcf0567846b952994bd (diff)
downloadlibevent-666b09669187daad7107b340dd7dde50070a2feb.tar.gz
Detect and handle more allocation failures.
Diffstat (limited to 'evdns.c')
-rw-r--r--evdns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/evdns.c b/evdns.c
index a1636a14..d085bac8 100644
--- a/evdns.c
+++ b/evdns.c
@@ -3069,6 +3069,10 @@ search_request_new(struct evdns_base *base, struct evdns_request *handle,
}
EVUTIL_ASSERT(handle->search_origname == NULL);
handle->search_origname = mm_strdup(name);
+ if (handle->search_origname == NULL) {
+ /* XXX Should we dealloc req? If yes, how? */
+ return NULL;
+ }
handle->search_state = base->global_search_state;
handle->search_flags = flags;
base->global_search_state->refcount++;