summaryrefslogtreecommitdiff
path: root/res/res_monitor.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-05-10 20:56:09 +0000
committerKinsey Moore <kmoore@digium.com>2012-05-10 20:56:09 +0000
commitdd81b047dbf15a501b81354db505daf50703a1a0 (patch)
tree01754d4206c865653717baf23e47ed264f7a6b3d /res/res_monitor.c
parent8227f70cd70f497cb03c1f9aab63950bcd979d8b (diff)
Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_monitor.c')
-rw-r--r--res/res_monitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c
index 5482f549c..9aca24a0d 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -378,7 +378,9 @@ int AST_OPTIONAL_API_NAME(ast_monitor_start)(struct ast_channel *chan, const cha
O_CREAT|O_TRUNC|O_WRONLY, 0, AST_FILE_MODE))) {
ast_log(LOG_WARNING, "Could not create file %s\n",
monitor->write_filename);
- ast_closestream(monitor->read_stream);
+ if (monitor->read_stream) {
+ ast_closestream(monitor->read_stream);
+ }
ast_free(monitor);
UNLOCK_IF_NEEDED(chan, need_lock);
return -1;