[or-cvs] fix memleak in dump_signed_directory_to_string

Roger Dingledine arma at seul.org
Thu Jun 26 23:38:24 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home/arma/work/onion/cvs/src/or

Modified Files:
	main.c 
Log Message:
fix memleak in dump_signed_directory_to_string


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- main.c	25 Jun 2003 07:19:30 -0000	1.74
+++ main.c	26 Jun 2003 23:38:21 -0000	1.75
@@ -739,10 +739,12 @@
     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.



More information about the tor-commits mailing list