[geocode-glib] forward: fix memory leaks
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geocode-glib] forward: fix memory leaks
- Date: Fri, 9 May 2014 19:06:39 +0000 (UTC)
commit a7fb78ec5b506e0bfd600529e672a13b81a22f64
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 2f9193d..3a0aa9f 100644
--- a/geocode-glib/geocode-location.c
+++ b/geocode-glib/geocode-location.c
@@ -313,13 +313,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);
}
/*
@@ -429,18 +432,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]