[asterisk-commits] kharwell: trunk r432364 - in /trunk: ./ apps/app_chanspy.c main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 26 11:12:14 CST 2015


Author: kharwell
Date: Thu Feb 26 11:12:12 2015
New Revision: 432364

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432364
Log:
app_chanspy, channel: fix frame leaks

Fixed a couple of frame leaks that were found during testing.

ASTERISK-24828 #close
Reported by: John Hardin
Review: https://reviewboard.asterisk.org/r/4445/
........

Merged revisions 432362 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 432363 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/apps/app_chanspy.c
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=432364&r1=432363&r2=432364
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Thu Feb 26 11:12:12 2015
@@ -698,6 +698,9 @@
 	while (ast_waitfor(chan, -1) > -1 && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) {
 		if (!(f = ast_read(chan)) || ast_check_hangup(chan)) {
 			running = -1;
+			if (f) {
+				ast_frfree(f);
+			}
 			break;
 		}
 

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=432364&r1=432363&r2=432364
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Thu Feb 26 11:12:12 2015
@@ -2827,14 +2827,14 @@
 				}
 			}
 
-			if (res == 0) {
-				ast_channel_lock(chan);
-				while ((cur = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
+			ast_channel_lock(chan);
+			while ((cur = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
+				if (res == 0) {
 					ast_queue_frame_head(chan, cur);
-					ast_frfree(cur);
 				}
-				ast_channel_unlock(chan);
-			}
+				ast_frfree(cur);
+			}
+			ast_channel_unlock(chan);
 		} while (0);
 		break;
 	default:




More information about the asterisk-commits mailing list