commit - 8f464e92b2e71ae647c139f4937a2390d159eec2
commit + 25b84e6cea4c9658ea8ffc7af2928f0b254069ca
blob - 6edf50f52da0daa282b26ccb4fa82b57283d55bc
blob + c253f2858befebc7bcbb97937e35ee98403a4738
--- lib/object_create.c
+++ lib/object_create.c
break;
}
- *id = malloc(sizeof(**id));
+ *id = calloc(1, sizeof(**id));
if (*id == NULL) {
- err = got_error_from_errno("malloc");
+ err = got_error_from_errno("calloc");
goto done;
}
SHA1Final((*id)->sha1, &sha1_ctx);
treesize += n;
}
- *id = malloc(sizeof(**id));
+ *id = calloc(1, sizeof(**id));
if (*id == NULL) {
- err = got_error_from_errno("malloc");
+ err = got_error_from_errno("calloc");
goto done;
}
SHA1Final((*id)->sha1, &sha1_ctx);
}
commitsize += n;
- *id = malloc(sizeof(**id));
+ *id = calloc(1, sizeof(**id));
if (*id == NULL) {
- err = got_error_from_errno("malloc");
+ err = got_error_from_errno("calloc");
goto done;
}
SHA1Final((*id)->sha1, &sha1_ctx);
tagsize += n;
}
- *id = malloc(sizeof(**id));
+ *id = calloc(1, sizeof(**id));
if (*id == NULL) {
- err = got_error_from_errno("malloc");
+ err = got_error_from_errno("calloc");
goto done;
}
SHA1Final((*id)->sha1, &sha1_ctx);