[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Explain why we use raw_free with getdelim result.



commit 391ef5e42cc79982a28aaaf22e9f9b255f6910d3
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Jul 10 20:16:37 2018 -0400

    Explain why we use raw_free with getdelim result.
---
 src/feature/dircache/dirserv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/feature/dircache/dirserv.c b/src/feature/dircache/dirserv.c
index 57de6ab8e..1500467ec 100644
--- a/src/feature/dircache/dirserv.c
+++ b/src/feature/dircache/dirserv.c
@@ -2682,8 +2682,10 @@ dirserv_read_measured_bandwidths(const char *from_file,
   rv = 0;
 
  err:
-  if (line)
+  if (line) {
+    // we need to raw_free this buffer because we got it from tor_getdelim()
     raw_free(line);
+  }
   if (fp)
     fclose(fp);
   return rv;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits