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



commit 5ecdc99bc12e501ee7a33995e616ced70c51a933
Author: Hans Breuer <hans breuer org>
Date:   Tue Nov 1 13:49:41 2011 +0100

    [scan-build] Dereference of null pointer
    
    Should just have been th pathological case of not being able
    to save PNG. Should not happen in the real world.

 lib/dia_image.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/lib/dia_image.c b/lib/dia_image.c
index a8066f2..8c87c93 100644
--- a/lib/dia_image.c
+++ b/lib/dia_image.c
@@ -311,6 +311,10 @@ dia_image_save(DiaImage *image, const gchar *filename)
     if (saved) {
       g_free (image->filename);
       image->filename = g_strdup (filename);
+    } else if (!type) {
+      /* pathologic case - pixbuf not even supporting PNG? */
+      message_error(_("Unsupported file format for saving:\n%s\n%s"),
+                    dia_message_filename(filename));
     } else {
       message_warning(_("Could not save file:\n%s\n%s"),
 		      dia_message_filename(filename),



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