libfreerdp-utils/list: use xnew macro.

This commit is contained in:
Vic Lee 2011-07-13 22:39:35 +08:00
parent ce3cfddd28
commit 787a6e3844

View File

@ -34,8 +34,7 @@ struct _item_type##_full \
static struct _item_type* _item_type##_new(void) \ static struct _item_type* _item_type##_new(void) \
{ \ { \
struct _item_type* item; \ struct _item_type* item; \
item = (struct _item_type*)xmalloc(sizeof(struct _item_type##_full));\ item = (struct _item_type*)xnew(struct _item_type##_full);\
memset(item, 0, sizeof(struct _item_type##_full)); \
return item; \ return item; \
} \ } \
\ \
@ -60,8 +59,7 @@ struct _list_type \
static struct _list_type* _list_type##_new(void) \ static struct _list_type* _list_type##_new(void) \
{ \ { \
struct _list_type* list; \ struct _list_type* list; \
list = (struct _list_type*)xmalloc(sizeof(struct _list_type)); \ list = xnew(struct _list_type); \
memset(list, 0, sizeof(struct _list_type)); \
return list; \ return list; \
} \ } \
\ \