commit - 1e45b069d0cceff0ca943c3fe8dd62d7d2d2e8c6
commit + 84f17c46f2598468c88e7a8d02b10e314162f647
blob - f702f135fdf85e0a7b47cd7da46228b1dceed9b9
blob + 6abefa6928bbb851939d9d90766cc9645d05aab3
--- lib/diffoffset.c
+++ lib/diffoffset.c
got_diffoffset_alloc(struct got_diffoffset_chunks **chunks)
{
const struct got_error *err = NULL;
- struct got_diffoffset_chunk *first;
- first = alloc_chunk(0, 0);
- if (first == NULL)
- return got_error_from_errno("alloc_chunk");
-
*chunks = calloc(1, sizeof(**chunks));
if (*chunks == NULL) {
err = got_error_from_errno("calloc");
- free(first);
return err;
}
SIMPLEQ_INIT(*chunks);
- SIMPLEQ_INSERT_HEAD(*chunks, first, entry);
-
return NULL;
}