Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 14 Jan 2013 18:17:47 +0100
From: Igmar Palsenberg <>
To: "" <>
Subject: malloc(0) behaviour


Is there a (good) reason for Musl to follow glibc's malloc(0) behaviour ? Musl returns a valid pointer, which is fine according
to the standard, but returning NULL is also fine.

IMHO, returning NULL is better : It usually kills the program if actual storage is attempted. You also can't do that if a valid pointer
is returned, so I really can't grasp the reason for returning a pointer at all, except to support buggy and lazy programming.

I suggest we make malloc(0) return a NULL pointer. Any objections ?



Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.