From: Uri Simchoni Date: Sun, 3 Jul 2016 19:51:56 +0000 (+0300) Subject: s3-libads: fix a memory leak in ads_sasl_spnego_bind() X-Git-Tag: samba-4.3.12~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7dd545514a03debc5663541586438312e08b8ee;p=thirdparty%2Fsamba.git s3-libads: fix a memory leak in ads_sasl_spnego_bind() BUG: https://bugzilla.samba.org/show_bug.cgi?id=12006 Signed-off-by: Uri Simchoni Reviewed-by: Richard Sharpe Reviewed-by: Andreas Schneider (cherry picked from commit a646d9e796902dcb5246eb585433d4859796be2f) --- diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c index 10f63e89181..d76d8724ac0 100644 --- a/source3/libads/sasl.c +++ b/source3/libads/sasl.c @@ -696,7 +696,7 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads) struct berval *scred=NULL; int rc, i; ADS_STATUS status; - DATA_BLOB blob; + DATA_BLOB blob = data_blob_null; char *given_principal = NULL; char *OIDs[ASN1_MAX_OIDS]; #ifdef HAVE_KRB5 @@ -792,6 +792,9 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads) done: ads_free_service_principal(&p); TALLOC_FREE(frame); + if (blob.data != NULL) { + data_blob_free(&blob); + } return status; }