From 480538737a8a9be074a1848f2e52cf2d1ff4709f Mon Sep 17 00:00:00 2001 From: graham.gower Date: Wed, 04 Nov 2009 23:20:09 -0500 Subject: 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 --- (limited to 'libopkg/void_list.c') 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 #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; } -- cgit v0.9.1