commit - 01392bd60410ca454e46653c8a740008e84545ef
commit + 161b566ff8fdc61984f077c6ab1d75b5f0fd5ac7
blob - 8fa42a873d1dd3feb591275a17e1bd546c3dab59
blob + c8d4003646dbbf24c3e252839931cf8e83181583
--- 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);