From 391ef5e42cc79982a28aaaf22e9f9b255f6910d3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 10 Jul 2018 20:16:37 -0400 Subject: 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 57de6ab8ed..1500467ec0 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; -- cgit v1.2.3-54-g00ecf