Skip to content
Snippets Groups Projects
Commit 51b75efb authored by Andreas Schenk's avatar Andreas Schenk
Browse files

fixed small memory leak in png io

parent bdbb502c
Branches
Tags
No related merge requests found
......@@ -226,12 +226,12 @@ void MapIOPngHandler::Export(const img::MapHandle& image, std::ostream& f,const
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
throw IOException("png: error creating info_struct");
}
if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
png_destroy_write_struct(&png_ptr, &info_ptr);
throw IOException("png: error setting jmpbuf");
}
......@@ -293,7 +293,7 @@ void MapIOPngHandler::Export(const img::MapHandle& image, std::ostream& f,const
png_write_end(png_ptr, info_ptr);
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
png_destroy_write_struct(&png_ptr, &info_ptr);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment