From: Corey Farrell Date: Fri, 13 Oct 2017 13:51:09 +0000 (-0400) Subject: ast_bt_get_symbols: Prevent double-free. X-Git-Tag: 13.19.0-rc1~208^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89f11364f674c67454e12a91464eda74932fe86a;p=thirdparty%2Fasterisk.git ast_bt_get_symbols: Prevent double-free. It's possible for bfdobj to be created but syms not created. If syms was not allocated in the current loop iteration but was allocated in the previous iteration it would crash. ASTERISK-27340 Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363 --- diff --git a/main/backtrace.c b/main/backtrace.c index a1156467f7..1659890548 100644 --- a/main/backtrace.c +++ b/main/backtrace.c @@ -173,6 +173,7 @@ char **__ast_bt_get_symbols(void **addresses, size_t num_frames) if (bfdobj) { bfd_close(bfdobj); ast_std_free(syms); + syms = NULL; } /* Default output, if we cannot find the information within BFD */