aboutsummaryrefslogtreecommitdiff
path: root/src/xz
diff options
context:
space:
mode:
Diffstat (limited to 'src/xz')
-rw-r--r--src/xz/coder.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xz/coder.c b/src/xz/coder.c
index af49f430..841f63a4 100644
--- a/src/xz/coder.c
+++ b/src/xz/coder.c
@@ -67,6 +67,15 @@ extern void
coder_set_preset(size_t new_preset)
{
preset_number = new_preset;
+
+ // Setting a preset makes us forget a possibly defined custom
+ // filter chain.
+ while (filters_count > 0) {
+ --filters_count;
+ free(filters[filters_count].options);
+ filters[filters_count].options = NULL;
+ }
+
return;
}