From: Stefan Metzmacher Date: Thu, 28 Jan 2016 14:50:06 +0000 (+0100) Subject: s3:clispnego: fix confusing warning in spnego_gen_krb5_wrap() X-Git-Tag: tevent-0.9.27~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14f1a94b6fb3a55be1e60fe0d28740f04fd94b3f;p=thirdparty%2Fsamba.git s3:clispnego: fix confusing warning in spnego_gen_krb5_wrap() asn1_extract_blob() stops further asn1 processing by setting has_error. Don't call asn1_has_error() after asn1_extract_blob() has been successful otherwise we get an "Failed to build krb5 wrapper at" message on success. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11702 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index 3300c85340a..82f13b7a375 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -262,14 +262,19 @@ DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const ui goto err; } + asn1_free(data); + data = NULL; + err: - if (asn1_has_error(data)) { - DEBUG(1, ("Failed to build krb5 wrapper at offset %d\n", - (int)asn1_current_ofs(data))); - } + if (data != NULL) { + if (asn1_has_error(data)) { + DEBUG(1, ("Failed to build krb5 wrapper at offset %d\n", + (int)asn1_current_ofs(data))); + } - asn1_free(data); + asn1_free(data); + } return ret; }