X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=inline;f=imago%2Fsrc%2Ffilepng.c;h=dcba12d7e38a803d74fa37cea9321c8865f8e492;hb=HEAD;hp=077b2ba0db6dbbcf8a5d2afb9ccda19af2dc95ba;hpb=d24c217a0e44402bf3ea1b1392a5514cae4f0a25;p=dos_imgv
diff --git a/imago/src/filepng.c b/imago/src/filepng.c
index 077b2ba..dcba12d 100644
--- a/imago/src/filepng.c
+++ b/imago/src/filepng.c
@@ -24,6 +24,7 @@ along with this program. If not, see .
#include
#include "imago2.h"
#include "ftmodule.h"
+#include "chkalloc.h"
static int check_file(struct img_io *io);
static int read_file(struct img_pixmap *img, struct img_io *io);
@@ -175,7 +176,7 @@ static int write_file(struct img_pixmap *img, struct img_io *io)
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
png_set_text(png, info, &txt, 1);
- if(!(rows = malloc(img->height * sizeof *rows))) {
+ if(!(rows = chk_malloc(img->height * sizeof *rows))) {
png_destroy_write_struct(&png, &info);
img_destroy(&tmpimg);
return -1;
@@ -192,7 +193,7 @@ static int write_file(struct img_pixmap *img, struct img_io *io)
png_write_end(png, info);
png_destroy_write_struct(&png, &info);
- free(rows);
+ chk_free(rows);
img_destroy(&tmpimg);
return 0;