Change data allocation

This commit is contained in:
atxr 2024-02-28 03:22:04 +01:00
parent 321daf3ac8
commit a8ad99cddd

View file

@ -49,6 +49,8 @@ bool detect_overlaps(zip zip)
bool scan_decoded_files(zip zip) bool scan_decoded_files(zip zip)
{ {
data* decoded = malloc(sizeof(data));
for (int i = 0; i < zip.entries; i++) for (int i = 0; i < zip.entries; i++)
{ {
LFH* lfh = (LFH*) (zip.start + zip.lfh_off[i]); LFH* lfh = (LFH*) (zip.start + zip.lfh_off[i]);
@ -61,7 +63,7 @@ bool scan_decoded_files(zip zip)
return true; return true;
} }
data* decoded = malloc(sizeof(data)); // Clean decoded struct and decode block if possible
decoded->buffer = decoded->clean = decoded->size = 0; decoded->buffer = decoded->clean = decoded->size = 0;
if (lfh->compression_method == COMP_NONE) if (lfh->compression_method == COMP_NONE)