[asterisk-commits] kpfleming: trunk r370431 - in /trunk: ./ main/frame.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 24 11:54:30 CDT 2012


Author: kpfleming
Date: Tue Jul 24 11:54:26 2012
New Revision: 370431

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370431
Log:
Rewrite a comment that didn't adequately explain the code it was documenting.
........

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

Merged revisions 370430 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/main/frame.c

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

Modified: trunk/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/frame.c?view=diff&rev=370431&r1=370430&r2=370431
==============================================================================
--- trunk/main/frame.c (original)
+++ trunk/main/frame.c Tue Jul 24 11:54:26 2012
@@ -491,8 +491,13 @@
 	out->datalen = f->datalen;
 	out->samples = f->samples;
 	out->delivery = f->delivery;
-	/* Set us as having malloc'd header only, so it will eventually
-	   get freed. */
+	/* Even though this new frame was allocated from the heap, we can't mark it
+	 * with AST_MALLOCD_HDR, AST_MALLOCD_DATA and AST_MALLOCD_SRC, because that
+	 * would cause ast_frfree() to attempt to individually free each of those
+	 * under the assumption that they were separately allocated. Since this frame
+	 * was allocated in a single allocation, we'll only mark it as if the header
+	 * was heap-allocated; this will result in the entire frame being properly freed.
+	 */
 	out->mallocd = AST_MALLOCD_HDR;
 	out->offset = AST_FRIENDLY_OFFSET;
 	if (out->datalen) {




More information about the asterisk-commits mailing list