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

[or-cvs] re-order to avoid free-then-use. Thank goodness tor_free() ...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv18900/src/or

Modified Files:
	routerlist.c 
Log Message:
re-order to avoid free-then-use. Thank goodness tor_free() zeroes things.

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.472
retrieving revision 1.473
diff -u -p -d -r1.472 -r1.473
--- routerlist.c	27 Mar 2006 05:12:07 -0000	1.472
+++ routerlist.c	27 Mar 2006 05:27:47 -0000	1.473
@@ -1542,11 +1542,11 @@ router_add_to_routerlist(routerinfo_t *r
         /* Same key, but old */
         log_debug(LD_DIR, "Skipping not-new descriptor for router '%s'",
                   router->nickname);
-        routerlist_insert_old(routerlist, router);
-        *msg = "Router descriptor was not new.";
         /* Only journal this desc if we'll be serving it. */
         if (!from_cache && get_options()->DirPort)
           router_append_to_journal(&router->cache_info);
+        routerlist_insert_old(routerlist, router);
+        *msg = "Router descriptor was not new.";
         return -1;
       } else {
         /* Same key, new. */