diff options
author | Richard Mudgett <rmudgett@digium.com> | 2010-05-21 22:46:52 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2010-05-21 22:46:52 +0000 |
commit | ba8e183938140fbe1a2627d5823e7d774351f35d (patch) | |
tree | cbe7ed66c9588f04d434218aa8d2b8995ed08902 /funcs | |
parent | 1225ee831cda3ee6906c0c79787d71b1e6a1e20e (diff) |
Channel initialization failure causes crashes.
__ast_channel_alloc_ap() has several points in the initialization of a new
channel structure where it could fail. Since the channel structure is now
an ao2 object, the destructor callback needs to be able to handle clean up
when the structure setup is incomplete.
Problems corrected:
1) Failing to setup the alertpipe would not unreference the structure but
free it directly. Doing this to an ao2_object is very bad.
2) File descriptors need to be initialized to -1 before a construction
failure could occur so the destructor will not close unopened descriptors.
3) The destructor needs to check that the string field has been
initialized before using any string field values. Crashes expected.
4) The destructor should not notify devstate if the device name is empty.
It is a waste of cycles and a couple ERROR log messages are generated.
Review: https://reviewboard.asterisk.org/r/675/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
0 files changed, 0 insertions, 0 deletions