diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 289cf82c62ea9dff006c629ed984c48e98e95d58..f57479912134344f3ff3f2e53d75e76df3158664 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -23394,10 +23394,10 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
 				ast_log(LOG_NOTICE, "Failed to authenticate device %s for SUBSCRIBE\n", get_header(req, "From"));
 				transmit_response_reliable(p, "403 Forbidden", req);
 			}
-		}
 
-		pvt_set_needdestroy(p, "authentication failed");
-		return 0;
+			pvt_set_needdestroy(p, "authentication failed");
+			return 0;
+		}
 	}
 
 	/* At this point, authpeer cannot be NULL. Remember we hold a reference,