summaryrefslogtreecommitdiff
path: root/source4/libcli/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/auth')
-rw-r--r--source4/libcli/auth/spnego.c2
-rw-r--r--source4/libcli/auth/spnego_parse.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/auth/spnego.c b/source4/libcli/auth/spnego.c
index 696240f8d6..bbf8f86676 100644
--- a/source4/libcli/auth/spnego.c
+++ b/source4/libcli/auth/spnego.c
@@ -528,6 +528,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
nt_status = gensec_set_target_principal(gensec_security,
spnego.negTokenInit.targetPrincipal);
if (!NT_STATUS_IS_OK(nt_status)) {
+ spnego_free_data(&spnego);
return nt_status;
}
}
@@ -540,6 +541,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
&unwrapped_out);
if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED) && !NT_STATUS_IS_OK(nt_status)) {
+ spnego_free_data(&spnego);
return nt_status;
}
diff --git a/source4/libcli/auth/spnego_parse.c b/source4/libcli/auth/spnego_parse.c
index 047d17ce5a..20b766a4e2 100644
--- a/source4/libcli/auth/spnego_parse.c
+++ b/source4/libcli/auth/spnego_parse.c
@@ -54,6 +54,10 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, struct spnego_negTokenInit *token
talloc_realloc(token->mechTypes, (i + 2) *
sizeof(*token->mechTypes));
asn1_read_OID(asn1, token->mechTypes + i);
+ if (token->mechTypes[i]) {
+ talloc_steal(token->mechTypes,
+ token->mechTypes[i]);
+ }
}
token->mechTypes[i] = NULL;