Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdJBa-0007JC-RV for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Aug 2016 15:36:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bdJBa-0007dL-Bi for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Aug 2016 15:36:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bdJAC-00066X-9a for pgsql-hackers@postgresql.org; Fri, 26 Aug 2016 15:35:24 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdJA8-0006Js-SR for pgsql-hackers@postgresql.org; Fri, 26 Aug 2016 15:35:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id E45EB21C23E3; Fri, 26 Aug 2016 18:35:18 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q-wOdXvVxSpG; Fri, 26 Aug 2016 18:35:18 +0300 (MSK) Received: from localhost (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id A0F0521C23E2; Fri, 26 Aug 2016 18:35:18 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1472225718; bh=ogksgFOW63BcJvoIPfhv/Kcqu3i8Dx9bT4F0VI6IGA4=; h=Date:From:To:Cc:Subject; b=b6e1Pofb061DMfuMxlzHMeLySb6ZfEH8jMuvN3zqiNLQmsO0YEIPZRQ0lb7qTXIzH ValbdCSRkkMljddqDl/v30tq8f3H7WO4EUjPyyZHzFI56nvRB3MWRCHx1nVkXtoBEa UpxgiSoXS7mDjKiQnv9FMQzl9ZwV2MrOj/c7bjN4= Date: Fri, 26 Aug 2016 18:33:58 +0300 From: Aleksander Alekseev To: PostgreSQL Hackers Cc: Tom Lane , Heikki Linnakangas , Michael Paquier Subject: Re: Missing checks when malloc returns NULL... Message-ID: <20160826153358.GA29981@e733> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) X-Pg-Spam-Score: -0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hello, Michael. Your patch [1] was marked as "Needs review" so I decided to take a look. It looks good to me. However I found dozens of places in PostgreSQL code that seem to have similar problem you are trying to fix [2]. As far as I understand these are only places left that don't check malloc/realloc/ strdup return values properly. I thought maybe you will be willing to fix they too so we could forget about this problem forever. If not I will be happy to do it. However in this case we need someone familiar with affected parts of the code who will be willing to re-check a new patch since I'm not filling particularly confident about how exactly errors should be handled in all these cases. By the way maybe someone knows other procedures besides malloc, realloc and strdup that require special attention? [1] https://commitfest.postgresql.org/10/653/ [2] http://afiskon.ru/s/15/83287ef7d2_malloc.txt -- Best regards, Aleksander Alekseev -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers