[asterisk-commits] jrose: branch 11 r401787 - in /branches/11: ./ main/jitterbuf.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 24 14:41:09 CDT 2013


Author: jrose
Date: Thu Oct 24 14:41:07 2013
New Revision: 401787

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401787
Log:
jitterbuf: Fix memory leak on jitter buffer reset

(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
    jitterbuf-jb_reset-leak-1.8.patch
    jitterbuf-jb_reset-leak-11up.patch
........

Merged revisions 401786 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/main/jitterbuf.c

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

Modified: branches/11/main/jitterbuf.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/jitterbuf.c?view=diff&rev=401787&r1=401786&r2=401787
==============================================================================
--- branches/11/main/jitterbuf.c (original)
+++ branches/11/main/jitterbuf.c Thu Oct 24 14:41:07 2013
@@ -73,10 +73,12 @@
 
 void jb_reset(jitterbuf *jb)
 {
-	/* only save settings */
+	/* only save settings and free list */
 	jb_conf s = jb->info.conf;
+	jb_frame *fr = jb->free;
 	memset(jb, 0, sizeof(*jb));
 	jb->info.conf = s;
+	jb->free = fr;
 
 	/* initialize length, using the default value */
 	jb->info.current = jb->info.target = jb->info.conf.target_extra = JB_TARGET_EXTRA;
@@ -87,7 +89,7 @@
 {
 	jitterbuf *jb;
 
-	if (!(jb = ast_malloc(sizeof(*jb))))
+	if (!(jb = ast_calloc(1, sizeof(*jb))))
 		return NULL;
 
 	jb_reset(jb);




More information about the asterisk-commits mailing list