Explorar o código

Explain why we use raw_free with getdelim result.

Nick Mathewson %!s(int64=5) %!d(string=hai) anos
pai
achega
391ef5e42c
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;