Module Name:    src
Committed By:   rillig
Date:           Sun Feb 14 21:32:58 UTC 2021

Modified Files:
        src/usr.bin/make: nonints.h

Log Message:
make: clean up FStr and MFStr memory in cleanup mode


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/make/nonints.h

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/nonints.h
diff -u src/usr.bin/make/nonints.h:1.202 src/usr.bin/make/nonints.h:1.203
--- src/usr.bin/make/nonints.h:1.202	Fri Feb  5 05:15:12 2021
+++ src/usr.bin/make/nonints.h	Sun Feb 14 21:32:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.202 2021/02/05 05:15:12 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.203 2021/02/14 21:32:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -204,6 +204,10 @@ MAKE_INLINE void
 FStr_Done(FStr *fstr)
 {
 	free(fstr->freeIt);
+#ifdef CLEANUP
+	fstr->str = NULL;
+	fstr->freeIt = NULL;
+#endif
 }
 
 /* Return a string that is the sole owner of str. */
@@ -224,6 +228,10 @@ MAKE_INLINE void
 MFStr_Done(MFStr *mfstr)
 {
 	free(mfstr->freeIt);
+#ifdef CLEANUP
+	mfstr->str = NULL;
+	mfstr->freeIt = NULL;
+#endif
 }
 
 Words Str_Words(const char *, Boolean);

Reply via email to