From: PeterHolik Date: Mon, 15 Jan 2024 11:28:15 +0000 (+0100) Subject: chan_rtp.c: MulticastRTP missing refcount without codec option X-Git-Tag: 21.2.0-rc1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=727a4cceec8bbee5c9c4529308010b66da9cfd38;p=thirdparty%2Fasterisk.git chan_rtp.c: MulticastRTP missing refcount without codec option Fixes: #529 (cherry picked from commit 3b46872a8f689898afe3f143b9316a8992dbb16a) --- diff --git a/channels/chan_rtp.c b/channels/chan_rtp.c index d6342c47c2..97fc2408c3 100644 --- a/channels/chan_rtp.c +++ b/channels/chan_rtp.c @@ -129,7 +129,8 @@ static struct ast_format *derive_format_from_cap(struct ast_format_cap *cap) * assignments. Signed linear @ 8kHz does not map, so if that is our * only capability, we force μ-law instead. */ - fmt = ast_format_ulaw; + ao2_ref(fmt, -1); + fmt = ao2_bump(ast_format_ulaw); } return fmt;