summaryrefslogtreecommitdiff
path: root/main/endpoints.c
diff options
context:
space:
mode:
authorScott Griepentrog <sgriepentrog@digium.com>2015-03-17 22:15:42 +0000
committerScott Griepentrog <sgriepentrog@digium.com>2015-03-17 22:15:42 +0000
commit8c65c9167ee6fe75c7e7f511d12480831f98dad3 (patch)
tree5cde1e58b672d19b1ca5cdc2c9ad6f128bddf37b /main/endpoints.c
parentf25b2653293d0d96479d3d83795f40828f0b7bb7 (diff)
Various: bugfixes found via chaos
Using DEBUG_CHAOS several instances of a null pointer crash, and one uninitialized variable were uncovered and fixed. Also added details on why Asterisk failed to initialize. Review: https://reviewboard.asterisk.org/r/4468/ ........ Merged revisions 433064 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/endpoints.c')
-rw-r--r--main/endpoints.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/endpoints.c b/main/endpoints.c
index 3a6f494c0..66ad4618e 100644
--- a/main/endpoints.c
+++ b/main/endpoints.c
@@ -472,7 +472,8 @@ struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
endpoint_snapshot_dtor,
AO2_ALLOC_OPT_LOCK_NOLOCK);
- if (ast_string_field_init(snapshot, 80) != 0) {
+ if (!snapshot || ast_string_field_init(snapshot, 80) != 0) {
+ ao2_cleanup(snapshot);
return NULL;
}