summaryrefslogtreecommitdiffstats
path: root/libdimension/png.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-09-26 00:46:34 -0400
committerTavian Barnes <tavianator@gmail.com>2010-09-26 00:46:34 -0400
commit725bd4f0b4cc067fc2770f7f8ffd9c815c745239 (patch)
tree2bf8c049473d27057ce8cbac2a08eb2be05443b6 /libdimension/png.c
parent46bf25a9bed9eec6aaa8c4cad8144c7df629da30 (diff)
downloaddimension-725bd4f0b4cc067fc2770f7f8ffd9c815c745239.tar.xz
Add dmnsn_free() to match dmnsn_malloc().
Diffstat (limited to 'libdimension/png.c')
-rw-r--r--libdimension/png.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index c5dfeca..189c998 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -194,7 +194,7 @@ dmnsn_png_write_canvas_thread(void *ptr)
if (!payload->file) {
/* file was NULL */
errno = EINVAL;
- free(payload);
+ dmnsn_free(payload);
return -1;
}
@@ -207,7 +207,7 @@ dmnsn_png_write_canvas_thread(void *ptr)
= png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr) {
/* Couldn't create libpng write struct */
- free(payload);
+ dmnsn_free(payload);
return -1;
}
@@ -215,7 +215,7 @@ dmnsn_png_write_canvas_thread(void *ptr)
if (!info_ptr) {
/* Couldn't create libpng info struct */
png_destroy_write_struct(&png_ptr, NULL);
- free(payload);
+ dmnsn_free(payload);
return -1;
}
@@ -223,9 +223,9 @@ dmnsn_png_write_canvas_thread(void *ptr)
uint16_t *row = NULL;
if (setjmp(png_jmpbuf(png_ptr))) {
/* libpng error */
- free(row);
+ dmnsn_free(row);
png_destroy_write_struct(&png_ptr, &info_ptr);
- free(payload);
+ dmnsn_free(payload);
return -1;
}
@@ -264,7 +264,7 @@ dmnsn_png_write_canvas_thread(void *ptr)
/* Finish the PNG file */
png_write_end(png_ptr, info_ptr);
png_destroy_write_struct(&png_ptr, &info_ptr);
- free(payload);
+ dmnsn_free(payload);
return 0;
}
}
@@ -323,9 +323,9 @@ dmnsn_png_write_canvas_thread(void *ptr)
/* Finish the PNG file */
png_write_end(png_ptr, info_ptr);
- free(row);
+ dmnsn_free(row);
png_destroy_write_struct(&png_ptr, &info_ptr);
- free(payload);
+ dmnsn_free(payload);
return 0;
}
@@ -409,8 +409,8 @@ dmnsn_png_read_canvas_thread(void *ptr)
png_bytep *row_pointers = NULL;
if (setjmp(png_jmpbuf(png_ptr))) {
/* libpng error */
- free(row_pointers);
- free(image);
+ dmnsn_free(row_pointers);
+ dmnsn_free(image);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return -1;
}
@@ -559,10 +559,10 @@ dmnsn_png_read_canvas_thread(void *ptr)
}
}
- free(row_pointers);
- free(image);
+ dmnsn_free(row_pointers);
+ dmnsn_free(image);
png_read_end(png_ptr, NULL);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- free(payload);
+ dmnsn_free(payload);
return 0;
}