< prev index next >
src/java.desktop/unix/native/libawt_xawt/awt/list.c
Print this page
*** 101,112 ****
#endif
{
while (lp->next) {
lp = lp->next;
}
- if ((lp->next = (list_ptr) malloc( sizeof( list_item))) == NULL) {
return 0;
}
lp->next->ptr.item = item;
lp->next->next = NULL;
--- 101,113 ----
#endif
{
while (lp->next) {
lp = lp->next;
}
+ lp->next = (list_ptr) malloc(sizeof(list_item));
+ if (lp->next == NULL) {
return 0;
}
lp->next->ptr.item = item;
lp->next->next = NULL;
*** 120,130 ****
-------------------------------------------------------------------- **/
list_ptr new_list ()
{
list_ptr lp;
! if (lp = (list_ptr) malloc( sizeof( list_item))) {
lp->next = NULL;
lp->ptr.item = NULL;
}
return lp;
--- 121,132 ----
-------------------------------------------------------------------- **/
list_ptr new_list ()
{
list_ptr lp;
! lp = (list_ptr) malloc(sizeof(list_item));
! if (lp) {
lp->next = NULL;
lp->ptr.item = NULL;
}
return lp;
< prev index next >