]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manager.c: Fix regression due to using wrong free function.
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 26 Dec 2023 17:14:11 +0000 (17:14 +0000)
committerAsterisk Development Team <asteriskteam@digium.com>
Wed, 21 Feb 2024 13:35:04 +0000 (13:35 +0000)
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
(cherry picked from commit 3ff081e58114753b7ed310d73f22d848251b6426)

main/manager.c

index 336f64ff248ee7b222a112e579064dbf2abd9577..e7a8e9078d08b561097bc4eced80fa6dee17fd71 100644 (file)
@@ -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;