DNP: use the proper free function
g618661b2 introduced a free for a so called memory leak (which wasn't a real leak due to the pinfo->pool garbage collector) but used the wrong free function. Let's keep the explicit free but use the right function.
Closes #17462 (closed)
(cherry picked from commit 029a7fce)