[dia] [scan-build] Dereference of null pointer



commit a7ea1b357827d0eadcd63bd781e731a5be678b0a
Author: Hans Breuer <hans breuer org>
Date:   Tue Nov 1 14:07:01 2011 +0100

    [scan-build] Dereference of null pointer
    
    Just added another NULL pointer check to be on the safe side.

 app/undo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/app/undo.c b/app/undo.c
index bcdd4d3..bf060be 100644
--- a/app/undo.c
+++ b/app/undo.c
@@ -159,7 +159,8 @@ undo_delete_lowest_transaction(UndoStack *stack)
     stack->depth--;
     DEBUG_PRINTF(("Decreasing stack depth to: %d\n", stack->depth));
   }
-  change->prev = NULL;
+  if (change) /* play safe */
+    change->prev = NULL;
 }
 
 void



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