From 2d5aeb9c2e09b9c22678f1a9acc9a37ad147c6c6 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 31 Jan 2023 19:45:55 +0100 Subject: [PATCH] MT#56128 Use a dedicated function to free the sdp_attribute Instead of using the g_slice_free1(), use a dedicated function to free sdp_attribute objects. Change-Id: I3f6c2acf45ec46f704f36108ecdf4e4c0ed05ce1 --- daemon/sdp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 6695c68a6..1bf5bd670 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -286,6 +286,9 @@ const str rtpe_instance_id = STR_CONST_INIT(__id_buf); static void attr_insert(struct sdp_attributes *attrs, struct sdp_attribute *attr); + +static void attr_free(void *p); + INLINE struct sdp_attribute *attr_get_by_id(struct sdp_attributes *a, int id) { return g_hash_table_lookup(a->id_hash, &id); } @@ -1222,7 +1225,7 @@ new_session: attr->line_value.len = line_end - value; if (parse_attribute(attr)) { - g_slice_free1(sizeof(*attr), attr); + attr_free(attr); break; } @@ -2714,6 +2717,7 @@ struct packet_stream *print_rtcp(GString *s, struct call_media *media, GList *rt } + static struct packet_stream *print_sdp_media_section(GString *s, struct call_media *media, struct sdp_media *sdp_media, struct sdp_ng_flags *flags,