summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-08-14 03:06:47 -0400
committerNick Mathewson <nickm@torproject.org>2012-08-14 03:07:17 -0400
commita9eed33111173d9f7c7fbff74ab1573c4c12e634 (patch)
treec7769a854af0db0ccfef5706668cc712bbb0e4d3 /src
parentd3e1e458e11715a9fea2fea2cb228ff925c72851 (diff)
downloadtor-a9eed33111173d9f7c7fbff74ab1573c4c12e634.tar.gz
tor-a9eed33111173d9f7c7fbff74ab1573c4c12e634.zip
Fix memory leak in dirvote_create_microdescriptor
Found by George, who gets a cookie.
Diffstat (limited to 'src')
-rw-r--r--src/or/dirvote.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index dc1ba7e8c4..a7fea0a75e 100644
--- a/src/or/dirvote.c
+++ b/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);