Re: pgsql: Clean up some code, comments and docs referring to Windows 2000 - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Clean up some code, comments and docs referring to Windows 2000
Date
Msg-id 9781.1582146114@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Clean up some code, comments and docs referring to Windows 2000  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgsql: Clean up some code, comments and docs referring toWindows 2000  (Michael Paquier <michael@paquier.xyz>)
List pgsql-committers
Michael Paquier <michael@paquier.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



pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Fix typo
Next
From: Tom Lane
Date:
Subject: pgsql: Remove support for upgrading extensions from "unpackaged" state.