diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-20 18:06:48 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-20 18:06:48 +0000 |
commit | b2d12f85251b611e5c223c8a8dd5a2c33e79c461 (patch) | |
tree | 5ab33adcd3b8ea1bc888882660bcbf6a487588b7 /main/frame.c | |
parent | 93c58b4bdbdfa703e9fb4137b7dd01ce6df00075 (diff) |
There was an issue when attempting to reference an embedded
frame in a freed ast_filestream. This patch makes use of the
ao2 functions to make sure that we do not free an ast_filestream
structure until the embedded ast_frame has been "freed" as well.
(closes issue #13496)
Reported by: fst-onge
Patches:
filestream_frame_1_4.diff uploaded by putnopvut (license 60)
Tested by: putnopvut
Closes AST-89
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158126 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/frame.c')
-rw-r--r-- | main/frame.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/frame.c b/main/frame.c index d64fa09a7..6768d0a98 100644 --- a/main/frame.c +++ b/main/frame.c @@ -45,6 +45,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/linkedlists.h" #include "asterisk/translate.h" #include "asterisk/dsp.h" +#include "asterisk/file.h" #ifdef TRACE_FRAMES static int headers; @@ -320,10 +321,13 @@ static void frame_cache_cleanup(void *data) void ast_frame_free(struct ast_frame *fr, int cache) { - if (ast_test_flag(fr, AST_FRFLAG_FROM_TRANSLATOR)) + if (ast_test_flag(fr, AST_FRFLAG_FROM_TRANSLATOR)) { ast_translate_frame_freed(fr); - else if (ast_test_flag(fr, AST_FRFLAG_FROM_DSP)) + } else if (ast_test_flag(fr, AST_FRFLAG_FROM_DSP)) { ast_dsp_frame_freed(fr); + } else if (ast_test_flag(fr, AST_FRFLAG_FROM_FILESTREAM)) { + ast_filestream_frame_freed(fr); + } if (!fr->mallocd) return; |