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/nv_pair_list.c') diff --git a/libopkg/nv_pair_list.c b/libopkg/nv_pair_list.c index e98d718..5b6d4ff 100644 --- a/libopkg/nv_pair_list.c +++ b/libopkg/nv_pair_list.c @@ -20,7 +20,7 @@ #include "nv_pair.h" #include "void_list.h" #include "nv_pair_list.h" - +#include "libbb/libbb.h" int nv_pair_list_init(nv_pair_list_t *list) { @@ -51,12 +51,7 @@ nv_pair_t *nv_pair_list_append(nv_pair_list_t *list, const char *name, const cha int err; /* freed in nv_pair_list_deinit */ - nv_pair_t *nv_pair = calloc(1, sizeof(nv_pair_t)); - - if (nv_pair == NULL) { - fprintf(stderr, "%s: out of memory\n", __FUNCTION__); - return NULL; - } + nv_pair_t *nv_pair = xcalloc(1, sizeof(nv_pair_t)); nv_pair_init(nv_pair, name, value); err = void_list_append((void_list_t *) list, nv_pair); -- cgit v0.9.1