summaryrefslogtreecommitdiff
path: root/bufferevent_filter.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-11-09 11:43:47 -0500
committerNick Mathewson <nickm@torproject.org>2010-11-09 11:43:47 -0500
commitfc7b1b005c906d720e03975224ae809974402f55 (patch)
tree2a9e18e586feb940288290518214fe6047af72fb /bufferevent_filter.c
parent5c8a59e8867a45b5791e45a548a73eb135a6a3ea (diff)
downloadlibevent-fc7b1b005c906d720e03975224ae809974402f55.tar.gz
When closing a filtering bufferevent, clear callbacks on the underlying bufferevent
Previously, if BEV_OPT_CLOSE_ON_FREE wasn't set on a bufferevent_filter or a filtering bufferevent_openssl, when we went to free the filtering bufferevent, we'd leave the underlying bufferevent unchanged. That's not so good, since the callbacks are set to activate stuff in the filtering bufferevent that we're about to free. Instead, set all the callbacks to NULL.
Diffstat (limited to 'bufferevent_filter.c')
-rw-r--r--bufferevent_filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bufferevent_filter.c b/bufferevent_filter.c
index 0dbc0973..0608f4a4 100644
--- a/bufferevent_filter.c
+++ b/bufferevent_filter.c
@@ -233,6 +233,8 @@ be_filter_destruct(struct bufferevent *bev)
}
} else {
if (bevf->underlying) {
+ bufferevent_setcb(bevf->underlying,
+ NULL, NULL, NULL, NULL);
bufferevent_unsuspend_read(bevf->underlying,
BEV_SUSPEND_FILT_READ);
}