From owner-freebsd-net@FreeBSD.ORG Sat Feb 21 09:00:16 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FCC416A4CE for ; Sat, 21 Feb 2004 09:00:15 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FC9543D1D for ; Sat, 21 Feb 2004 09:00:15 -0800 (PST) (envelope-from pete@rommon.com) Received: from rommon.com (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i1LH0DcM008757 for ; Sat, 21 Feb 2004 19:00:13 +0200 (EET) (envelope-from pete@rommon.com) Message-ID: <40378E93.3010804@rommon.com> Date: Sat, 21 Feb 2004 19:00:03 +0200 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD - net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: malloc (0) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 17:00:16 -0000 I´m asking the net list because I came across this when browsing through the networking / resolver code. The question is if the code should check for zero value before calling malloc or is malloc(0) legal if the pointer is never used? I came across this when using dmalloc library and it started complaining about zero sized allocations from get_addrselectpolicy. Pete