From 608bc4538806298e449615d55f86eb324f1a6ee0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 6 Oct 2017 05:25:05 +0200 Subject: [PATCH] Prevent another memory leak --- libretro-common/formats/libchdr/huffman.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/formats/libchdr/huffman.c b/libretro-common/formats/libchdr/huffman.c index 8eafca01cd..09b3e62026 100644 --- a/libretro-common/formats/libchdr/huffman.c +++ b/libretro-common/formats/libchdr/huffman.c @@ -300,7 +300,10 @@ enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder, /* assign canonical codes for all nodes based on their code lengths */ error = huffman_assign_canonical_codes(decoder); if (error != HUFFERR_NONE) + { + delete_huffman_decoder(smallhuff); return error; + } /* build the lookup table */ huffman_build_lookup_table(decoder);