From: Tony Cook Date: Tue, 7 Mar 2006 12:06:50 +0000 (+0000) Subject: removed unreachable code (mymalloc() succeeds or exit()s) X-Git-Tag: Imager-0.51_01~41 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/435e4a7d769951aefcc9b483f692b26d731b9aa2 removed unreachable code (mymalloc() succeeds or exit()s) --- diff --git a/png.c b/png.c index aeb8e59c..5ea25ce0 100644 --- a/png.c +++ b/png.c @@ -162,17 +162,11 @@ i_writepng_wiol(i_img *im, io_glue *ig) { } else { unsigned char *data = mymalloc(im->xsize * im->channels); - if (data) { - for (y = 0; y < height; y++) { - i_gsamp(im, 0, im->xsize, y, data, NULL, im->channels); - png_write_row(png_ptr, (png_bytep)data); - } - myfree(data); - } - else { - png_destroy_write_struct(&png_ptr, info_ptr); - return 0; + for (y = 0; y < height; y++) { + i_gsamp(im, 0, im->xsize, y, data, NULL, im->channels); + png_write_row(png_ptr, (png_bytep)data); } + myfree(data); } png_write_end(png_ptr, info_ptr);