From 0bcfa67f0e36e65f5d14a5d1f8592a7ad943761f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 3 May 2006 10:05:08 +0000 Subject: r15410: Fix segfaults (This used to be commit e8de80afb9d13c5c84bf70c9de3083d8caba9eb8) --- source4/gtk/common/credentials.c | 6 ++++-- source4/gtk/common/select.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/gtk/common/credentials.c b/source4/gtk/common/credentials.c index 0646131b73..31e2bcf811 100644 --- a/source4/gtk/common/credentials.c +++ b/source4/gtk/common/credentials.c @@ -52,7 +52,8 @@ static void gtk_get_credentials(struct cli_credentials *credentials) gtk_table_attach(GTK_TABLE(table), entry_domain, 1,2,0,1, GTK_FILL, 0,0,0); gtk_entry_set_activates_default (GTK_ENTRY (entry_domain), TRUE); - if (credentials->domain_obtained != CRED_UNINITIALISED) { + if (credentials->domain_obtained != CRED_UNINITIALISED && + credentials->domain) { gtk_entry_set_text(GTK_ENTRY(entry_domain), credentials->domain); } @@ -75,7 +76,8 @@ static void gtk_get_credentials(struct cli_credentials *credentials) gtk_table_attach(GTK_TABLE(table),entry_password,1,2,3,4,GTK_FILL,0,0,0); gtk_entry_set_visibility (GTK_ENTRY (entry_password), FALSE); gtk_entry_set_activates_default (GTK_ENTRY (entry_password), TRUE); - if (credentials->password_obtained != CRED_UNINITIALISED) { + if (credentials->password_obtained != CRED_UNINITIALISED && + credentials->password) { gtk_entry_set_text(GTK_ENTRY(entry_password), credentials->password); } diff --git a/source4/gtk/common/select.c b/source4/gtk/common/select.c index 0547525cf3..5a0480ab28 100644 --- a/source4/gtk/common/select.c +++ b/source4/gtk/common/select.c @@ -293,11 +293,13 @@ struct dcerpc_pipe *gtk_connect_rpc_interface(TALLOC_CTX *mem_ctx, const struct if(!NT_STATUS_IS_OK(status)) { gtk_show_ntstatus(NULL, "While connecting to interface", status); gtk_widget_destroy(GTK_WIDGET(d)); - talloc_free(mem_ctx); + talloc_free(cred); return NULL; } gtk_widget_destroy(GTK_WIDGET(d)); + + talloc_free(cred); return pipe; } -- cgit