From 93a53bc4fbf93eb23ac9520b7c653f488028a891 Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Tue, 23 Jan 2024 09:40:51 +0100 Subject: [PATCH] rtp: sess - fix coverity warning --- src/rtp/sess.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rtp/sess.c b/src/rtp/sess.c index c53873122..f577325d2 100644 --- a/src/rtp/sess.c +++ b/src/rtp/sess.c @@ -466,9 +466,14 @@ static int mk_sr(struct rtcp_sess *sess, struct mbuf *mb) static int sdes_encode_handler(struct mbuf *mb, void *arg) { struct rtcp_sess *sess = arg; + int err; - return rtcp_sdes_encode(mb, rtp_sess_ssrc(sess->rs), 1, + mtx_lock(sess->lock); + err = rtcp_sdes_encode(mb, rtp_sess_ssrc(sess->rs), 1, RTCP_SDES_CNAME, sess->cname); + mtx_unlock(sess->lock); + + return err; }