mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	res_pjsip_sdp_rtp fix leaking astobj2 ast_format
PR #700 added a preferred_format for the struct ast_rtp_codecs, but when set the preferred_format it leaks an astobj2 ast_format. In the next code ast_rtp_codecs_set_preferred_format(&codecs, ast_format_cap_get_format(joint, 0)); both functions ast_rtp_codecs_set_preferred_format and ast_format_cap_get_format increases the ao2 reference count. Fixes: #856
This commit is contained in:
		
				
					committed by
					
						![asterisk-org-access-app[bot]](/avatar/58a64b62d62d5b23df7bc832f016f9db?size=40) asterisk-org-access-app[bot]
						asterisk-org-access-app[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							e99184b3e7
						
					
				
				
					commit
					2acd9982de
				
			| @@ -544,7 +544,10 @@ static int set_caps(struct ast_sip_session *session, | ||||
| 			ast_format_cap_get_names(caps, &usbuf), | ||||
| 			ast_format_cap_get_names(peer, &thembuf)); | ||||
| 	} else { | ||||
| 		ast_rtp_codecs_set_preferred_format(&codecs, ast_format_cap_get_format(joint, 0)); | ||||
| 		struct ast_format *preferred_fmt = ast_format_cap_get_format(joint, 0); | ||||
|  | ||||
| 		ast_rtp_codecs_set_preferred_format(&codecs, preferred_fmt); | ||||
| 		ao2_ref(preferred_fmt, -1); | ||||
| 	} | ||||
|  | ||||
| 	if (is_offer) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user