seahorse r2857 - in trunk: . pgp pkcs11 src



Author: nnielsen
Date: Sat Feb 28 06:21:13 2009
New Revision: 2857
URL: http://svn.gnome.org/viewvc/seahorse?rev=2857&view=rev

Log:
Fix problems highlighted by valgrind, using uninitialized variables, and
freeing non-allocated memory.

Modified:
   trunk/ChangeLog
   trunk/pgp/seahorse-pgp-key.c
   trunk/pkcs11/seahorse-pkcs11-operations.c
   trunk/src/seahorse-key-manager.c

Modified: trunk/pgp/seahorse-pgp-key.c
==============================================================================
--- trunk/pgp/seahorse-pgp-key.c	(original)
+++ trunk/pgp/seahorse-pgp-key.c	Sat Feb 28 06:21:13 2009
@@ -77,7 +77,7 @@
 	GList *uids = seahorse_pgp_key_get_uids (self);
 	return uids ? seahorse_pgp_uid_calc_label (seahorse_pgp_uid_get_name (uids->data),
 	                                           seahorse_pgp_uid_get_email (uids->data),
-	                                           seahorse_pgp_uid_get_comment (uids->data)) : "";
+	                                           seahorse_pgp_uid_get_comment (uids->data)) : g_strdup ("");
 }
 
 static gchar* 
@@ -86,7 +86,7 @@
 	GList *uids = seahorse_pgp_key_get_uids (self);
 	return uids ? seahorse_pgp_uid_calc_markup (seahorse_pgp_uid_get_name (uids->data),
 	                                            seahorse_pgp_uid_get_email (uids->data),
-	                                            seahorse_pgp_uid_get_comment (uids->data), flags) : "";
+	                                            seahorse_pgp_uid_get_comment (uids->data), flags) : g_strdup ("");
 }
 
 /* -----------------------------------------------------------------------------

Modified: trunk/pkcs11/seahorse-pkcs11-operations.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-operations.c	(original)
+++ trunk/pkcs11/seahorse-pkcs11-operations.c	Sat Feb 28 06:21:13 2009
@@ -116,6 +116,7 @@
 	/* Remove all objects that were found, from the check table */
 	for (l = objects; l; l = g_list_next (l)) {
 		seahorse_pkcs11_source_receive_object (self->source, l->data);
+		handle = gp11_object_get_handle (l->data);
 		g_hash_table_remove (self->checks, &handle);
 	}
 

Modified: trunk/src/seahorse-key-manager.c
==============================================================================
--- trunk/src/seahorse-key-manager.c	(original)
+++ trunk/src/seahorse-key-manager.c	Sat Feb 28 06:21:13 2009
@@ -868,7 +868,6 @@
 	SeahorseKeyManager *self = SEAHORSE_KEY_MANAGER (G_OBJECT_CLASS (seahorse_key_manager_parent_class)->constructor(type, n_props, props));
 	GtkActionGroup* actions;
 	GtkToggleAction* action;
-	GtkTargetEntry* entries;
 	GtkTargetList* targets;
 	GtkWidget* widget;
 
@@ -985,7 +984,7 @@
 	/* Setup drops */
 	gtk_drag_dest_set (GTK_WIDGET (seahorse_viewer_get_window (SEAHORSE_VIEWER (self))), 
 	                   GTK_DEST_DEFAULT_ALL, NULL, 0, GDK_ACTION_COPY);
-	targets = gtk_target_list_new (entries, 0);
+	targets = gtk_target_list_new (NULL, 0);
 	gtk_target_list_add_uri_targets (targets, TARGETS_URIS);
 	gtk_target_list_add_text_targets (targets, TARGETS_PLAIN);
 	gtk_drag_dest_set_target_list (GTK_WIDGET (seahorse_viewer_get_window (SEAHORSE_VIEWER (self))), targets);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]