]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk: fix memory leak
authorJean Aunis <jean.aunis@prescom.fr>
Wed, 29 Sep 2021 09:32:23 +0000 (11:32 +0200)
committerJean Aunis - Prescom <jean.aunis@prescom.fr>
Thu, 30 Sep 2021 06:43:24 +0000 (01:43 -0500)
Add missing reference decrement in rtp_deallocate_transport()

ASTERISK-29671

Change-Id: I8d22dbedb90e8dade0829b7a28372f404b07caa9

res/res_rtp_asterisk.c

index 8ede400da868fcf88b25a75eb36b2864fe73ab36..7b236becd4da2169ece2a94be86c9c4b59f4a708 100644 (file)
@@ -3994,6 +3994,11 @@ static void rtp_deallocate_transport(struct ast_rtp_instance *instance, struct a
                rtp->ice_active_remote_candidates = NULL;
        }
 
+       if (rtp->ice_proposed_remote_candidates) {
+               ao2_ref(rtp->ice_proposed_remote_candidates, -1);
+               rtp->ice_proposed_remote_candidates = NULL;
+       }
+
        if (rtp->ioqueue) {
                /*
                 * We cannot hold the instance lock because we could wait