Opened on 05/05/10 at 19:39:21
Closed on 05/05/10 at 20:04:16
#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: | new → closed |
comment:2 Changed on 11/23/14 at 19:13:52 by Joel Sherrill
Description: | modified (diff) |
---|---|
Milestone: | 4.10 → 4.11 |
Version: | unknown → 4.10 |
Note: See
TracTickets for help on using
tickets.
Fixed on CVS head. Thanks.