Minor code cleanup
This commit is contained in:
parent
a62d97f575
commit
862af7192c
@ -3,6 +3,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
@ -139,7 +139,8 @@ void xor_data(png_chunk *chunk) {
|
|||||||
|
|
||||||
void destroy_chunks(png_chunk **chunks) {
|
void destroy_chunks(png_chunk **chunks) {
|
||||||
unsigned int size = get_number_of_chunks(chunks);
|
unsigned int size = get_number_of_chunks(chunks);
|
||||||
for (int i = 0; i < size; i++) {
|
// +1 for IEND chunk
|
||||||
|
for (int i = 0; i < size + 1; i++) {
|
||||||
free(chunks[i]->data);
|
free(chunks[i]->data);
|
||||||
free(chunks[i]);
|
free(chunks[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user