From c5dd86635e94d3ac5c7a00b85692eced1f58d7f5 Mon Sep 17 00:00:00 2001
From: Grzegorz Sluja <grzegorz.sluja@iopsys.eu>
Date: Mon, 27 Nov 2023 14:50:13 +0000
Subject: [PATCH] Fix memory leak in chan_voicemngr_request()

Replace ast_str_create() with ast_str_alloca() to avoid freeing.
---
 src/channels/chan_voicemngr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/channels/chan_voicemngr.c b/src/channels/chan_voicemngr.c
index 48f4632..4022752 100644
--- a/src/channels/chan_voicemngr.c
+++ b/src/channels/chan_voicemngr.c
@@ -3917,7 +3917,7 @@ static struct ast_channel *chan_voicemngr_request(const char *type, struct ast_f
 	struct chan_voicemngr_pvt *p;
 	struct chan_voicemngr_subchannel *sub = NULL;
 	struct ast_channel *tmp = NULL;
-	struct ast_str * buf = ast_str_create(256);
+	struct ast_str* buf = ast_str_alloca(256);
 	int line_id = -1;
 
 	ast_debug(3, "requestor=%p(%s), dest=[%s], type=[%s]\n", requestor, requestor ? ast_channel_name(requestor) : "",
-- 
GitLab