malloc/calloc: check for NULL always (11.1.0 gcc -fanalyzer -c backend/*.c)

ZBarcode_Encode: don't reinit symbol->outfile, props Alonso Schaich
frontend/test_args: skip long filename tests on Windows, props Alonso Schaich
This commit is contained in:
gitlost 2021-06-29 15:43:42 +01:00
parent 8c419ab4fb
commit 368633bda4
9 changed files with 131 additions and 55 deletions

View file

@ -66,7 +66,10 @@ INTERNAL int plessey(struct zint_symbol *symbol, unsigned char source[], int len
strcpy(symbol->errtxt, "371: Invalid characters in data");
return error_number;
}
checkptr = (unsigned char *) calloc(1, length * 4 + 8);
if (!(checkptr = (unsigned char *) calloc(1, length * 4 + 8))) {
strcpy(symbol->errtxt, "373: Insufficient memory for check digit CRC buffer");
return ZINT_ERROR_MEMORY;
}
/* Start character */
strcpy(dest, "31311331");