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

[or-cvs] r8971: Fix a small and unlikely memory leak in dirserv.c. I think t (in tor/trunk: . src/or)



Author: nickm
Date: 2006-11-20 11:22:46 -0500 (Mon, 20 Nov 2006)
New Revision: 8971

Modified:
   tor/trunk/
   tor/trunk/src/or/dirserv.c
Log:
 r9345@totoro:  nickm | 2006-11-20 11:22:10 -0500
 Fix a small and unlikely memory leak in dirserv.c. I think this is not the one arma is looking for.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9345] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2006-11-20 16:07:33 UTC (rev 8970)
+++ tor/trunk/src/or/dirserv.c	2006-11-20 16:22:46 UTC (rev 8971)
@@ -91,17 +91,19 @@
   tor_assert(fp);
   tor_assert(list);
 
-  fingerprint = tor_strdup(fp);
+  fingeprint = tor_strdup(fp);
   tor_strstrip(fingerprint, " ");
   if (base16_decode(d, DIGEST_LEN, fingerprint, strlen(fingerprint))) {
     log_warn(LD_DIRSERV, "Couldn't decode fingerprint \"%s\"",
              escaped(fp));
+    tor_free(fingerprint);
     return 0;
   }
 
   if (!strcasecmp(nickname, UNNAMED_ROUTER_NICKNAME)) {
     log_warn(LD_DIRSERV, "Tried to add a mapping for reserved nickname %s",
              UNNAMED_ROUTER_NICKNAME);
+    tor_free(fingerprint);
     return 0;
   }