index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-06-07 16:06:16 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-13 19:38:38 -0500 |
commit | e2aa952689da8763d534d1c19310eb97009f4f76 (patch) | |
tree | 7d022d67801bc01c24fef985feb9a617c48d316a /lib/libalpm/pkghash.c | |
parent | 8b62d9bc0ade64897990b8fc6a1b6a54b629cb5b (diff) |
-rw-r--r-- | lib/libalpm/pkghash.c | 8 |
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; } |