]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_enum] Fix use-after-free if creating resolver from file failed
authorTomasz Ostrowski <43222462+tomek-o@users.noreply.github.com>
Tue, 28 Mar 2023 14:36:01 +0000 (16:36 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2023 14:36:01 +0000 (17:36 +0300)
src/mod/applications/mod_enum/mod_enum.c

index 2908a1eb1e942088b0e20f2c0f89c1679bc9898f..aa87f24826348346ebb1eb333b9401fb1d332e01 100644 (file)
@@ -497,6 +497,7 @@ switch_status_t ldns_lookup(const char *number, const char *root, char *server_n
                /* create a new resolver from /etc/resolv.conf */
                if (res) {
                        ldns_resolver_free(res);
+                       res = NULL;
                }
                s = ldns_resolver_new_frm_file(&res, NULL);
        }