Remove memory leaks in isolationtester.
authorTom Lane <[email protected]>
Sun, 27 Jun 2021 16:45:04 +0000 (12:45 -0400)
committerTom Lane <[email protected]>
Sun, 27 Jun 2021 16:45:04 +0000 (12:45 -0400)
commitde589c11297c575fa88efe69f78394d2c93522dc
tree92523e55f14960dbc6842680072c093b90a3c6ae
parent9c7a150aec71702be24174d3a73533030356374c
Remove memory leaks in isolationtester.

specscanner.l leaked a kilobyte of memory per token of the spec file.
Apparently somebody thought that the introductory code block would be
executed once; but it's once per yylex() call.

A couple of functions in isolationtester.c leaked small amounts of
memory due to not bothering to free one-time allocations.  Might
as well improve these so that valgrind gives this program a clean
bill of health.  Also get rid of an ugly static variable.

Coverity complained about one of the one-time leaks, which led me
to try valgrind'ing isolationtester, which led to discovery of the
larger leak.
src/test/isolation/isolationtester.c
src/test/isolation/specscanner.l