summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cbbda4e73..7cc91486a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17669,6 +17669,10 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
if (!peer && sip_cfg.autocreatepeer != AUTOPEERS_DISABLED) {
/* Create peer if we have autocreate mode enabled */
peer = temp_peer(name);
+ if (peer && !(peer->endpoint = ast_endpoint_create("SIP", name))) {
+ ao2_t_ref(peer, -1, "failed to allocate Stasis endpoint, drop peer");
+ peer = NULL;
+ }
if (peer) {
ao2_t_link(peers, peer, "link peer into peer table");
if (!ast_sockaddr_isnull(&peer->addr)) {