summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-08-02 15:11:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:09 -0500
commitd2900ddf1121f777ec8b28620fa93637b58e2a59 (patch)
tree152aebde35213788ffea7fe2dec76098ae41a3f5 /source3
parent82e80e023b580bd90153e893b985f386b7b7b960 (diff)
downloadsamba-d2900ddf1121f777ec8b28620fa93637b58e2a59.tar.gz
samba-d2900ddf1121f777ec8b28620fa93637b58e2a59.tar.bz2
samba-d2900ddf1121f777ec8b28620fa93637b58e2a59.zip
r24128: fix double free in error path
metze (This used to be commit 29e2d8e044c9213643a2f5f29891ce853a839347)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/sasl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
index 5c4006e769..c727c8b50a 100644
--- a/source3/libads/sasl.c
+++ b/source3/libads/sasl.c
@@ -962,11 +962,10 @@ static ADS_STATUS ads_sasl_gssapi_do_bind(ADS_STRUCT *ads, const gss_name_t serv
&output_token,
&ret_flags,
NULL);
-
- if (input_token.value) {
- gss_release_buffer(&minor_status, &input_token);
+ if (scred) {
+ ber_bvfree(scred);
+ scred = NULL;
}
-
if (gss_rc && gss_rc != GSS_S_CONTINUE_NEEDED) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
@@ -999,13 +998,15 @@ static ADS_STATUS ads_sasl_gssapi_do_bind(ADS_STRUCT *ads, const gss_name_t serv
gss_rc = gss_unwrap(&minor_status,context_handle,&input_token,&output_token,
&conf_state,NULL);
+ if (scred) {
+ ber_bvfree(scred);
+ scred = NULL;
+ }
if (gss_rc) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
}
- gss_release_buffer(&minor_status, &input_token);
-
p = (uint8 *)output_token.value;
#if 0