[gimp] plug-ins: check pointer before freeing.



commit 4849d41060ff6421475da587177bbb14974ac675
Author: Jehan <jehan girinstud io>
Date:   Sun Jan 14 00:49:05 2018 +0100

    plug-ins: check pointer before freeing.
    
    Thanks to Massimo for notifying about it.

 plug-ins/screenshot/screenshot-kwin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/screenshot/screenshot-kwin.c b/plug-ins/screenshot/screenshot-kwin.c
index 075996e..59ba543 100644
--- a/plug-ins/screenshot/screenshot-kwin.c
+++ b/plug-ins/screenshot/screenshot-kwin.c
@@ -86,9 +86,9 @@ screenshot_kwin_shoot (ScreenshotValues  *shootvals,
                        gint32            *image_ID,
                        GError           **error)
 {
-  gchar       *filename;
-  const gchar *method = NULL;
-  GVariant    *args   = NULL;
+  gchar       *filename = NULL;
+  const gchar *method   = NULL;
+  GVariant    *args     = NULL;
   GVariant    *retval;
   gint         monitor = shootvals->monitor;
   gint32       mask;
@@ -197,7 +197,8 @@ screenshot_kwin_shoot (ScreenshotValues  *shootvals,
 
  failure:
 
-  g_free (filename);
+  if (filename)
+    g_free (filename);
 
   g_object_unref (proxy);
   proxy = NULL;


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