[dia] [scan-build] Null dereference (not really)



commit d53dff25f48ee737dbb26fe40856d34b79db5d52
Author: Hans Breuer <hans breuer org>
Date:   Sun Dec 13 14:01:27 2009 +0100

    [scan-build] Null dereference (not really)
    
    An extra assert to silence clang scan-build. Alternative would
    be to loop over i and list_iter at the same time.

 app/exit_dialog.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/app/exit_dialog.c b/app/exit_dialog.c
index 81b60a4..9f0ab28 100644
--- a/app/exit_dialog.c
+++ b/app/exit_dialog.c
@@ -316,6 +316,7 @@ get_selected_items (GtkWidget * dialog,
         list_iter = list;
         for(i = 0 ; i < selected_count ; i++)
         {
+            g_assert(list_iter!=NULL); /* can't be if g_slist_length works */
             exit_dialog_item_t * item = list_iter->data;
             (*items)->array[i].name = item->name;
             (*items)->array[i].path = item->path;



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