[geocode-glib/gnome-3-12] forward: fix memory leaks



commit 12c116d619eea25c6f779a91b51b289ca6b6d0ff
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Thu May 8 12:15:02 2014 +0200

    forward: fix memory leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727861

 geocode-glib/geocode-location.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/geocode-glib/geocode-location.c b/geocode-glib/geocode-location.c
index 133c992..5b104ce 100644
--- a/geocode-glib/geocode-location.c
+++ b/geocode-glib/geocode-location.c
@@ -262,13 +262,16 @@ parse_geo_uri_parameters (GeocodeLocation *loc,
                 if (g_strcmp0 (val, "wgs84"))
                         goto err;
         }
-        return;
+        goto out;
 
  err:
        g_set_error_literal (error,
                             GEOCODE_ERROR,
                             GEOCODE_ERROR_PARSE,
                             "Failed to parse geo URI parameters");
+
+ out:
+       g_strfreev (parameters);
 }
 
 /*
@@ -374,18 +377,19 @@ parse_uri (GeocodeLocation *location,
         if (scheme == NULL)
                 goto err;
 
-        if (g_strcmp0 (scheme, "geo") == 0)
+        if (g_strcmp0 (scheme, "geo") == 0) {
                 parse_geo_uri (location, uri, error);
-        else
+                goto out;
+        } else
                 goto err;
 
-        return;
-
  err:
         g_set_error_literal (error,
                              GEOCODE_ERROR,
                              GEOCODE_ERROR_NOT_SUPPORTED,
                              "Unsupported or invalid URI scheme");
+ out:
+        g_free (scheme);
 }
 
 static void


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