< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/list.c

Print this page

        

*** 65,74 **** --- 65,75 ---- ----------------------------------------------------------------------- **/ #include <stdio.h> #include <stdlib.h> + #include "X11/Xfuncproto.h" #include "list.h" /** ------------------------------------------------------------------------ Sets the pointers of the specified list to NULL.
*** 118,130 **** Creates a new list and sets its pointers to NULL. Returns a pointer to the new list. -------------------------------------------------------------------- **/ list_ptr new_list () { ! list_ptr lp; ! if (lp = (list_ptr) malloc( sizeof( list_item))) { lp->next = NULL; lp->ptr.item = NULL; } return lp; --- 119,131 ---- Creates a new list and sets its pointers to NULL. Returns a pointer to the new list. -------------------------------------------------------------------- **/ list_ptr new_list () { ! list_ptr lp = (list_ptr) malloc( sizeof( list_item)); ! if (lp != NULL) { lp->next = NULL; lp->ptr.item = NULL; } return lp;
*** 146,159 **** list_ptr dup_list_head(lp, start_at_curr) list_ptr lp; int32_t start_at_curr; #endif { ! list_ptr new_list; ! ! if ((new_list = (list_ptr) malloc( sizeof( list_item))) == NULL) { return (list_ptr)NULL; } new_list->next = start_at_curr ? lp->ptr.curr : lp->next; new_list->ptr.curr = lp->ptr.curr; --- 147,159 ---- list_ptr dup_list_head(lp, start_at_curr) list_ptr lp; int32_t start_at_curr; #endif { ! list_ptr new_list = (list_ptr) malloc( sizeof( list_item)); + if (new_list == NULL) { return (list_ptr)NULL; } new_list->next = start_at_curr ? lp->ptr.curr : lp->next; new_list->ptr.curr = lp->ptr.curr;
< prev index next >