Skip to content

Commit

Permalink
Use xcalloc instead of calloc
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
jonas authored and Junio C Hamano committed Aug 28, 2006
1 parent c470701 commit b3c952f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion object-refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b3c952f

Please sign in to comment.