pixz
pixz copied to clipboard
Fixed typo in block_alloc
In write.c Line 263, parts is compared against BLOCK_IN despite dealing with output, and the corresponding block_dealloc checks BLOCK_OUT instead. Is this a typo?
static void block_alloc(io_block_t *ib, block_parts parts) {
if ((parts & BLOCK_IN) && !ib->input)
ib->input = malloc(gBlockInSize);
if ((parts & BLOCK_IN) && !ib->output) // <-- I believe this line should be BLOCK_OUT
ib->output = malloc(gBlockOutSize);
if (!ib->input || !ib->output)
die("Can't allocate blocks");
}
The corresponding block_dealloc:
static void block_dealloc(io_block_t *ib, block_parts parts) {
if (parts & BLOCK_IN) {
free(ib->input);
ib->input = NULL;
}
if (parts & BLOCK_OUT) { // <-- Uses BLOCK_OUT
free(ib->output);
ib->output = NULL;
}
}
That looks correct! Not sure what's wrong with CI though.
Yeah, the CI failure is real, I can reproduce with make check locally. Can you?
Is this a bug users should be worried about?