[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9380: Fix memory leak on networkstatus 503. (in tor/trunk: . src/or)



Author: nickm
Date: 2007-01-21 21:34:50 -0500 (Sun, 21 Jan 2007)
New Revision: 9380

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/directory.c
Log:
 r9709@catbus:  nickm | 2007-01-21 21:34:03 -0500
 Fix memory leak on networkstatus 503.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9709] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-01-21 18:21:39 UTC (rev 9379)
+++ tor/trunk/ChangeLog	2007-01-22 02:34:50 UTC (rev 9380)
@@ -29,6 +29,8 @@
       buckets go absurdly negative.
     - Detect and reject malformed DNS responses containing circular
       pointer loops.
+    - Fix a memory leak when sending a 503 response for a networkstatus
+      request.
 
   o Minor bugfixes:
     - When computing clock skew from directory HTTP headers, consider what

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2007-01-21 18:21:39 UTC (rev 9379)
+++ tor/trunk/src/or/directory.c	2007-01-22 02:34:50 UTC (rev 9380)
@@ -1689,9 +1689,11 @@
     dlen = dirserv_estimate_data_size(dir_fps, 0, deflated);
     if (global_write_bucket_low(dlen, 2)) {
       log_info(LD_DIRSERV,
-               "Client asked for server descriptors, but we've been "
+               "Client asked for network status lists, but we've been "
                "writing too many bytes lately. Sending 503 Dir busy.");
       write_http_status_line(conn, 503, "Directory busy, try again later");
+      SMARTLIST_FOREACH(dir_fps, char *, cp, tor_free(cp));
+      smartlist_free(dir_fps);
       return 0;
     }