Testing demonstrated a memory leak when using DH_REBUILD_SEL_CUTOFF SQL configuration option to force reoptimization of a parameterized query if the selectivity changes. The scope of the leak was the size of the statement at the time it was reoptimized. The logic has been changed to correctly free all memory.