Source-Changes archive

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

CVS commit: src/usr.bin/make



Module Name:    src
Committed By:   rillig
Date:           Sun Nov 29 16:37:10 UTC 2020

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

Log Message:
make(1): fix the reference count of dotLast going negative

The memory management for dotLast is quite simple.  It is initialized
exactly once main_Init > Init_Objdir > Dir_InitDir and freed exactly
once in main_CleanUp > Dir_End.  Previously, dotLast was not freed at all.

The first call to CachedDir_Unref decremented the refCount to 0 but
didn't free anything.  Next, CachedDir_Destroy was called, which
decremented the reference count to -1, therefore skipping the actual
freeing.  This was probably an implementation mistake.

Since Dir_End is called at the very end of main_CleanUp, no code
accesses dotLast after it has been freed.


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/usr.bin/make/dir.c

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




Home | Main Index | Thread Index | Old Index