From 3ff081e58114753b7ed310d73f22d848251b6426 Mon Sep 17 00:00:00 2001 From: Naveen Albert Date: Tue, 26 Dec 2023 17:14:11 +0000 Subject: [PATCH] manager.c: Fix regression due to using wrong free function. Commit 424be345639d75c6cb7d0bd2da5f0f407dbd0bd5 introduced a regression by calling ast_free on memory allocated by realpath. This causes Asterisk to abort when executing this function. Since the memory is allocated by glibc, it should be freed using ast_std_free. Resolves: #513 --- main/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/manager.c b/main/manager.c index 336f64ff24..e7a8e9078d 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3675,7 +3675,7 @@ static int restrictedFile(const char *filename) { char *stripped_filename; RAII_VAR(char *, path, NULL, ast_free); - RAII_VAR(char *, real_path, NULL, ast_free); + RAII_VAR(char *, real_path, NULL, ast_std_free); if (live_dangerously) { return 0; -- 2.47.3