[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/release-0.2.3] Fix memory leak in dirvote_create_microdescriptor
commit a9eed33111173d9f7c7fbff74ab1573c4c12e634
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Tue Aug 14 03:06:47 2012 -0400
Fix memory leak in dirvote_create_microdescriptor
Found by George, who gets a cookie.
---
src/or/dirvote.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index dc1ba7e..a7fea0a 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);
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits