summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-06-26 23:38:21 +0000
committerRoger Dingledine <arma@torproject.org>2003-06-26 23:38:21 +0000
commit35a37ec3f50dcb34d80443581ba6aabaa51371a3 (patch)
treeeac46298b3772e5b0a4533d273d16fbd34f77e0b /src
parent66213fb49054a859c0d62dd71dc4238205f5c1f4 (diff)
downloadtor-35a37ec3f50dcb34d80443581ba6aabaa51371a3.tar.gz
tor-35a37ec3f50dcb34d80443581ba6aabaa51371a3.zip
fix memleak in dump_signed_directory_to_string
svn:r358
Diffstat (limited to 'src')
-rw-r--r--src/or/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 7f3f041020..0ee26e4b9d 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -739,10 +739,12 @@ dump_signed_directory_to_string_impl(char *s, int maxlen, directory_t *dir,
if(written < 0) {
log(LOG_ERR,"dump_signed_directory_to_string(): tried to exceed string length.");
cp[maxlen-1] = 0; /* make sure it's null terminated */
+ free(dir->routers);
return -1;
}
cp += written;
}
+ free(dir->routers); /* not needed anymore */
/* These multiple strlen calls are inefficient, but dwarfed by the RSA
signature.