From: Nick Mathewson Date: Tue, 14 Aug 2012 07:06:47 +0000 (-0400) Subject: Fix memory leak in dirvote_create_microdescriptor X-Git-Tag: tor-0.2.3.21-rc~6^2~7^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9eed33111173d9f7c7fbff74ab1573c4c12e634;p=thirdparty%2Ftor.git Fix memory leak in dirvote_create_microdescriptor Found by George, who gets a cookie. --- 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);