We were freeing the row buffer twice on the error path, and not at all
on the success path.
}
if (setjmp(png_jmpbuf(png))) {
}
if (setjmp(png_jmpbuf(png))) {
png_destroy_write_struct(&png, &info);
goto err;
}
png_destroy_write_struct(&png, &info);
goto err;
}
png_destroy_write_struct(&png, &info);
fclose(of);
png_destroy_write_struct(&png, &info);
fclose(of);
if (verbose)
printf("wrote %s\n", name);
if (verbose)
printf("wrote %s\n", name);
err:
fclose(of);
remove(name);
err:
fclose(of);
remove(name);