Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4WTp-0002BM-G4 for pgsql-committers@arkaria.postgresql.org; Wed, 19 Feb 2020 21:02:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4WTn-0003My-FV for pgsql-committers@arkaria.postgresql.org; Wed, 19 Feb 2020 21:01:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4WTn-0003Mr-4g for pgsql-committers@lists.postgresql.org; Wed, 19 Feb 2020 21:01:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4WTk-0007D9-Uc for pgsql-committers@lists.postgresql.org; Wed, 19 Feb 2020 21:01:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 01JL1sct009782; Wed, 19 Feb 2020 16:01:54 -0500 From: Tom Lane To: Michael Paquier cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Clean up some code, comments and docs referring to Windows 2000 In-reply-to: References: Comments: In-reply-to Michael Paquier message dated "Wed, 19 Feb 2020 04:21:04 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9780.1582146114.1@sss.pgh.pa.us> Date: Wed, 19 Feb 2020 16:01:54 -0500 Message-ID: <9781.1582146114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier 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