(libchdr) Prevent memory leak

This commit is contained in:
twinaphex 2018-04-15 18:39:42 +02:00
parent dc7c4fea2d
commit bb05af0d92

View File

@ -294,7 +294,10 @@ enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder,
/* make sure we ended up with the right number */
if (curcode != decoder->numcodes)
{
delete_huffman_decoder(smallhuff);
return HUFFERR_INVALID_DATA;
}
/* assign canonical codes for all nodes based on their code lengths */
error = huffman_assign_canonical_codes(decoder);