mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
Bug 9486 - memory leak when opening a filestream
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@60660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
9
file.c
9
file.c
@@ -427,10 +427,15 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha
|
|||||||
s->fmt = f;
|
s->fmt = f;
|
||||||
s->trans = NULL;
|
s->trans = NULL;
|
||||||
s->filename = NULL;
|
s->filename = NULL;
|
||||||
if (s->fmt->format < AST_FORMAT_MAX_AUDIO)
|
if (s->fmt->format < AST_FORMAT_MAX_AUDIO) {
|
||||||
|
if (chan->stream)
|
||||||
|
ast_closestream(chan->stream);
|
||||||
chan->stream = s;
|
chan->stream = s;
|
||||||
else
|
} else {
|
||||||
|
if (chan->vstream)
|
||||||
|
ast_closestream(chan->vstream);
|
||||||
chan->vstream = s;
|
chan->vstream = s;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fclose(bfile);
|
fclose(bfile);
|
||||||
ast_log(LOG_WARNING, "Unable to open file on %s\n", fn);
|
ast_log(LOG_WARNING, "Unable to open file on %s\n", fn);
|
||||||
|
Reference in New Issue
Block a user