[asterisk-commits] coreyfarrell: branch group/media_formats-reviewed-trunk r418417 - in /team/gr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 11 17:26:11 CDT 2014


Author: coreyfarrell
Date: Fri Jul 11 17:26:01 2014
New Revision: 418417

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418417
Log:
Fix double-unref of fmt in sip_new

* Remove early unref of fmt from sip_new.  Also remove unneeded conditional.
* Ensure fr->mallocd == 0 after __frame_free.

Review: https://reviewboard.asterisk.org/r/3751/

Modified:
    team/group/media_formats-reviewed-trunk/channels/chan_sip.c
    team/group/media_formats-reviewed-trunk/main/frame.c

Modified: team/group/media_formats-reviewed-trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/channels/chan_sip.c?view=diff&rev=418417&r1=418416&r2=418417
==============================================================================
--- team/group/media_formats-reviewed-trunk/channels/chan_sip.c (original)
+++ team/group/media_formats-reviewed-trunk/channels/chan_sip.c Fri Jul 11 17:26:01 2014
@@ -8100,11 +8100,8 @@
 	ast_format_cap_append_from_cap(caps, what, AST_MEDIA_TYPE_UNKNOWN);
 	/* Use only the preferred audio format, which is stored at the '0' index */
 	fmt = ast_format_cap_get_best_by_type(what, AST_MEDIA_TYPE_AUDIO); /* get the best audio format */
-	if (fmt) {
-		ast_format_cap_remove_by_type(caps, AST_MEDIA_TYPE_AUDIO); /* remove only the other audio formats */
-		ast_format_cap_append(caps, fmt, 0); /* add our best choice back */
-		ao2_ref(fmt, -1);
-	}
+	ast_format_cap_remove_by_type(caps, AST_MEDIA_TYPE_AUDIO); /* remove only the other audio formats */
+	ast_format_cap_append(caps, fmt, 0); /* add our best choice back */
 	ast_channel_nativeformats_set(tmp, caps);
 	ao2_ref(caps, -1);
 

Modified: team/group/media_formats-reviewed-trunk/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/main/frame.c?view=diff&rev=418417&r1=418416&r2=418417
==============================================================================
--- team/group/media_formats-reviewed-trunk/main/frame.c (original)
+++ team/group/media_formats-reviewed-trunk/main/frame.c Fri Jul 11 17:26:01 2014
@@ -155,6 +155,8 @@
 		}
 
 		ast_free(fr);
+	} else {
+		fr->mallocd = 0;
 	}
 }
 




More information about the asterisk-commits mailing list