diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-04 23:20:09 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-04 23:20:09 (EST) |
commit | 480538737a8a9be074a1848f2e52cf2d1ff4709f (patch) | |
tree | e24d32dc46e0b83600aaa02a33ecaa6779765d9b /libopkg/void_list.c | |
parent | acd905996191df6ab59050bd179a5ed11e6f72a4 (diff) |
s/malloc/xmalloc/ s/calloc/xcalloc/ s/realloc/realloc/
And redundant error checking removed from the places where allocation failures
were actually checked.
git-svn-id: http://opkg.googlecode.com/svn/trunk@259 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/void_list.c')
-rw-r--r-- | libopkg/void_list.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libopkg/void_list.c b/libopkg/void_list.c index 1517228..e36b451 100644 --- a/libopkg/void_list.c +++ b/libopkg/void_list.c @@ -19,6 +19,7 @@ #include <errno.h> #include "void_list.h" +#include "libbb/libbb.h" int void_list_elt_init(void_list_elt_t *elt, void *data) { @@ -31,11 +32,7 @@ int void_list_elt_init(void_list_elt_t *elt, void *data) void_list_elt_t * void_list_elt_new (void *data) { void_list_elt_t *elt; /* freed in void_list_elt_deinit */ - elt = calloc(1, sizeof(void_list_elt_t)); - if (elt == NULL) { - fprintf(stderr, "%s: out of memory\n", __FUNCTION__); - return NULL; - } + elt = xcalloc(1, sizeof(void_list_elt_t)); void_list_elt_init(elt, data); return elt; } |