On 17.06.22 07:11, Tom Lane wrote:
> Having said that, the pattern "if (x) free(x);" is absolutely
> ubiquitous across our code, and so I'm not sure that I'm on
> board with undoing it only in libpq. I'd be happier if we made
> a push to get rid of it everywhere.
Sure, here is a more comprehensive patch set. (It still looks like
libpq is the largest chunk.)
> Notably, I think the choice
> that pfree(NULL) is disallowed traces directly to worries about
> coding-pattern-compatibility with pre-POSIX free(). Should we
> revisit that?
Yes please, and also repalloc().