Package: xfce4-sensors-plugin
Version: 0.10.99.6-1.dwfix
Followup-For: Bug #519181


Attached is a patch showing changes I made which fix the crash problem on my
own machine.  I created the patch like this:

diff  -u  hddtemp.c.orig  hddtemp.c  > ~/xfce4-sensors-plugin-0.10.99.6-1.diff


HTH,
Dave W.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (350, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28-2s13073.090316.desktop.uvesafb (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages xfce4-sensors-plugin depends on:
ii  libatk1.0-0                  1.24.0-2    The ATK accessibility toolkit
ii  libc6                        2.9-6       GNU C Library: Shared libraries
ii  libcairo2                    1.8.6-2+b1  The Cairo 2D vector graphics libra
ii  libfontconfig1               2.6.0-3     generic font configuration library
ii  libfreetype6                 2.3.9-4     FreeType 2 font engine, shared lib
ii  libglib2.0-0                 2.20.0-2    The GLib library of C routines
ii  libgtk2.0-0                  2.14.7-4+b1 The GTK+ graphical user interface 
ii  libpango1.0-0                1.22.4-2    Layout and rendering of internatio
ii  libsensors4                  1:3.1.0-2   library to read temperature/voltag
ii  libxfce4util4                4.4.2-3     Utility functions library for Xfce
ii  libxfcegui4-4                4.4.2-4     Basic GUI C functions for Xfce4
ii  xfce4-panel                  4.4.2-6     The Xfce4 desktop environment pane

Versions of packages xfce4-sensors-plugin recommends:
ii  hddtemp                    0.3-beta15-45 hard drive temperature monitoring 
ii  lm-sensors                 1:3.1.0-2     utilities to read temperature/volt

Versions of packages xfce4-sensors-plugin suggests:
pn  xsensors                      <none>     (no description available)

-- no debconf information
--- xfce4-sensors-plugin-0.10.99.6/lib/hddtemp.c	2008-11-03 19:03:05.000000000 -0500
+++ xfce4-sensors-plugin/xfce4-sensors-plugin-0.10.99.6/lib/hddtemp.c	2009-03-20 16:32:20.000000000 -0400
@@ -435,9 +435,6 @@
 {
     gchar *standard_output, *standard_error;
     gchar *cmd_line, *msg_text;
-#ifndef HAVE_LIBNOTIFY
-    gchar *checktext;
-#endif
     gint exit_status=0;
     double value;
     gboolean result, nevershowagain;
@@ -509,6 +506,10 @@
     else if ((exit_status==256 || (standard_error && strlen(standard_error)>0))
             && access (PATH_HDDTEMP, X_OK)==0) /* || strlen(standard_error)>0) */
     {
+#ifndef HAVE_LIBNOTIFY
+            gchar *checktext;
+#endif
+
         /* note that this check does only work for some versions of hddtemp. */
         if (!nevershowagain) {
             msg_text = g_strdup_printf(_("\"hddtemp\" was not executed correctly, "
@@ -533,6 +534,10 @@
 
             if (suppressmessage!=NULL)
                 *suppressmessage = nevershowagain;
+
+#ifndef HAVE_LIBNOTIFY
+            g_free (checktext);
+#endif
         }
         else {
             DBG  ("Suppressing dialog with exit_code=256 or output on standard_error");
@@ -549,8 +554,12 @@
 
     else if (error && (!result || exit_status!=0))
     {
-         DBG  ("error %s\n", error->message);
+        DBG  ("error %s\n", error->message);
         if (!nevershowagain) {
+#ifndef HAVE_LIBNOTIFY
+            gchar *checktext;
+#endif
+
             msg_text = g_strdup_printf (_("An error occurred when executing"
                                       " \"%s\":\n%s"), cmd_line, error->message);
 #ifdef HAVE_LIBNOTIFY
@@ -561,8 +570,13 @@
             nevershowagain = quick_message_with_checkbox (msg_text, checktext);
 #endif
 
-             if (suppressmessage!=NULL)
+            if (suppressmessage!=NULL)
                 *suppressmessage = nevershowagain;
+
+#ifndef HAVE_LIBNOTIFY
+            g_free (checktext);
+#endif
+
         }
         else {
             DBG  ("Suppressing dialog because of error in g_spawn_cl");
@@ -586,9 +600,6 @@
     g_free (standard_output);
     g_free (standard_error);
     g_free (msg_text);
-#ifndef HAVE_LIBNOTIFY
-    g_free (checktext);
-#endif
 
     TRACE ("leaves get_hddtemp_value");
 

Reply via email to