Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): fix memory leak for lstat cache in -DC...



details:   https://anonhg.NetBSD.org/src/rev/589982a3f5a4
branches:  trunk
changeset: 946538:589982a3f5a4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 30 18:49:58 2020 +0000

description:
make(1): fix memory leak for lstat cache in -DCLEANUP mode

diffstat:

 usr.bin/make/dir.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 067d061e50d8 -r 589982a3f5a4 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Mon Nov 30 18:32:49 2020 +0000
+++ b/usr.bin/make/dir.c        Mon Nov 30 18:49:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.242 2020/11/29 21:50:50 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.243 2020/11/30 18:49:58 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.242 2020/11/29 21:50:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.243 2020/11/30 18:49:58 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -226,15 +226,13 @@
         * The number of SearchPaths that refer to this directory.
         * Plus the number of global variables that refer to this directory.
         * References from openDirs do not count though.
-        *
-        * TODO: Check the reference counting; see Dir_Expand, partPath.
         */
        int refCount;
 
        /* The number of times a file in this directory has been found. */
        int hits;
 
-       /* The names of the files in the directory. */
+       /* The names of the directory entries. */
        HashSet files;
 };
 
@@ -536,6 +534,7 @@
        SearchPath_Clear(&dirSearchPath);
        OpenDirs_Done(&openDirs);
        HashTable_Done(&mtimes);
+       HashTable_Done(&lmtimes);
 #endif
 }
 



Home | Main Index | Thread Index | Old Index