mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-15 15:44:34 -04:00
Fix various memory leaks
Bugfixes thanks to Alex Haley <ahaley42@users.sf.net>
This commit is contained in:
parent
e6ff154543
commit
a7bcef4ef7
6 changed files with 400 additions and 370 deletions
|
@ -111,20 +111,24 @@ int svg_plot(struct zint_symbol *symbol) {
|
|||
|
||||
if (strlen(symbol->fgcolour) != 6) {
|
||||
strcpy(symbol->errtxt, "Malformed foreground colour target");
|
||||
fclose(fsvg);
|
||||
return ZINT_ERROR_INVALID_OPTION;
|
||||
}
|
||||
if (strlen(symbol->bgcolour) != 6) {
|
||||
strcpy(symbol->errtxt, "Malformed background colour target");
|
||||
fclose(fsvg);
|
||||
return ZINT_ERROR_INVALID_OPTION;
|
||||
}
|
||||
error_number = is_sane(SSET, (unsigned char*) symbol->fgcolour, strlen(symbol->fgcolour));
|
||||
if (error_number == ZINT_ERROR_INVALID_DATA) {
|
||||
strcpy(symbol->errtxt, "Malformed foreground colour target");
|
||||
fclose(fsvg);
|
||||
return ZINT_ERROR_INVALID_OPTION;
|
||||
}
|
||||
error_number = is_sane(SSET, (unsigned char*) symbol->bgcolour, strlen(symbol->bgcolour));
|
||||
if (error_number == ZINT_ERROR_INVALID_DATA) {
|
||||
strcpy(symbol->errtxt, "Malformed background colour target");
|
||||
fclose(fsvg);
|
||||
return ZINT_ERROR_INVALID_OPTION;
|
||||
}
|
||||
locale = setlocale(LC_ALL, "C");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue