#1510 closed defect (fixed)

Wrong memory allocation check in example

Reported by: Alin Rus Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: doc Version: 4.10
Severity: trivial Keywords:
Cc: chrisj@… Blocked By:

Description (last modified by Joel Sherrill)

The memory allocation check in this example is incorrect http://rtems.com/onlinedocs/doc-current/share/rtems/html/c_user/c_user00513.html

foo* bar = malloc (sizeof (foo));
if (!foo)

return -1;

You should have:

foo* bar = malloc (sizeof (foo));
if (!bar)

return -1;

Since bar is the pointer to the allocated memory

Change History (2)

comment:1 Changed on May 5, 2010 at 8:04:16 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Fixed on CVS head. Thanks.

comment:2 Changed on Nov 23, 2014 at 7:13:52 PM by Joel Sherrill

Description: modified (diff)
Milestone: 4.104.11
Version: unknown4.10
Note: See TracTickets for help on using tickets.