[balsa] mime-widget-image: Avoid a scan-build palse positive



commit 0043ca0e16808b6870d7f9d51b537b78005fc01e
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Feb 18 22:12:42 2019 -0500

    mime-widget-image: Avoid a scan-build palse positive
    
            * src/balsa-mime-widget-image.c (img_check_size): avoid scan-build
            false positive.

 ChangeLog                     | 5 +++++
 src/balsa-mime-widget-image.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index 312af4d19..046ffa314 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * src/balsa-mime-widget-image.c (img_check_size): avoid scan-build
+       false positive.
+
 2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * libbalsa/imap/imap-handle.c (imap_body_from_stringi): guard
diff --git a/src/balsa-mime-widget-image.c b/src/balsa-mime-widget-image.c
index ad86415d5..ff214c211 100644
--- a/src/balsa-mime-widget-image.c
+++ b/src/balsa-mime-widget-image.c
@@ -199,11 +199,12 @@ img_check_size(GtkImage ** widget_p)
     GtkAllocation allocation;
 
     widget = *widget_p;
-    g_free(widget_p);
     if (!widget) {
+        g_free(widget_p);
        return FALSE;
     }
     g_object_remove_weak_pointer(G_OBJECT(widget), (gpointer *) widget_p);
+    g_free(widget_p);
 
     viewport = gtk_widget_get_ancestor(GTK_WIDGET(widget), GTK_TYPE_VIEWPORT);
     orig_width = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),


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