From 1e2a82db9241b48d8ca61e1caa27fc71a20c8c1f Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sun, 15 Feb 2026 18:35:18 +0100 Subject: [PATCH] better clean up --- src/fm95.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fm95.c b/src/fm95.c index 3a7ad67..79d178a 100644 --- a/src/fm95.c +++ b/src/fm95.c @@ -133,8 +133,9 @@ void show_help(char *name) { void cleanup_runtime(FM95_Runtime* runtime, const FM95_Config config) { if(config.lpf_cutoff != 0) { - iirfilt_rrrf_destroy(runtime->lpf_l); - iirfilt_rrrf_destroy(runtime->lpf_r); + if(runtime->lpf_l != NULL) iirfilt_rrrf_destroy(runtime->lpf_l); + if(runtime->lpf_r != NULL) iirfilt_rrrf_destroy(runtime->lpf_r); + runtime->lpf_l = runtime->lpf_r = NULL; } exit_stereo_encoder(&runtime->stencode); }