[svn-commits] tilghman: branch 1.4 r149061 - /branches/1.4/apps/app_waitforsilence.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 14 15:09:06 CDT 2008


Author: tilghman
Date: Tue Oct 14 15:09:06 2008
New Revision: 149061

URL: http://svn.digium.com/view/asterisk?view=rev&rev=149061
Log:
Check correct values in the return of ast_waitfor(); also, get rid of a
possible memory leak.
(closes issue #13658)
 Reported by: explidous
 Patch by: me

Modified:
    branches/1.4/apps/app_waitforsilence.c

Modified: branches/1.4/apps/app_waitforsilence.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_waitforsilence.c?view=diff&rev=149061&r1=149060&r2=149061
==============================================================================
--- branches/1.4/apps/app_waitforsilence.c (original)
+++ branches/1.4/apps/app_waitforsilence.c Tue Oct 14 15:09:06 2008
@@ -107,13 +107,13 @@
 		res = ast_waitfor(chan, silencereqd);
 
 		/* Must have gotten a hangup; let's exit */
-		if (res <= 0) {
+		if (res < 0) {
 			f = NULL;
 			break;
 		}
 		
 		/* We waited and got no frame; sounds like digital silence or a muted digital channel */
-		if (!res) {
+		if (res == 0) {
 			dspsilence = silencereqd;
 		} else {
 			/* Looks like we did get a frame, so let's check it out */
@@ -122,6 +122,8 @@
 				break;
 			if (f && f->frametype == AST_FRAME_VOICE) {
 				ast_dsp_silence(sildet, f, &dspsilence);
+			}
+			if (f) {
 				ast_frfree(f);
 			}
 		}




More information about the svn-commits mailing list