Author: jelmer
Date: 2006-05-03 10:05:08 +0000 (Wed, 03 May 2006)
New Revision: 15410

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15410

Log:
Fix segfaults

Modified:
   branches/SAMBA_4_0/source/gtk/common/credentials.c
   branches/SAMBA_4_0/source/gtk/common/select.c


Changeset:
Modified: branches/SAMBA_4_0/source/gtk/common/credentials.c
===================================================================
--- branches/SAMBA_4_0/source/gtk/common/credentials.c  2006-05-03 09:12:42 UTC 
(rev 15409)
+++ branches/SAMBA_4_0/source/gtk/common/credentials.c  2006-05-03 10:05:08 UTC 
(rev 15410)
@@ -52,7 +52,8 @@
        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 @@
        
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);
        }
 

Modified: branches/SAMBA_4_0/source/gtk/common/select.c
===================================================================
--- branches/SAMBA_4_0/source/gtk/common/select.c       2006-05-03 09:12:42 UTC 
(rev 15409)
+++ branches/SAMBA_4_0/source/gtk/common/select.c       2006-05-03 10:05:08 UTC 
(rev 15410)
@@ -293,11 +293,13 @@
        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;
 }

Reply via email to