mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-13 06:34:32 -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
|
@ -105,6 +105,8 @@ void ZBarcode_Delete(struct zint_symbol *symbol) {
|
|||
if (symbol->rendered != NULL) {
|
||||
struct zint_render_line *line, *l;
|
||||
struct zint_render_string *string, *s;
|
||||
struct zint_render_ring *ring, *r;
|
||||
struct zint_render_hexagon *hexagon, *h;
|
||||
|
||||
// Free lines
|
||||
line = symbol->rendered->lines;
|
||||
|
@ -121,6 +123,22 @@ void ZBarcode_Delete(struct zint_symbol *symbol) {
|
|||
free(s->text);
|
||||
free(s);
|
||||
}
|
||||
|
||||
// Free Rings
|
||||
ring = symbol->rendered->rings;
|
||||
while (ring) {
|
||||
r = ring;
|
||||
ring = ring->next;
|
||||
free(r);
|
||||
}
|
||||
|
||||
// Free Hexagons
|
||||
hexagon = symbol->rendered->hexagons;
|
||||
while (hexagon) {
|
||||
h = hexagon;
|
||||
hexagon = hexagon->next;
|
||||
free(h);
|
||||
}
|
||||
|
||||
// Free Render
|
||||
free(symbol->rendered);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue