From 7545db9992ef48edf2f763e4b9c45d570449f2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E9=9C=96=E6=99=B4=E5=AD=90?= Date: Tue, 11 Jun 2024 17:16:27 -0400 Subject: [PATCH] juice, refactor: return the corresponding error code when binding the port fails. --- juice/src/conn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/juice/src/conn.c b/juice/src/conn.c index ccb453bea..39ba4135c 100644 --- a/juice/src/conn.c +++ b/juice/src/conn.c @@ -266,6 +266,9 @@ int juice_bind_stun(const char *bind_address, int local_port, juice_cb_stun_bind conn_registry_t *registry = acquire_registry(entry, &config); mutex_unlock(&entry->mutex); + if (!registry) + return -2; + registry->cb_stun_binding = cb; mutex_unlock(®istry->mutex);