From bce12d59dd35698997f889b647c792237fce5680 Mon Sep 17 00:00:00 2001 From: Leonid Evdokimov Date: Thu, 2 Dec 2010 23:30:21 +0200 Subject: [PATCH] Fix bug introduced in 45cab3. --- redsocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redsocks.c b/redsocks.c index 6b6a1aa..cd62864 100644 --- a/redsocks.c +++ b/redsocks.c @@ -452,7 +452,8 @@ int redsocks_write_helper_ex_plain( if (!buff) goto fail; - len = bufferevent_write_buffer(client->relay, buff); + assert(!client || buffev == client->relay); + len = bufferevent_write_buffer(buffev, buff); if (len < 0) { if (client) redsocks_log_errno(client, LOG_ERR, "bufferevent_write_buffer");