Bruce Momjian <bruce(at)momjian(dot)us> writes:
> The attached tiny patch fixes a small leak in psql's \gset command and
> simplifies memory freeing in two places.
The first and third hunks look to me like they introduce memory
leaks, not fix them. The second hunk is probably safe enough,
although I'm not sure the case can actually occur --- gset should
free the prefix before any new backslash command can be executed.
regards, tom lane