diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d927f06e39381d9a0338b4dcd48ec517c6b408ef..830a524cd4405bde92e45c9bcc2afa1181f9fb5e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17713,6 +17713,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)) {