]> 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)
committerNaveen Albert <asterisk@phreaknet.org>
Tue, 2 Jan 2024 12:06:58 +0000 (12:06 +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

main/manager.c

index 37e380ec6e23982f9e703988940942c9d2eb5192..48231b72f94ef7bfb9e3511e86302877e71e9fbf 100644 (file)
@@ -3763,7 +3763,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;