Code

Use xcalloc instead of calloc
authorJonas Fonseca <fonseca@diku.dk>
Mon, 28 Aug 2006 00:26:07 +0000 (02:26 +0200)
committerJunio C Hamano <junkio@cox.net>
Mon, 28 Aug 2006 03:49:43 +0000 (20:49 -0700)
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
object-refs.c
object.c

index b1b8065851b2723a57e5d6ab0859ca72e52fd55f..b0034e4b217e12b267a51301c52b75e7255aec7b 100644 (file)
@@ -30,7 +30,7 @@ static void grow_refs_hash(void)
        int new_hash_size = (refs_hash_size + 1000) * 3 / 2;
        struct object_refs **new_hash;
 
-       new_hash = calloc(new_hash_size, sizeof(struct object_refs *));
+       new_hash = xcalloc(new_hash_size, sizeof(struct object_refs *));
        for (i = 0; i < refs_hash_size; i++) {
                struct object_refs *ref = refs_hash[i];
                if (!ref)
index 60bf16b902033d9f256282201ca7aeca74855d7e..92813001e25f20ae7dd7a1e0f0ef11ec5d746030 100644 (file)
--- a/object.c
+++ b/object.c
@@ -73,7 +73,7 @@ static void grow_object_hash(void)
        int new_hash_size = obj_hash_size < 32 ? 32 : 2 * obj_hash_size;
        struct object **new_hash;
 
-       new_hash = calloc(new_hash_size, sizeof(struct object *));
+       new_hash = xcalloc(new_hash_size, sizeof(struct object *));
        for (i = 0; i < obj_hash_size; i++) {
                struct object *obj = obj_hash[i];
                if (!obj)