From e2aa952689da8763d534d1c19310eb97009f4f76 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 7 Jun 2011 16:06:16 -0500 Subject: Move pm_errno onto the handle This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee --- lib/libalpm/pkghash.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/pkghash.c') diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c index 7e5e1fce..a22e6b51 100644 --- a/lib/libalpm/pkghash.c +++ b/lib/libalpm/pkghash.c @@ -55,11 +55,7 @@ pmpkghash_t *_alpm_pkghash_create(size_t size) pmpkghash_t *hash = NULL; size_t i, loopsize; - MALLOC(hash, sizeof(pmpkghash_t), RET_ERR(PM_ERR_MEMORY, NULL)); - - hash->list = NULL; - hash->entries = 0; - hash->buckets = 0; + CALLOC(hash, 1, sizeof(pmpkghash_t), return NULL); loopsize = sizeof(prime_list) / sizeof(*prime_list); for(i = 0; i < loopsize; i++) { @@ -76,7 +72,7 @@ pmpkghash_t *_alpm_pkghash_create(size_t size) } CALLOC(hash->hash_table, hash->buckets, sizeof(alpm_list_t *), \ - free(hash); RET_ERR(PM_ERR_MEMORY, NULL)); + free(hash); return NULL); return hash; } -- cgit v1.2.3-24-g4f1b