[rhythmbox] property-model: fix potential free of uninitialized pointer



commit ad9061c654e3c3050346be97c60e7f6769799f58
Author: Maxime Villard <max m00nbsd net>
Date:   Tue Oct 1 21:00:54 2013 +1000

    property-model: fix potential free of uninitialized pointer

 rhythmdb/rhythmdb-property-model.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rhythmdb/rhythmdb-property-model.c b/rhythmdb/rhythmdb-property-model.c
index 4facbce..7446e38 100644
--- a/rhythmdb/rhythmdb-property-model.c
+++ b/rhythmdb/rhythmdb-property-model.c
@@ -1285,9 +1285,9 @@ rhythmdb_property_model_drag_data_get (RbTreeDragSource *dragsource,
                        GPtrArray *subquery = g_ptr_array_new ();
 
                        for (row = paths; row; row = row->next) {
-                               char* name;
                                path = gtk_tree_row_reference_get_path (row->data);
                                if (path && gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path)) {
+                                       char *name;
                                        gtk_tree_model_get (GTK_TREE_MODEL (model), &iter,
                                                            RHYTHMDB_PROPERTY_MODEL_COLUMN_TITLE,
                                                            &name, -1);
@@ -1303,10 +1303,10 @@ rhythmdb_property_model_drag_data_get (RbTreeDragSource *dragsource,
                                                                       model->priv->propid, name,
                                                                       RHYTHMDB_QUERY_END);
                                        }
+                                       g_free (name);
                                }
 
                                gtk_tree_path_free (path);
-                               g_free (name);
                        }
 
                        g_object_set (query_model,


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