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/opkg_cmd.c') diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index 9c1612b..807777e 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -306,7 +306,7 @@ static opkg_intercept_t opkg_prep_intercepts(opkg_conf_t *conf) char *newpath; int gen; - ctx = calloc (1, sizeof (*ctx)); + ctx = xcalloc(1, sizeof (*ctx)); ctx->oldpath = xstrdup(getenv("PATH")); sprintf_alloc (&newpath, "%s/opkg/intercept:%s", DATADIR, ctx->oldpath); @@ -877,7 +877,7 @@ static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv) available = pkg_vec_alloc(); pkg_hash_fetch_all_installed(&conf->pkg_hash, available); for (i=0; i < argc; i++) { - pkg_name = calloc(1, strlen(argv[i])+2); + pkg_name = xcalloc(1, strlen(argv[i])+2); strcpy(pkg_name,argv[i]); for (a=0; a < available->len; a++) { pkg = available->pkgs[a]; -- cgit v0.9.1