]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
endpoint.c: Plug a memory leak in ast_endpoint_shutdown().
authorGeorge Joseph <gjoseph@sangoma.com>
Mon, 8 Dec 2025 20:40:00 +0000 (13:40 -0700)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 9 Dec 2025 19:39:16 +0000 (19:39 +0000)
Commit 26795be introduced a memory leak of ast_endpoint when
ast_endpoint_shutdown() was called. The leak occurs only if a configuration
change removes an endpoint and isn't related to call volume or the length of
time asterisk has been running.  An ao2_ref(-1) has been added to
ast_endpoint_shutdown() to plug the leak.

Resolves: #1635

main/endpoints.c

index e27ae69c7225dd1d0638031f27a74166402fa064..15691b239d9b93b8a45a190ad736e691c5082aed 100644 (file)
@@ -327,6 +327,7 @@ void ast_endpoint_shutdown(struct ast_endpoint *endpoint)
                        stasis_publish(ast_endpoint_topic(endpoint), message);
                }
        }
+       ao2_ref(endpoint, -1);
 }
 
 const char *ast_endpoint_get_tech(const struct ast_endpoint *endpoint)