[Xfce4-commits] <xfce4-weather-plugin:master> Fix memory leaks

Florian Rivoal noreply at xfce.org
Sat Jan 15 16:24:01 CET 2011


Updating branch refs/heads/master
         to 9e7325b45fb760286b93210af330422eb1d47d7c (commit)
       from a7f3c0382fce3a6ebf7ceadc40454483d6346746 (commit)

commit 9e7325b45fb760286b93210af330422eb1d47d7c
Author: Florian Rivoal <frivoal at xfce.org>
Date:   Thu Jan 13 19:54:01 2011 +0900

    Fix memory leaks
    
    Apply parts of the patch proposed in bug #7067

 panel-plugin/weather-config.c |    2 ++
 panel-plugin/weather-http.c   |    6 +++++-
 panel-plugin/weather-search.c |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index ab9691b..74b4745 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -235,6 +235,8 @@ apply_options (xfceweather_dialog *dialog)
         {
           xfce_err (_("Please enter proxy settings"));
           gtk_widget_grab_focus (dialog->txt_proxy_host);
+          g_free (text);
+
           return;
         }
 
diff --git a/panel-plugin/weather-http.c b/panel-plugin/weather-http.c
index 8f46eec..30917de 100644
--- a/panel-plugin/weather-http.c
+++ b/panel-plugin/weather-http.c
@@ -281,7 +281,11 @@ weather_http_receive_data_idle (gpointer user_data)
       bytes = send (connection->fd, request + m, n - m, 0);
 
       if (weather_http_receive_data_check (connection, timeout))
-        return FALSE;
+        {
+          g_free (request);
+
+          return FALSE;
+        }
 
       /* check for problems */
       if (G_UNLIKELY (bytes < 0))
diff --git a/panel-plugin/weather-search.c b/panel-plugin/weather-search.c
index 026a85b..403dbcb 100644
--- a/panel-plugin/weather-search.c
+++ b/panel-plugin/weather-search.c
@@ -477,6 +477,7 @@ cb_geolocation (gboolean  succeed,
      if ((sane_str = sanitize_str (full_loc)) == NULL) {
        data->cb(NULL, NULL, data->user_data);
        g_free(data);
+       g_free(full_loc);
        return;
      }
      g_free(full_loc);



More information about the Xfce4-commits mailing list