Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#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:
Blocking:

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 05/05/10 at 20:04:16 by Joel Sherrill

Resolution: fixed
Status: newclosed

Fixed on CVS head. Thanks.

comment:2 Changed on 11/23/14 at 19:13:52 by Joel Sherrill

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