ex_cscope.c cscope_find fix a double free of the variable np by poisoning it after it is freed.
exf.c file_backup fix a memory leak by freeing the variable d.
Run clang's static analyzer, scan-build, before to reproduce the problems. Run scan-build after to verify resolution.
The test is not needed, free already do that test
Have you tried to upstream that fix? upstream is here: https://github.com/lichray/nvi2
Sure, let me give it a try.