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/pkg_dest_list.c') diff --git a/libopkg/pkg_dest_list.c b/libopkg/pkg_dest_list.c index 2c03e73..f8a7c52 100644 --- a/libopkg/pkg_dest_list.c +++ b/libopkg/pkg_dest_list.c @@ -20,6 +20,7 @@ #include "pkg_dest.h" #include "void_list.h" #include "pkg_dest_list.h" +#include "libbb/libbb.h" int pkg_dest_list_elt_init(pkg_dest_list_elt_t *elt, pkg_dest_t *data) { @@ -58,12 +59,8 @@ pkg_dest_t *pkg_dest_list_append(pkg_dest_list_t *list, const char *name, int err; pkg_dest_t *pkg_dest; - /* freed in plg_dest_list_deinit */ - pkg_dest = calloc(1, sizeof(pkg_dest_t)); - if (pkg_dest == NULL) { - fprintf(stderr, "%s: out of memory\n", __FUNCTION__); - return NULL; - } + /* freed in pkg_dest_list_deinit */ + pkg_dest = xcalloc(1, sizeof(pkg_dest_t)); pkg_dest_init(pkg_dest, name, root_dir,lists_dir); err = void_list_append((void_list_t *) list, pkg_dest); -- cgit v0.9.1