]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't leak memory if we get too many create cells
authorRoger Dingledine <arma@torproject.org>
Tue, 28 Jul 2009 02:38:09 +0000 (22:38 -0400)
committerRoger Dingledine <arma@torproject.org>
Tue, 28 Jul 2009 02:38:09 +0000 (22:38 -0400)
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.

ChangeLog
src/or/cpuworker.c

index 59404929cfc1a88b23a21a2b46a75c6ac2914005..fed57aaf4f6f428b335827ae2dc2a4aad39bec66 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@ Changes in version 0.2.1.19 - 2009-07-??
     - Make accessing hidden services on 0.2.1.x work right
       again. Bugfix on 0.2.1.3-alpha; workaround for bug 1038.
 
+  o Minor bugfixes:
+    - Avoid leaking memory 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.
+
 
 Changes in version 0.2.1.18 - 2009-07-24
   o Build fixes:
index 99829e89b5ee6d9a12dc5946189151c08b87b165..219fb9d9bea1245eaf2f18845de28bd70857e770 100644 (file)
@@ -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;
     }