mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-19 18:51:48 +00:00
b6831996881a6646aa56170b62496facde4ae7bd
Partially rewrite switch_xml_set_attr to fix memory leaks, uninitialized argument values and use-after free warnings from Clang static analyzer. Fixes these problems: - Add some comments and a new variable such that the code can more easily be audited / understood. - Always clear SWITCH_XML_DUP flag even if an error occurred to prevent free()'ing static strings on future invocations. - Keep the attribute list in a consistent state even if one of the memory allocation fails. - Keep allocation metadata in a consistent state when shrinking of the attribute lists fails. Previously the metadata was not updated, resulting in a wrong mapping from attributes to allocation flags. - Fix memory leaks when allocations fail. Previous behavior: invalid memory accesses are possible after a memory allocation failure, previous attributes may be lost. New behavior: attributes list is always valid, a new attribute is either set (or not), attributes can always be removed.
…
…
…
Description
FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
Multiple Licenses
273 MiB
Languages
C
65.1%
C++
21%
JavaScript
4.7%
Assembly
1.9%
Makefile
1.1%
Other
5.5%