Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/pkghash.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-07 16:06:16 -0500
committerDan McGee <dan@archlinux.org>2011-06-13 19:38:38 -0500
commite2aa952689da8763d534d1c19310eb97009f4f76 (patch)
tree7d022d67801bc01c24fef985feb9a617c48d316a /lib/libalpm/pkghash.c
parent8b62d9bc0ade64897990b8fc6a1b6a54b629cb5b (diff)
Move pm_errno onto the handle
This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/pkghash.c')
-rw-r--r--lib/libalpm/pkghash.c8
1 files changed, 2 insertions, 6 deletions
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;
}