mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
fix memleak in dump_signed_directory_to_string
svn:r358
This commit is contained in:
parent
66213fb490
commit
35a37ec3f5
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user