]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in dirvote_create_microdescriptor
authorNick Mathewson <nickm@torproject.org>
Tue, 14 Aug 2012 07:06:47 +0000 (03:06 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Aug 2012 07:07:17 +0000 (03:07 -0400)
Found by George, who gets a cookie.

src/or/dirvote.c

index dc1ba7e8c4ccf54c82d634350e28e1c9db437b1f..a7fea0a75e34acea438a4aa125bc2a9d66c81242 100644 (file)
@@ -3515,7 +3515,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri)
   char *key = NULL, *summary = NULL, *family = NULL;
   size_t keylen;
   smartlist_t *chunks = smartlist_new();
-  char *output;
+  char *output = NULL;
 
   if (crypto_pk_write_public_key_to_string(ri->onion_pkey, &key, &keylen)<0)
     goto done;
@@ -3547,6 +3547,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri)
   }
 
  done:
+  tor_free(output);
   tor_free(key);
   tor_free(summary);
   tor_free(family);