[asterisk-commits] file: branch 1.6.0 r182172 - in /branches/1.6.0: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 16 08:59:30 CDT 2009


Author: file
Date: Mon Mar 16 08:59:26 2009
New Revision: 182172

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=182172
Log:
Merged revisions 182171 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r182171 | file | 2009-03-16 10:58:24 -0300 (Mon, 16 Mar 2009) | 7 lines
  
  Fix a memory leak in the ast_answer / __ast_answer API call.
  
  For a channel that is not yet answered this API call will wait
  until a voice frame is received on the channel before returning.
  It does this by waiting for frames on the channel and reading them
  in. The frames read in were not freed when they should have been.
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/channel.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.0/main/channel.c?view=diff&rev=182172&r1=182171&r2=182172
==============================================================================
--- branches/1.6.0/main/channel.c (original)
+++ branches/1.6.0/main/channel.c Mon Mar 16 08:59:26 2009
@@ -1742,14 +1742,19 @@
 				}
 				f = ast_read(chan);
 				if (!f || (f->frametype == AST_FRAME_CONTROL && f->subclass == AST_CONTROL_HANGUP)) {
+					if (f) {
+						ast_frfree(f);
+					}
 					res = -1;
 					ast_debug(2, "Hangup of channel %s detected in answer routine\n", chan->name);
 					break;
 				}
 				if (f->frametype == AST_FRAME_VOICE) {
+					ast_frfree(f);
 					res = 0;
 					break;
 				}
+				ast_frfree(f);
 			}
 		}
 		break;




More information about the asterisk-commits mailing list