Fix minor memory leak in ident_inet().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Feb 2015 00:09:54 +0000 (19:09 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Feb 2015 00:09:54 +0000 (19:09 -0500)
commit58146d35deed3bd3e05ce4b5ba529e4e4a369ddb
treeb93acbe16d204165bbabb779edefa837c74962c9
parent9179444d070713f53a97bc8f5c898a8304424c4d
Fix minor memory leak in ident_inet().

We'd leak the ident_serv data structure if the second pg_getaddrinfo_all
(the one for the local address) failed.  This is not of great consequence
because a failure return here just leads directly to backend exit(), but
if this function is going to try to clean up after itself at all, it should
not have such holes in the logic.  Try to fix it in a future-proof way by
having all the failure exits go through the same cleanup path, rather than
"optimizing" some of them.

Per Coverity.  Back-patch to 9.2, which is as far back as this patch
applies cleanly.
src/backend/libpq/auth.c