From 19e5ea3ac208bd81f4686c6814a13d27f938dd52 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 14 Jan 2025 08:19:08 -0400 Subject: [PATCH] MT#55283 introduce sdp_attr_append1 Helper function to append just one attribute No-op. Change-Id: I6076760250af4b7d5fe7f7490210e8f9c43f0d22 (cherry picked from commit 02a2dc1faccefe97263deb6fc13fdab8abdc2f54) (cherry picked from commit 139410023763ee4019f31f0caf3dabe106896b56) --- daemon/sdp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index b6b884e18..955cbf72a 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -1793,16 +1793,19 @@ void sdp_orig_free(sdp_origin *o) { g_slice_free1(sizeof(*o), o); } +static void sdp_attr_append1(sdp_attr_q *dst, const struct sdp_attribute *attr) { + if (!attr) + return; + struct sdp_attr *ac = sdp_attr_dup(attr); + t_queue_push_tail(dst, ac); +} // Duplicate all attributes from the source (parsed SDP attributes list) into // the destination (string-format attribute list) static void sdp_attr_append(sdp_attr_q *dst, attributes_q *attrs) { if (!attrs) return; - for (__auto_type ll = attrs->head; ll; ll = ll->next) { - __auto_type attr = ll->data; - struct sdp_attr *ac = sdp_attr_dup(attr); - t_queue_push_tail(dst, ac); - } + for (__auto_type ll = attrs->head; ll; ll = ll->next) + sdp_attr_append1(dst, ll->data); } // Duplicate all OTHER attributes from the source (parsed SDP attributes list) into // the destination (string-format attribute list)