mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
memleak --
This commit is contained in:
parent
869f08b904
commit
118403cb05
@ -772,6 +772,8 @@ unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, int barc
|
|||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Cannot make barcode fit %dx%d\n",
|
"Cannot make barcode fit %dx%d\n",
|
||||||
W, H);
|
W, H);
|
||||||
|
if (e)
|
||||||
|
free(e);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -808,6 +810,7 @@ unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, int barc
|
|||||||
}
|
}
|
||||||
if (!ecc200encode(binary, matrix->bytes, barcode, barcodelen, encoding, lenp)) {
|
if (!ecc200encode(binary, matrix->bytes, barcode, barcodelen, encoding, lenp)) {
|
||||||
fprintf(stderr, "Barcode too long for %dx%d\n", W, H);
|
fprintf(stderr, "Barcode too long for %dx%d\n", W, H);
|
||||||
|
free(encoding);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// ecc code
|
// ecc code
|
||||||
@ -841,6 +844,7 @@ unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, int barc
|
|||||||
}
|
}
|
||||||
//fprintf (stderr, "\n");
|
//fprintf (stderr, "\n");
|
||||||
}
|
}
|
||||||
|
free(grid);
|
||||||
free(places);
|
free(places);
|
||||||
}
|
}
|
||||||
if (Wptr)
|
if (Wptr)
|
||||||
@ -854,5 +858,6 @@ unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, int barc
|
|||||||
if (eccp)
|
if (eccp)
|
||||||
*eccp =
|
*eccp =
|
||||||
(matrix->bytes + 2) / matrix->datablock * matrix->rsblock;
|
(matrix->bytes + 2) / matrix->datablock * matrix->rsblock;
|
||||||
|
free(encoding);
|
||||||
return grid;
|
return grid;
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,7 @@ int plessey(struct zint_symbol *symbol, unsigned char source[])
|
|||||||
|
|
||||||
expand(symbol, dest);
|
expand(symbol, dest);
|
||||||
strcpy(symbol->text, (char*)source);
|
strcpy(symbol->text, (char*)source);
|
||||||
|
free(checkptr);
|
||||||
return error_number;
|
return error_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user