Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> I attached a quick patch that seems to do the trick. It appears that
> fgets() will always return non-NULL if the size passed in is 1 (i.e.
> maxlength in the caller is 0).
Huh, interesting corner case. I'd be inclined to fix by initializing
maxlength to 1 though.
Where's the memory leak?
regards, tom lane