summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/reds.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/server/reds.c b/server/reds.c
index b5d185e1..30e3ac04 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2480,9 +2480,7 @@ static void reds_start_auth_sasl(RedLinkInfo *link)
if (err != SASL_OK) {
red_printf("cannot set SASL external SSF %d (%s)",
err, sasl_errstring(err, NULL, NULL));
- sasl_dispose(&sasl->conn);
- sasl->conn = NULL;
- goto error;
+ goto error_dispose;
}
} else {
sasl->wantSSF = 1;
@@ -2510,9 +2508,7 @@ static void reds_start_auth_sasl(RedLinkInfo *link)
if (err != SASL_OK) {
red_printf("cannot set SASL security props %d (%s)",
err, sasl_errstring(err, NULL, NULL));
- sasl_dispose(&sasl->conn);
- sasl->conn = NULL;
- goto error;
+ goto error_dispose;
}
err = sasl_listmech(sasl->conn,
@@ -2523,13 +2519,12 @@ static void reds_start_auth_sasl(RedLinkInfo *link)
&mechlist,
NULL,
NULL);
- if (err != SASL_OK) {
+ if (err != SASL_OK || mechlist == NULL) {
red_printf("cannot list SASL mechanisms %d (%s)",
err, sasl_errdetail(sasl->conn));
- sasl_dispose(&sasl->conn);
- sasl->conn = NULL;
- goto error;
+ goto error_dispose;
}
+
red_printf("Available mechanisms for client: '%s'", mechlist);
sasl->mechlist = spice_strdup(mechlist);
@@ -2549,6 +2544,9 @@ static void reds_start_auth_sasl(RedLinkInfo *link)
return;
+error_dispose:
+ sasl_dispose(&sasl->conn);
+ sasl->conn = NULL;
error:
reds_link_free(link);
return;