Author: kharwell
Date: Thu Feb 26 11:07:50 2015
New Revision: 432363

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432363
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

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

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

Modified: branches/13/apps/app_chanspy.c
URL: 
http://svnview.digium.com/svn/asterisk/branches/13/apps/app_chanspy.c?view=diff&rev=432363&r1=432362&r2=432363
==============================================================================
--- branches/13/apps/app_chanspy.c (original)
+++ branches/13/apps/app_chanspy.c Thu Feb 26 11:07:50 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: branches/13/main/channel.c
URL: 
http://svnview.digium.com/svn/asterisk/branches/13/main/channel.c?view=diff&rev=432363&r1=432362&r2=432363
==============================================================================
--- branches/13/main/channel.c (original)
+++ branches/13/main/channel.c Thu Feb 26 11:07:50 2015
@@ -2824,14 +2824,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:


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to