[gnome-packagekit] Fix two potential crashers when gpk-update-viewer has finished applying updates
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Fix two potential crashers when gpk-update-viewer has finished applying updates
- Date: Tue, 19 Jan 2010 15:12:32 +0000 (UTC)
commit bfb2e869f9cc5ee6c44b434e53ff6c03ac4c70fd
Author: Richard Hughes <richard hughsie com>
Date: Tue Jan 19 15:12:06 2010 +0000
Fix two potential crashers when gpk-update-viewer has finished applying updates
src/gpk-update-viewer.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index a6be3ca..5bdfe75 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -452,7 +452,6 @@ gpk_update_viewer_update_packages_cb (PkTask *task, GAsyncResult *res, GpkUpdate
/* check blocked */
array = pk_results_get_package_array (results);
gpk_update_viewer_check_blocked_packages (update_viewer, array);
- g_ptr_array_unref (array);
/* check restart */
if (priv->restart_update == PK_RESTART_ENUM_SYSTEM ||
@@ -583,10 +582,12 @@ static void
gpk_update_viewer_add_active_row (GtkTreeModel *model, GtkTreePath *path)
{
GtkTreeRowReference *ref;
- GSList *link;
+ GSList *link = NULL;
/* check if already active */
ref = gtk_tree_row_reference_new (model, path);
+ if (ref == NULL)
+ goto out;
link = g_slist_find_custom (active_rows, (gconstpointer)ref, (GCompareFunc)gpk_update_viewer_compare_refs);
if (link != NULL) {
egg_debug ("already active");
@@ -600,7 +601,7 @@ gpk_update_viewer_add_active_row (GtkTreeModel *model, GtkTreePath *path)
active_rows = g_slist_prepend (active_rows, ref);
out:
- g_slist_free (link);
+ return;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]