#include <png.h>
#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);
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;
png_write_end(png, info);
png_destroy_write_struct(&png, &info);
- free(rows);
+ chk_free(rows);
img_destroy(&tmpimg);
return 0;