summaryrefslogtreecommitdiff
path: root/modules/dtmfio/dtmfio.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-03-26 16:59:30 +0200
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-03-26 16:59:30 +0200
commit456f263445770616a424022780e7feebd881a061 (patch)
tree14ab4634151ee27dcd010384fa4bcfdf600ba7ed /modules/dtmfio/dtmfio.c
parentc83995676d8e706a85dd226b4bca57f2cef1e277 (diff)
dtmfio: check fd before calling fclose (ref #224)
Diffstat (limited to 'modules/dtmfio/dtmfio.c')
-rw-r--r--modules/dtmfio/dtmfio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/dtmfio/dtmfio.c b/modules/dtmfio/dtmfio.c
index ce88743..e159888 100644
--- a/modules/dtmfio/dtmfio.c
+++ b/modules/dtmfio/dtmfio.c
@@ -130,7 +130,10 @@ static int module_close(void)
{
uag_event_unregister(ua_event_handler);
- fclose(fd);
+ if (fd) {
+ fclose(fd);
+ fd = NULL;
+ }
unlink(DTMF_OUT);