Free some strucs
This commit is contained in:
parent
e4d37542bb
commit
a38b5d4ec4
4 changed files with 17 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ void print_huffman_tree(tree t);
|
||||||
tree build_tree(char* bit_lengths, int size);
|
tree build_tree(char* bit_lengths, int size);
|
||||||
tree build_default_tree();
|
tree build_default_tree();
|
||||||
tree build_default_dist_tree();
|
tree build_default_dist_tree();
|
||||||
|
void free_tree(tree t);
|
||||||
|
|
||||||
int next_token(bitstream* bs, tree t);
|
int next_token(bitstream* bs, tree t);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ typedef struct zip
|
||||||
} zip;
|
} zip;
|
||||||
|
|
||||||
zip init_zip(char* data, int size);
|
zip init_zip(char* data, int size);
|
||||||
|
void free_zip(zip z);
|
||||||
|
|
||||||
void get_eocd(zip* out);
|
void get_eocd(zip* out);
|
||||||
void get_cdh(zip* out);
|
void get_cdh(zip* out);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,3 +160,8 @@ int next_token(bitstream* bs, tree t)
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void free_tree(tree t)
|
||||||
|
{
|
||||||
|
free(t.leaves);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,9 @@ char* decode_type1_block_vuln(bitstream* bs, char* decoded_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free_tree(tr);
|
||||||
|
free_tree(tr_dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* decode_type1_block_v2(
|
char* decode_type1_block_v2(
|
||||||
|
|
@ -165,3 +168,9 @@ int decode_distance_token(bitstream* bs, int token)
|
||||||
int extra = get_bits(bs, extra_bits_distance_codes[token]);
|
int extra = get_bits(bs, extra_bits_distance_codes[token]);
|
||||||
return distance_codes[token] + extra;
|
return distance_codes[token] + extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void free_zip(zip z)
|
||||||
|
{
|
||||||
|
free(z.cdh_filename_length);
|
||||||
|
free(z.lfh_off);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue