summaryrefslogtreecommitdiffstats
path: root/libdimension/png.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/png.c')
-rw-r--r--libdimension/png.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index c8ffc62..76308ca 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -54,7 +54,10 @@ dmnsn_png_optimize_canvas(dmnsn_canvas *canvas)
return 1;
}
- dmnsn_optimize_canvas(canvas, optimizer);
+ if (dmnsn_optimize_canvas(canvas, optimizer) != 0) {
+ free(optimizer.ptr);
+ return 1;
+ }
return 0;
}