Fix small memory leak
This commit is contained in:
@@ -135,7 +135,10 @@ int writePNG(mazegrid_t const* g, char const* filename) {
|
||||
|
||||
exit:
|
||||
if (f != NULL) fclose(f);
|
||||
if (info_ptr != NULL) png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
|
||||
if (info_ptr != NULL) {
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
|
||||
png_destroy_info_struct(png_ptr, &info_ptr);
|
||||
}
|
||||
if (png_ptr != NULL) png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
|
||||
if (img != NULL) freeImageData(img);
|
||||
return code;
|
||||
|
||||
Reference in New Issue
Block a user