diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-29 12:21:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-29 12:21:57 -0400 |
commit | b82e166bec5fcc468424af1ff71e2e753ac534a2 (patch) | |
tree | ecbd7adac86551702387b0a2c42a7d3da50bb13e /src | |
parent | 4144b4552b00c25eba9be7a959aa75c1efbe4a18 (diff) | |
download | tor-b82e166bec5fcc468424af1ff71e2e753ac534a2.tar.gz tor-b82e166bec5fcc468424af1ff71e2e753ac534a2.zip |
restore the sensible part of ac268a83408e1450544db2f23f364dfa3
We don't want to call event_del() postfork, if cpuworkers are
multiprocess.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 6d205d143c..aedb29d4e4 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -553,10 +553,17 @@ connection_free_(connection_t *conn) tor_free(control_conn->incoming_cmd); } +#ifdef TOR_IS_MULTITHREADED /* Probably already freed by connection_free. */ + /* We don't do these frees on the multiprocess case, since in that case we + * don't want to call event_del() postfork or it's likely to mess up. + * Multiprocess builds are deprecated, so let's just have a one-time memory + * leak here. + */ tor_event_free(conn->read_event); tor_event_free(conn->write_event); conn->read_event = conn->write_event = NULL; +#endif IF_HAS_BUFFEREVENT(conn, { /* This was a workaround to handle bugs in some old versions of libevent * where callbacks can occur after calling bufferevent_free(). Setting |