ソースを参照

Fix memory leak in dirvote_create_microdescriptor

Found by George, who gets a cookie.
Nick Mathewson 13 年 前
コミット
a9eed33111
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/or/dirvote.c

+ 2 - 1
src/or/dirvote.c

@@ -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);