From: George Joseph Date: Mon, 8 Dec 2025 20:40:00 +0000 (-0700) Subject: endpoint.c: Plug a memory leak in ast_endpoint_shutdown(). X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf0ce4577ccda30d07925bb87c8c51b0575e83ea;p=thirdparty%2Fasterisk.git endpoint.c: Plug a memory leak in ast_endpoint_shutdown(). 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 --- diff --git a/main/endpoints.c b/main/endpoints.c index e27ae69c72..15691b239d 100644 --- a/main/endpoints.c +++ b/main/endpoints.c @@ -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)