# (patch) calloc->xcalloc in read-cache.c

2 messages from 2006-05-08 to 2006-05-08. Participants: Yakov Lerner, Junio C Hamano.
Thread: https://gitlist.dev/t/4105

## Yakov Lerner, 2006-05-08 18:01

Subject: (patch) calloc->xcalloc in read-cache.c
Message-ID: <f36b08ee0605081101w3dc3a60cof5a524e9b4a3f555@mail.gmail.com>
URL: https://gitlist.dev/e/f36b08ee0605081101w3dc3a60cof5a524e9b4a3f555%40mail.gmail.com

```
--- read-cache.c.000    2006-05-08 15:13:57.000000000 +0000
+++ read-cache.c        2006-05-08 15:15:35.000000000 +0000
@@ -557,7 +557,7 @@

        active_nr = ntohl(hdr->hdr_entries);
        active_alloc = alloc_nr(active_nr);
-       active_cache = calloc(active_alloc, sizeof(struct cache_entry *));
+       active_cache = xcalloc(active_alloc, sizeof(struct cache_entry *));

        offset = sizeof(*hdr);
        for (i = 0; i < active_nr; i++) {

Yakov

```

## Junio C Hamano, 2006-05-08 20:54

Subject: Re: (patch) calloc->xcalloc in read-cache.c
Message-ID: <7vzmhsdyp1.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vzmhsdyp1.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <f36b08ee0605081101w3dc3a60cof5a524e9b4a3f555@mail.gmail.com>

```
"Yakov Lerner" <iler.ml@gmail.com> writes:

> --- read-cache.c.000    2006-05-08 15:13:57.000000000 +0000
> +++ read-cache.c        2006-05-08 15:15:35.000000000 +0000
> @@ -557,7 +557,7 @@
>
>        active_nr = ntohl(hdr->hdr_entries);
>        active_alloc = alloc_nr(active_nr);
> -       active_cache = calloc(active_alloc, sizeof(struct cache_entry *));
> +       active_cache = xcalloc(active_alloc, sizeof(struct cache_entry *));
>
>        offset = sizeof(*hdr);
>        for (i = 0; i < active_nr; i++) {
>
> Yakov

While I do not mind hand generated patch, your mailer setting
seems to be seriously broken.  

Mind checking Documentation/SubmittingPatches and try again?

```
