]> granicus.if.org Git - libevent/commitdiff
FIx another memleak on OOM in evdns
authorGeorge Danchev <danchev@spnet.net>
Thu, 13 Sep 2012 00:12:03 +0000 (20:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 13 Sep 2012 00:12:03 +0000 (20:12 -0400)
evdns.c

diff --git a/evdns.c b/evdns.c
index 7b0fc2bd41a33fa02787fb2fa3a763090c6359ed..9e5a0f2b77690af0f9da85ed6a2dde27fc17544c 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -3159,6 +3159,8 @@ search_request_new(struct evdns_base *base, struct evdns_request *handle,
                handle->search_origname = mm_strdup(name);
                if (handle->search_origname == NULL) {
                        /* XXX Should we dealloc req? If yes, how? */
+                       if (req)
+                               mm_free(req);
                        return NULL;
                }
                handle->search_state = base->global_search_state;