Browse Source

Explain why we use raw_free with getdelim result.

Nick Mathewson 5 years ago
parent
commit
391ef5e42c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/feature/dircache/dirserv.c

+ 3 - 1
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;