From a75fd32212c35b41143442bd757387fad636177a Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Wed, 3 Jul 2013 17:58:45 +0000 Subject: ARI - channel recording support This patch is the first step in adding recording support to the Asterisk REST Interface. Recordings are stored in /var/spool/recording. Since recordings may be destructive (overwriting existing files), the API rejects attempts to escape the recording directory (avoiding issues if someone attempts to record to ../../lib/sounds/greeting, for example). (closes issue ASTERISK-21594) (closes issue ASTERISK-21581) Review: https://reviewboard.asterisk.org/r/2612/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393550 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/file.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main/file.c') diff --git a/main/file.c b/main/file.c index 016afd197..cb495b310 100644 --- a/main/file.c +++ b/main/file.c @@ -1020,6 +1020,9 @@ int ast_closestream(struct ast_filestream *f) * We close the stream in order to quit queuing frames now, because we might * change the writeformat, which could result in a subsequent write error, if * the format is different. */ + if (f == NULL) { + return 0; + } filestream_close(f); ao2_ref(f, -1); return 0; -- cgit v1.2.3