Module Name:    src
Committed By:   christos
Date:           Sat Feb 27 16:17:26 UTC 2016

Modified Files:
        src/usr.bin/make: meta.c

Log Message:
CID 1025007: Don't leak missingFiles


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/make/meta.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.49 src/usr.bin/make/meta.c:1.50
--- src/usr.bin/make/meta.c:1.49	Sat Feb 27 11:14:23 2016
+++ src/usr.bin/make/meta.c	Sat Feb 27 11:17:26 2016
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.49 2016/02/27 16:14:23 christos Exp $ */
+/*      $NetBSD: meta.c,v 1.50 2016/02/27 16:17:26 christos Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1368,7 +1368,6 @@ meta_oodate(GNode *gn, Boolean oodate)
 		fprintf(debug_file, "%s: missing files: %s...\n",
 			fname, (char *)Lst_Datum(Lst_First(missingFiles)));
 	    oodate = TRUE;
-	    Lst_Destroy(missingFiles, (FreeProc *)free);
 	}
     } else {
 	if ((gn->type & OP_META)) {
@@ -1377,6 +1376,9 @@ meta_oodate(GNode *gn, Boolean oodate)
 	    oodate = TRUE;
 	}
     }
+
+    Lst_Destroy(missingFiles, (FreeProc *)free);
+
     if (oodate && needOODATE) {
 	/*
 	 * Target uses .OODATE which is empty; or we wouldn't be here.

Reply via email to