aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-15 18:52:01 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-15 18:52:01 +0100
commit89b617910c363dfc50d07f5dffc28989dc26b811 (patch)
treee1057ae4f5e5cc4adf281183e082779949db9bcd
parentf172d049863a38f33e8b15a3e47d4904b2c81323 (diff)
downloaddabmux-89b617910c363dfc50d07f5dffc28989dc26b811.tar.gz
dabmux-89b617910c363dfc50d07f5dffc28989dc26b811.tar.bz2
dabmux-89b617910c363dfc50d07f5dffc28989dc26b811.zip
Fix output cleanup that could lead to segfaults
-rw-r--r--src/DabMux.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index ca0fb1a..89bb38b 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -1829,8 +1829,10 @@ EXIT:
(*subchannel)->operations.clean(&(*subchannel)->data);
}
for (output = outputs.begin() ; output != outputs.end(); ++output) {
- (*output)->output->Close();
- delete ((*output)->output);
+ if ((*output)->output) {
+ (*output)->output->Close();
+ delete ((*output)->output);
+ }
}
for_each(ensemble->components.begin(), ensemble->components.end(), free);