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_src_list.c') diff --git a/libopkg/pkg_src_list.c b/libopkg/pkg_src_list.c index 9a2a90f..cd7fce4 100644 --- a/libopkg/pkg_src_list.c +++ b/libopkg/pkg_src_list.c @@ -19,6 +19,7 @@ #include "pkg_src_list.h" #include "void_list.h" +#include "libbb/libbb.h" int pkg_src_list_init(pkg_src_list_t *list) { @@ -48,12 +49,7 @@ pkg_src_t *pkg_src_list_append(pkg_src_list_t *list, int err; /* freed in pkg_src_list_deinit */ - pkg_src_t *pkg_src = calloc(1, sizeof(pkg_src_t)); - - if (pkg_src == NULL) { - fprintf(stderr, "%s: out of memory\n", __FUNCTION__); - return NULL; - } + pkg_src_t *pkg_src = xcalloc(1, sizeof(pkg_src_t)); pkg_src_init(pkg_src, name, base_url, extra_data, gzip); err = void_list_append((void_list_t *) list, pkg_src); -- cgit v0.9.1