Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3cKa-0001fu-Hw for pgsql-bugs@arkaria.postgresql.org; Sat, 13 Jun 2015 03:42:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z3cKZ-0000eS-V3 for pgsql-bugs@arkaria.postgresql.org; Sat, 13 Jun 2015 03:42:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z3cKZ-0000eL-2W for pgsql-bugs@postgresql.org; Sat, 13 Jun 2015 03:42:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z3cKV-0007CA-Jc for pgsql-bugs@postgresql.org; Sat, 13 Jun 2015 03:42:02 +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 t5D3fpb2004458; Fri, 12 Jun 2015 23:41:51 -0400 From: Tom Lane To: Alvaro Herrera cc: Michael Paquier , Bill Parker , PostgreSQL mailing lists Subject: Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x In-reply-to: <20150612194716.GQ133018@postgresql.org> References: <20150612194716.GQ133018@postgresql.org> Comments: In-reply-to Alvaro Herrera message dated "Fri, 12 Jun 2015 16:47:17 -0300" Date: Fri, 12 Jun 2015 23:41:51 -0400 Message-ID: <4457.1434166911@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Alvaro Herrera writes: > Michael Paquier wrote: >> By the way, your patch does not compile properly and is not in-line >> with the project's code format. See the updated patch attached ;) > ... or the conventions for allocating memory. Why not just use palloc()? That's hardly the fault of the proposed patch. But yeah, it seems like much the best fix here is to get rid of the malloc (and strdup) calls in this code in favor of using the palloc infrastructure. Even the calls that *do* have manual failure checks are not compliant with our usual coding standards. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs