Re: [PATCH 7/9] menu: fix memory corruption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 23, 2010 at 01:40:15PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 08:24 Mon 23 Aug     , Sascha Hauer wrote:
> > menu_free and menu_entry_free are called on not fully initialized
> > entries, so we have to check for validity before freeing the
> > members.
> > 
> I disagree free is suposed to not fail evenif we pass a NULL pointer
Ack.  (ie. free must accept NULL without barfing.)

free(3) has this feature:

	"free() frees the memory space pointed to by ptr [...].  If ptr
	 is NULL, no operation is performed."

and kfree in the kernel accepts NULL, too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux