Re: pgsql: Clean up some code, comments and docs referring to Windows 2000

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Clean up some code, comments and docs referring to Windows 2000
Date: 2020-02-19 21:01:54
Message-ID: 9781.1582146114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> Clean up some code, comments and docs referring to Windows 2000 and older

Surely this patch broke the error case in haveNativeWindowsIPv6routines()?
That is, in the admittedly unlikely case that LoadLibraryA("ws2_32")
succeeds but GetProcAddress(hLibrary, "getaddrinfo") doesn't, what you
now have will do FreeLibrary(hLibrary) and then proceed to use the
now-dangling hLibrary pointer anyway.

It looks to me like you should just remove this whole stanza now:

if (hLibrary == NULL || GetProcAddress(hLibrary, "getaddrinfo") == NULL)
{
/*
* Well, ws2_32 doesn't exist, or more likely doesn't have
* getaddrinfo.
*/
if (hLibrary != NULL)
FreeLibrary(hLibrary);
}

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-02-19 21:59:29 pgsql: Remove support for upgrading extensions from "unpackaged" state.
Previous Message Peter Eisentraut 2020-02-19 20:18:05 pgsql: Fix typo