From: Wolfgang Denk Date: Sun, 17 Jan 2010 18:59:29 +0100 Subject: [U-Boot] [PATCH] malloc: return NULL if not initialized yet In-Reply-To: <1263551117-26553-1-git-send-email-wd@denx.de> References: <1263551117-26553-1-git-send-email-wd@denx.de> Message-ID: <20100117175929.12D32C88AE@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <1263551117-26553-1-git-send-email-wd@denx.de> you wrote: > When malloc() was called before it was properly initialized > (as would happen if when used before relocation to RAM) it returned > random, non-NULL values, which called all kinds of difficult to debug > subsequent errors. > > Make sure to return NULL when initialization was not done yet. > > Signed-off-by: Wolfgang Denk > --- > common/dlmalloc.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) Applied (with change as suggested by Mike). Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Disobedience: The silver lining to the cloud of servitude. - Ambrose Bierce