]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid mmap leak if we get a consensus diff we can't use.
authorNick Mathewson <nickm@torproject.org>
Fri, 2 Nov 2018 17:30:55 +0000 (13:30 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 2 Nov 2018 17:30:55 +0000 (13:30 -0400)
Fixes CID 1440819; bug not in any released Tor.

src/feature/dirclient/dirclient.c

index 705bf75e5cefd4a45fe30541616815ce89096e0d..cd88fa5ebff60e0f589dfd775c614ae2d2951f95 100644 (file)
@@ -2221,6 +2221,7 @@ handle_response_fetch_consensus(dir_connection_t *conn,
     if (!consensus_body) {
       log_warn(LD_DIR, "Received a consensus diff, but we can't find "
                "any %s-flavored consensus in our current cache.",flavname);
+      tor_munmap_file(mapped_consensus);
       networkstatus_consensus_download_failed(0, flavname);
       // XXXX if this happens too much, see below
       return -1;