]> granicus.if.org Git - libevent/commitdiff
evdns: bufferevent_setcb before bufferevent_free is redundant
authorAzat Khuzhin <azat@libevent.org>
Sun, 24 May 2020 23:35:55 +0000 (02:35 +0300)
committerAzat Khuzhin <azat@libevent.org>
Mon, 25 May 2020 00:12:20 +0000 (03:12 +0300)
evdns.c

diff --git a/evdns.c b/evdns.c
index c30c518864ad9b0e50102243d098a760c17d6b92..75bbbb3875e5ead167a148e6eb8f68c68e462044 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -531,7 +531,6 @@ evdns_tcp_disconnect(struct tcp_connection *conn)
        conn->state = TS_DISCONNECTED;
        conn->awaiting_packet_size = 0;
        if (conn->bev) {
-               bufferevent_setcb(conn->bev, NULL, NULL, NULL, NULL);
                bufferevent_free(conn->bev);
                conn->bev = NULL;
        }
@@ -2137,10 +2136,8 @@ incoming_conn_cb(struct evconnlistener *listener, evutil_socket_t fd,
 
        return;
 error:
-       if (bev) {
-               bufferevent_setcb(bev, NULL, NULL, NULL, NULL);
+       if (bev)
                bufferevent_free(bev);
-       }
        return;
 }