channel.c: Fix segfault with Monitor(wav,file,i)
authorValentin Vidic <vvidic@valentin-vidic.from.hr>
Sun, 20 Jan 2019 18:15:51 +0000 (19:15 +0100)
committerValentin Vidic <vvidic@valentin-vidic.from.hr>
Sun, 20 Jan 2019 18:49:11 +0000 (19:49 +0100)
commit17f76d27cccce7058ae5e984dde5c805b379da99
treee9e78aa0884a7117916bae23860637e00bf2d542
parent2b8602e8cf59b83344cf3523ef7bd762e91f8854
channel.c: Fix segfault with Monitor(wav,file,i)

If the Monitor is started with the i option the read_stream will be
NULL. One code path in channel.c checks if write_stream is set but than
uses read_stream instead causing a segfault.

ASTERISK-28249

Change-Id: I1bae9126537be54895c7fea2d08dd9488d8cc525
main/channel.c