From 733b28935db87348d7bc407e352d30298ccd6527 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Thu, 24 Mar 2022 10:36:16 +0100 Subject: [PATCH] Fix memory leak in compile_huffman_tree --- src/huffman.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/huffman.c b/src/huffman.c index 477535e35..e14c7e194 100644 --- a/src/huffman.c +++ b/src/huffman.c @@ -312,6 +312,9 @@ compile_huffman_tree(br_huffman_table_t** table, } total_rows = 1; + + /*transfer new table back to parent*/ + *table = new_table; } else { *table = malloc(0); return HUFFMAN_EMPTY_TREE;