summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-06-18 11:16:16 +0200
committerAndrew Bartlett <abartlet@samba.org>2009-06-19 11:32:01 +1000
commit2627c6c0c2d3d96b3d458092ba8b090447a76a61 (patch)
tree9b3beebf9c689901eed3cd71a344809e36ca5436 /source4/utils
parent0376d056e58d76b7792a5512d84c07f703838b4d (diff)
downloadsamba-2627c6c0c2d3d96b3d458092ba8b090447a76a61.tar.gz
samba-2627c6c0c2d3d96b3d458092ba8b090447a76a61.tar.bz2
samba-2627c6c0c2d3d96b3d458092ba8b090447a76a61.zip
Fixed some uninitialised variables
I tried hard to not change the program logic. Should fix bug #6439.
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/ntlm_auth.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 1c9eabe09a..97a983c9cd 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -465,6 +465,9 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
if (!ev) {
exit(1);
}
+
+ mem_ctx = talloc_named(NULL, 0, "manage_gensec_request internal mem_ctx");
+
/* setup gensec */
if (!(state->gensec_state)) {
switch (stdio_helper_mode) {
@@ -475,6 +478,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
nt_status = gensec_client_start(NULL, &state->gensec_state, ev,
lp_gensec_settings(NULL, lp_ctx));
if (!NT_STATUS_IS_OK(nt_status)) {
+ talloc_free(mem_ctx);
exit(1);
}
@@ -488,6 +492,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx),
lp_iconv_convenience(lp_ctx), ev);
if (!msg) {
+ talloc_free(mem_ctx);
exit(1);
}
nt_status = auth_context_create_methods(mem_ctx,
@@ -498,17 +503,20 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
&auth_context);
if (!NT_STATUS_IS_OK(nt_status)) {
+ talloc_free(mem_ctx);
exit(1);
}
if (!NT_STATUS_IS_OK(gensec_server_start(state, ev,
lp_gensec_settings(state, lp_ctx),
auth_context, &state->gensec_state))) {
+ talloc_free(mem_ctx);
exit(1);
}
break;
}
default:
+ talloc_free(mem_ctx);
abort();
}
@@ -559,20 +567,21 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
nt_status = gensec_start_mech_by_oid(state->gensec_state, GENSEC_OID_NTLMSSP);
break;
default:
+ talloc_free(mem_ctx);
abort();
}
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1, ("GENSEC mech failed to start: %s\n", nt_errstr(nt_status)));
mux_printf(mux_id, "BH GENSEC mech failed to start\n");
+ talloc_free(mem_ctx);
return;
}
}
/* update */
- mem_ctx = talloc_named(NULL, 0, "manage_gensec_request internal mem_ctx");
-
+
if (strncmp(buf, "PW ", 3) == 0) {
state->set_password = talloc_strndup(state,
(const char *)in.data,