diff options
author | Roger Dingledine <arma@torproject.org> | 2009-07-27 22:38:09 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2009-07-27 22:38:09 -0400 |
commit | 0a4e2397c0f184a1717ec7475381f9d12f189cb7 (patch) | |
tree | b9aa6a44519fce987665a0561a995addd9d9ad17 /src/or | |
parent | 2b63fa40e8349e0e6c40d0660d9df5b0ba73937e (diff) | |
download | tor-0a4e2397c0f184a1717ec7475381f9d12f189cb7.tar.gz tor-0a4e2397c0f184a1717ec7475381f9d12f189cb7.zip |
Don't leak memory if we get too many create cells
Specifically, every time we get a create cell but we have so many already
queued that we refuse it.
Bugfix on 0.2.0.19-alpha; fixes bug 1034. Reported by BarkerJr.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/cpuworker.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 99829e89b5..219fb9d9be 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -444,8 +444,10 @@ assign_onionskin_to_cpuworker(connection_t *cpuworker, if (1) { if (num_cpuworkers_busy == num_cpuworkers) { log_debug(LD_OR,"No idle cpuworkers. Queuing."); - if (onion_pending_add(circ, onionskin) < 0) + if (onion_pending_add(circ, onionskin) < 0) { + tor_free(onionskin); return -1; + } return 0; } |