RAII: Change order or variables in clang version
authorDiederik de Groot <dkgroot@talon.nl>
Sat, 5 Jan 2019 17:14:26 +0000 (18:14 +0100)
committerDiederik de Groot <dkgroot@talon.nl>
Sat, 5 Jan 2019 17:39:47 +0000 (18:39 +0100)
commit7bd30905fd8f385d65c0b9cb17898819f481c98e
treee39358f9ac7206925395faa162b44f190adcffa1
parent28dbb06e8ccf8d78a62d3df01e2b8abccdae87b9
RAII: Change order or variables in clang version

This prevents use-after-scope issues when unwinding the stack,
which happens in reverse order. The varname variable needs to
remain alive for the destruction to be able to access it.
Issue was found using clang + address-sanitizer.

ASTERISK-28232 #close

Change-Id: I00811c34ae910836a5fb6d22304528aef92624db
include/asterisk/utils.h