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
This commit is contained in:
Corey Farrell
2017-10-13 09:51:09 -04:00
parent 28a3ff75d5
commit 89f11364f6

View File

@@ -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 */