PNG: Fix leak if you don't ask for metadata.

This commit is contained in:
Jeroen van Rijn committed 2021-06-21 22:47:54 +02:00
1 parent 922b511a24
commit d5e2b387fa
2 files changed
+4 -8

No files matched your search

+2 -4
View File
@@ -34,10 +34,8 @@ destroy :: proc(img: ^Image) {
}
bytes.buffer_destroy(&img.pixels);
if img.metadata_ptr != nil && img.metadata_type == Info {
// Clean up Info.
free(img.metadata_ptr);
}
// Clean up Info.
free(img.metadata_ptr);
/*
We don't need to do anything for the individual chunks.